It's always good that an app has different behavior when device is connected/disconnected to a power station, or has different battery levels. Therefore, their absence in the code gives hints on the fact that the app is not energy optimized. The first situation requires a broadcast receiver registered on the actions ACTION_POWER_CONNECTED, ACTION_POWER_DISCONNECTED or just ACTION_POWER_SAVE_MODE_CHANGED. The second situation simply requires calls to PowerManager#isPowerSaveMode().