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

Commit 426c8bc1 authored by helencheuk's avatar helencheuk
Browse files

[Action Corner] Add action corner methods in LauncherProxy aidl

Add a new method in LauncherProxy aidl so SystemUI could notify Launcher when any launcher-related action corner is active.

Bug: 397182595
Flag: com.android.systemui.shared.cursor_hot_corner
Test: Manual, it builds

Change-Id: Id567f1815e133ce2f0d4866d53896e2fff5429ef
parent ad3850c3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -159,4 +159,10 @@ oneway interface ILauncherProxy {
     * Sent when {@link TaskbarDelegate#onDisplayRemoveSystemDecorations} is called.
     */
    void onDisplayRemoveSystemDecorations(int displayId) = 38;

    /**
     * Sent when active action corner is received in {@link ActionCornerInteractor}. Please refer to
     * {@link ActionCornerConstants.Action} for all possible actions.
     */
    void onActionCornerActivated(int action, int displayId) = 39;
}
+38 −0
Original line number Diff line number Diff line
/*
 * Copyright 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.shared.system.actioncorner;

import android.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class ActionCornerConstants {
    /** Go to the home screen. */
    public static final int HOME = 0;
    /** Open the overview screen. */
    public static final int OVERVIEW = 1;
    /** Open the notification shade. */
    public static final int NOTIFICATION = 2;
    /** Open the quick settings panel. */
    public static final int QUICK_SETTING = 3;

    @IntDef({HOME, OVERVIEW, NOTIFICATION, QUICK_SETTING})
    @Retention(RetentionPolicy.SOURCE)
    public @interface Action {
    }
}
+15 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ import com.android.systemui.shared.recents.ILauncherProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
import com.android.systemui.shared.system.actioncorner.ActionCornerConstants.Action;
import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeWindowController;
@@ -953,6 +954,20 @@ public class LauncherProxyService implements CallbackController<LauncherProxyLis
        }
    }

    /**
     * Notifies the launcher that an action corner has been activated, sending the corresponding
     * action and display id.
     */
    public void onActionCornerActivated(@Action int action, int displayId) {
        try {
            if (mLauncherProxy != null) {
                mLauncherProxy.onActionCornerActivated(action, displayId);
            }
        } catch (RemoteException e) {
            Log.e(TAG_OPS, "Failed to call onActionCornerActivated()", e);
        }
    }

    public void cleanupAfterDeath() {
        if (mInputFocusTransferStarted) {
            mHandler.post(() -> {