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

Commit e2a2e9b1 authored by Steve Elliott's avatar Steve Elliott
Browse files

Update GlobalActionPanelPlugin API with lockscreen state notifications

This allows for Global Action Panels to react to changes in the
device's lock state.

Bug: 129342406
Test: manual
Change-Id: I30785d259dea884ed9f23cffbdd8230fce0e7431
parent 1923b35e
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ import com.android.systemui.plugins.annotations.ProvidesInterface;
 * Plugin which provides a "Panel" {@link View} to be rendered inside of the GlobalActions menu.
 *
 * Implementations should construct a new {@link PanelViewController} with the given
 * {@link Callbacks} instance inside of {@link #onPanelShown(Callbacks)}, and should not hold onto
 * a reference, instead allowing Global Actions to manage the lifetime of the object.
 * {@link Callbacks} instance inside of {@link #onPanelShown(Callbacks, boolean)}, and should not
 * hold onto a reference, instead allowing Global Actions to manage the lifetime of the object.
 *
 * Under this assumption, {@link PanelViewController} represents the lifetime of a single invocation
 * of the Global Actions menu. The {@link View} for the Panel is generated when the
@@ -50,9 +50,10 @@ public interface GlobalActionsPanelPlugin extends Plugin {
     *
     * @param callbacks {@link Callbacks} instance that can be used by the Panel to interact with
     *                  the Global Actions menu.
     * @param deviceLocked Indicates whether or not the device is currently locked.
     * @return A {@link PanelViewController} instance used to receive Global Actions events.
     */
    PanelViewController onPanelShown(Callbacks callbacks);
    PanelViewController onPanelShown(Callbacks callbacks, boolean deviceLocked);

    /**
     * Provides methods to interact with the Global Actions menu.
@@ -92,5 +93,10 @@ public interface GlobalActionsPanelPlugin extends Plugin {
         * {@link #getPanelContent()}) is dismissed.
         */
        void onDismissed();

        /**
         * Invoked when the device is either locked or unlocked.
         */
        void onDeviceLockStateChanged(boolean locked);
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -410,7 +410,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
                                        mActivityStarter
                                                .startPendingIntentDismissingKeyguard(intent);
                                    }
                                })
                                },
                                mKeyguardManager.isDeviceLocked())
                        : null;
        ActionsDialog dialog = new ActionsDialog(mContext, mAdapter, panelViewController);
        dialog.setCanceledOnTouchOutside(false); // Handled by the custom class.