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

Commit 8a6c2241 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Reload theme when ui mode changes"

parents 39325373 e5b7dc70
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ import com.android.systemui.Interpolators;
import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.plugins.GlobalActions.GlobalActionsManager;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.util.EmergencyDialerConstants;
import com.android.systemui.volume.SystemUIInterpolators.LogAccelerateInterpolator;

@@ -102,7 +103,8 @@ import java.util.List;
 * is provisioned.
 */
class GlobalActionsDialog implements DialogInterface.OnDismissListener,
        DialogInterface.OnClickListener, DialogInterface.OnShowListener {
        DialogInterface.OnClickListener, DialogInterface.OnShowListener,
        ConfigurationController.ConfigurationListener {

    static public final String SYSTEM_DIALOG_REASON_KEY = "reason";
    static public final String SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS = "globalactions";
@@ -197,6 +199,8 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,

        mEmergencyAffordanceManager = new EmergencyAffordanceManager(context);
        mScreenshotHelper = new ScreenshotHelper(context);

        Dependency.get(ConfigurationController.class).addCallback(this);
    }

    /**
@@ -417,6 +421,15 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
                || state == SOME_AUTH_REQUIRED_AFTER_USER_REQUEST);
    }

    @Override
    public void onUiModeChanged() {
        mContext.getTheme().applyStyle(mContext.getThemeResId(), true);
    }

    public void destroy() {
        Dependency.get(ConfigurationController.class).removeCallback(this);
    }

    private final class PowerAction extends SinglePressAction implements LongPressAction {
        private PowerAction() {
            super(R.drawable.ic_lock_power_off,
+4 −0
Original line number Diff line number Diff line
@@ -61,6 +61,10 @@ public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks
    @Override
    public void destroy() {
        SysUiServiceProvider.getComponent(mContext, CommandQueue.class).removeCallbacks(this);
        if (mGlobalActions != null) {
            mGlobalActions.destroy();
            mGlobalActions = null;
        }
    }

    @Override