sdk: Add static isChargingControlSupported(ctx) method
This will let us use it without bothering to handle RuntimeException from HealthInterface contructor. Change-Id: I768c250d1e527b6fd8e49a40452b98404062cc18
This commit is contained in:
@@ -119,6 +119,21 @@ public class HealthInterface {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether charging control is supported
|
||||
*
|
||||
* @return true if charging control is supported
|
||||
*/
|
||||
public static boolean isChargingControlSupported(Context context) {
|
||||
try {
|
||||
return getInstance(context).isChargingControlSupported();
|
||||
} catch (RuntimeException e) {
|
||||
Log.e(TAG, e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the charging control enabled status
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user