Class ShadowBatteryManager

java.lang.Object
org.robolectric.shadows.ShadowBatteryManager

@Implements(android.os.BatteryManager.class) public class ShadowBatteryManager extends Object
  • Constructor Details

    • ShadowBatteryManager

      public ShadowBatteryManager()
  • Method Details

    • isCharging

      @Implementation(minSdk=23) protected boolean isCharging()
    • setIsCharging

      public void setIsCharging(boolean charging)
    • getIntProperty

      @Implementation(minSdk=21) protected int getIntProperty(int id)
    • setIntProperty

      public void setIntProperty(int id, int value)
    • getLongProperty

      @Implementation(minSdk=21) protected long getLongProperty(int id)
    • setLongProperty

      public void setLongProperty(int id, long value)
    • computeChargeTimeRemaining

      @Implementation(minSdk=28) protected long computeChargeTimeRemaining()
    • setChargeTimeRemaining

      public void setChargeTimeRemaining(long chargeTimeRemaining)
      Sets the value to be returned from BatteryManager.computeChargeTimeRemaining()