1

I'm trying to detect the PowerSaveMode change for battery. I'm using the method pm.isPowerSaveMode(). The problem that i have always a false result. I'm trying to update the statut to enable but always the result is false. I'm using three differents devices, S8+ (Android 9) , One plus(Android 10), Sony (Android 10)...

Any solution please ?

Younes Ben Tlili
  • 263
  • 1
  • 2
  • 15

1 Answers1

2

This is working fine in OnePlus(Android 10) and emulator(Android 10)

 PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
 boolean powerSaveMode = powerManager.isPowerSaveMode();
 Log.e("Power Saver", "Mode is " + powerSaveMode);
Nensi Kasundra
  • 1,980
  • 6
  • 21
  • 34