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

Commit e2a5d343 authored by Steve Kondik's avatar Steve Kondik
Browse files

wm: Add support for split screen button behavior

 * And make it the default for long-press recents like the navbar.

Change-Id: I432c80a2c9b29b9a02d64e29d484f92623b0648a
parent 720e3aee
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -998,6 +998,10 @@
            3 - Launch assist intent
            4 - Voice Search
            5 - In-app Search
            6 - Launch camera
            7 - Sleep
            8 - Last app
            9 - Toggle split screen
         This needs to match the constants in
         policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
    -->
@@ -1010,6 +1014,10 @@
            3 - Launch assist intent
            4 - Voice Search
            5 - In-app Search
            6 - Launch camera
            7 - Sleep
            8 - Last app
            9 - Toggle split screen
         This needs to match the constants in
         policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
    -->
@@ -1022,6 +1030,10 @@
            3 - Launch assist intent
            4 - Voice Search
            5 - In-app Search
            6 - Launch camera
            7 - Sleep
            8 - Last app
            9 - Toggle split screen
         This needs to match the constants in
         policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
    -->
@@ -1034,10 +1046,14 @@
            3 - Launch assist intent
            4 - Voice Search
            5 - In-app Search
            6 - Launch camera
            7 - Sleep
            8 - Last app
            9 - Toggle split screen
         This needs to match the constants in
         services/core/java/com/android/server/policy/policy/impl/PhoneWindowManager.java
    -->
    <integer name="config_longPressOnAppSwitchBehavior">0</integer>
    <integer name="config_longPressOnAppSwitchBehavior">9</integer>

    <!-- Hardware keys present on the device, stored as a bit field.
         This integer should equal the sum of the corresponding value for each
+12 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ import com.android.internal.policy.IKeyguardService;
import com.android.internal.policy.IShortcutService;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.util.ScreenShapeHelper;
import com.android.internal.util.cm.ActionUtils;
import com.android.internal.view.RotationPolicy;
import com.android.internal.widget.PointerLocationView;
import com.android.server.GestureLauncherService;
@@ -260,6 +261,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private static final int KEY_ACTION_LAUNCH_CAMERA = 6;
    private static final int KEY_ACTION_SLEEP = 7;
    private static final int KEY_ACTION_LAST_APP = 8;
    private static final int KEY_ACTION_SPLIT_SCREEN = 9;

    // Masks for checking presence of hardware keys.
    // Must match values in core/res/res/values/config.xml
@@ -1706,6 +1708,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case KEY_ACTION_LAST_APP:
                ActionUtils.switchToLastApp(mContext, mCurrentUserId);
                break;
            case KEY_ACTION_SPLIT_SCREEN:
                toggleSplitScreen();
                break;
            default:
                break;
         }
@@ -4142,6 +4147,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    private void toggleSplitScreen() {
        StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
        if (statusbar != null) {
            statusbar.toggleSplitScreen();
        }
    }

    @Override
    public void showRecentApps(boolean fromHome) {
        mHandler.removeMessages(MSG_DISPATCH_SHOW_RECENTS);