2014-01-06 30 views
1

Android KitKat 4.4中有省电模式。它将优化GPS和其他功能以节省电池寿命。是否可以检查手机是否处于省电模式?检查kitkat中的省电模式4.4

+0

什么待机省电模式?你可以谈论三星特有的功能吗? Google的股票KitKat没有这种东西。 – casraf

+2

@ChenAsraf,AFAIK,OP正在谈论“位置模式”设置。在这里,三种选择之一就是“省电”。 – ozbek

回答

1

之后应该帮助,请注意,这仅适用于API级别19+:

private void checkLocationModeSettings() { 
    int mode = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE, 
      Settings.Secure.LOCATION_MODE_OFF); 

    switch (mode) { 
     case Settings.Secure.LOCATION_MODE_SENSORS_ONLY: 
      Log.d(TAG, "Sensor only mode"); 
      break; 
     case Settings.Secure.LOCATION_MODE_BATTERY_SAVING: 
      Log.d(TAG, "Battery saving mode"); 
      break; 
     case Settings.Secure.LOCATION_MODE_HIGH_ACCURACY: 
      Log.d(TAG, "High accuracy mode"); 
      break; 
     case Settings.Secure.LOCATION_MODE_OFF: 
     default: 
      Log.d(TAG, "Location access is disabled"); 
    } 
} 
+0

谢谢@shoe鼠:) – user1002448

相关问题