Remove plug/unplug condition for the incompatible charging state
Remove the plug/unplug condition checking for the incompatible charging state, since system will send the intent again and clear the state directly (https://b.corp.google.com/issues/276403405#comment3) Bug: 276403405 Fix: 276403405 Test: atest KeyguardIndicationControllerTest KeyguardUpdateMonitorTest Change-Id: Ibabbfd047d99bbb5a2e9d6553ea8a708ff797bd0
This commit is contained in:
@@ -1759,10 +1759,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
||||
MSG_TIMEZONE_UPDATE, intent.getStringExtra(Intent.EXTRA_TIMEZONE));
|
||||
mHandler.sendMessage(msg);
|
||||
} else if (Intent.ACTION_BATTERY_CHANGED.equals(action)) {
|
||||
// Clear incompatible charger state when device is unplugged.
|
||||
if (!BatteryStatus.isPluggedIn(intent)) {
|
||||
mIncompatibleCharger = false;
|
||||
}
|
||||
final Message msg = mHandler.obtainMessage(
|
||||
MSG_BATTERY_UPDATE, new BatteryStatus(intent, mIncompatibleCharger));
|
||||
mHandler.sendMessage(msg);
|
||||
|
||||
@@ -2527,19 +2527,6 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
||||
assertThat(mKeyguardUpdateMonitor.mIncompatibleCharger).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBatteryChangedIntent_unplugDevice_resetIncompatibleCharger() {
|
||||
mKeyguardUpdateMonitor.mIncompatibleCharger = true;
|
||||
Intent batteryChangedIntent =
|
||||
getBatteryIntent().putExtra(BatteryManager.EXTRA_PLUGGED, -1);
|
||||
|
||||
mKeyguardUpdateMonitor.mBroadcastReceiver.onReceive(mContext, batteryChangedIntent);
|
||||
|
||||
BatteryStatus status = verifyRefreshBatteryInfo();
|
||||
assertThat(status.incompatibleCharger.get()).isFalse();
|
||||
assertThat(mKeyguardUpdateMonitor.mIncompatibleCharger).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void unfoldWakeup_requestActiveUnlock_forceDismissKeyguard()
|
||||
throws RemoteException {
|
||||
|
||||
Reference in New Issue
Block a user