1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-01-31 00:45:00 +01:00

Merge pull request #78 from GeMotionX/patch-15

add wireless power adapter judgement
This commit is contained in:
Mariotaku 2015-03-20 12:23:10 +08:00
commit 0af78d9c11

View File

@ -37,7 +37,7 @@ public class SpiceProfilingUtil {
final Intent intent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
if (intent == null) return false;
final int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB;
return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS;
}
public static boolean log(final Context context, final String msg) {