Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb44a7de authored by John Spurlock's avatar John Spurlock
Browse files

PowerUI: dismiss warning notifications when falling back.

The full-screen intents simply fire broadcasts to open fallback
dialogs.  This means the warning notifications are left visible
under the dialog on the lockscreen, or after the dialog is
quickly dismissed.

Once we launch the fallback dialogs, there is no reason for the
notification form to exist.

Bug:13329308
Change-Id: I5735c65d7e8eb620493d3ef3a2cfc27f75cecbb5
parent 4a1ca967
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import android.os.Handler;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import android.util.Slog;
import android.view.ContextThemeWrapper;
import android.view.View;
@@ -312,6 +311,12 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {

    @Override
    public void dismissInvalidChargerWarning() {
        dismissInvalidChargerNotification();
        mFallbackDialogs.dismissInvalidChargerWarning();
    }

    private void dismissInvalidChargerNotification() {
        Slog.i(TAG, "dismissing invalid charger notification");
        mInvalidCharger = false;
        updateNotification();
    }
@@ -355,10 +360,12 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
        @Override
        public void onReceive(Context context, Intent intent) {
            final String action = intent.getAction();
            Log.d(TAG, "got " + action);
            Slog.i(TAG, "Received " + action);
            if (action.equals(ACTION_SHOW_FALLBACK_WARNING)) {
                dismissLowBatteryNotification();
                mFallbackDialogs.showLowBatteryWarning(false /*playSound*/);
            } else if (action.equals(ACTION_SHOW_FALLBACK_CHARGER)) {
                dismissInvalidChargerNotification();
                mFallbackDialogs.showInvalidChargerWarning();
            } else if (action.equals(ACTION_SHOW_BATTERY_SETTINGS)) {
                dismissLowBatteryNotification();