File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
lib/android_build/maesdk/src/main/java/com/microsoft/applications/events Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,17 @@ class PowerInfoReceiver extends android.content.BroadcastReceiver {
51
51
}
52
52
53
53
public final void onReceive (android .content .Context context , android .content .Intent intent ) {
54
- final int status = intent .getIntExtra (BatteryManager .EXTRA_STATUS , -1 );
55
- final boolean isCharging =
54
+ m_parent .executeTask (new FutureTask <>(() -> {
55
+ final int status = intent .getIntExtra (BatteryManager .EXTRA_STATUS , -1 );
56
+ final boolean isCharging =
56
57
status == BatteryManager .BATTERY_STATUS_CHARGING
57
58
|| status == BatteryManager .BATTERY_STATUS_FULL ;
58
- boolean isLow = false ;
59
- if (Build .VERSION .SDK_INT >= 28 ) {
60
- isLow = intent .getBooleanExtra (BatteryManager .EXTRA_BATTERY_LOW , false );
61
- }
62
- m_parent .onPowerChange (isCharging , isLow );
59
+ boolean isLow = false ;
60
+ if (Build .VERSION .SDK_INT >= 28 ) {
61
+ isLow = intent .getBooleanExtra (BatteryManager .EXTRA_BATTERY_LOW , false );
62
+ }
63
+ m_parent .onPowerChange (isCharging , isLow );
64
+ }, true ));
63
65
}
64
66
}
65
67
You can’t perform that action at this time.
0 commit comments