Loading core/java/android/app/IActivityTaskManager.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import android.os.StrictMode; import android.os.WorkSource; import android.service.voice.IVoiceInteractionSession; import android.view.IRecentsAnimationRunner; import android.view.IRemoteAnimationRunner; import android.view.RemoteAnimationDefinition; import android.view.RemoteAnimationAdapter; import android.window.IWindowOrganizerController; Loading Loading @@ -344,4 +345,9 @@ interface IActivityTaskManager { * @param caller is the IApplicationThread representing the calling process. */ void setRunningRemoteTransitionDelegate(in IApplicationThread caller); /** * Prepare the back preview in the server */ void startBackPreview(IRemoteAnimationRunner runner); } libs/WindowManager/Shell/src/com/android/wm/shell/back/BackPreviewHandler.java 0 → 100644 +41 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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.wm.shell.back; import android.os.SystemProperties; import android.view.IWindowManager; import javax.inject.Inject; /** * Handle the preview of what a back gesture will lead to. */ public class BackPreviewHandler { private static final String BACK_PREDICTABILITY_PROP = "persist.debug.back_predictability"; public static boolean isEnabled() { return SystemProperties.getInt(BACK_PREDICTABILITY_PROP, 0) > 0; } private final IWindowManager mWmService; @Inject public BackPreviewHandler(IWindowManager windowManagerService) { mWmService = windowManagerService; } } services/core/java/com/android/server/wm/ActivityTaskManagerService.java +15 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,7 @@ import android.util.SparseArray; import android.util.TimeUtils; import android.util.proto.ProtoOutputStream; import android.view.IRecentsAnimationRunner; import android.view.IRemoteAnimationRunner; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationDefinition; import android.view.WindowManager; Loading Loading @@ -455,6 +456,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { VrController mVrController; KeyguardController mKeyguardController; private final ClientLifecycleManager mLifecycleManager; @Nullable private final BackGestureController mBackGestureController; private TaskChangeNotificationController mTaskChangeNotificationController; /** The controller for all operations related to locktask. */ private LockTaskController mLockTaskController; Loading Loading @@ -814,6 +819,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mSystemThread = ActivityThread.currentActivityThread(); mUiContext = mSystemThread.getSystemUiContext(); mLifecycleManager = new ClientLifecycleManager(); mBackGestureController = BackGestureController.isEnabled() ? new BackGestureController() : null; mVisibleActivityProcessTracker = new VisibleActivityProcessTracker(this); mInternal = new LocalService(); GL_ES_VERSION = SystemProperties.getInt("ro.opengles.version", GL_ES_VERSION_UNDEFINED); Loading Loading @@ -1747,6 +1754,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override public void startBackPreview(IRemoteAnimationRunner runner) { if (mBackGestureController == null) { return; } mBackGestureController.startBackPreview(); } /** * Public API to check if the client is allowed to start an activity on specified display. * Loading services/core/java/com/android/server/wm/BackGestureController.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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.server.wm; import android.os.SystemProperties; /** * Controller to handle actions related to the back gesture on the server side. */ public class BackGestureController { private static final String BACK_PREDICTABILITY_PROP = "persist.debug.back_predictability"; public static boolean isEnabled() { return SystemProperties.getInt(BACK_PREDICTABILITY_PROP, 0) > 0; } /** * Start a remote animation the back gesture. */ public void startBackPreview() { } } Loading
core/java/android/app/IActivityTaskManager.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import android.os.StrictMode; import android.os.WorkSource; import android.service.voice.IVoiceInteractionSession; import android.view.IRecentsAnimationRunner; import android.view.IRemoteAnimationRunner; import android.view.RemoteAnimationDefinition; import android.view.RemoteAnimationAdapter; import android.window.IWindowOrganizerController; Loading Loading @@ -344,4 +345,9 @@ interface IActivityTaskManager { * @param caller is the IApplicationThread representing the calling process. */ void setRunningRemoteTransitionDelegate(in IApplicationThread caller); /** * Prepare the back preview in the server */ void startBackPreview(IRemoteAnimationRunner runner); }
libs/WindowManager/Shell/src/com/android/wm/shell/back/BackPreviewHandler.java 0 → 100644 +41 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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.wm.shell.back; import android.os.SystemProperties; import android.view.IWindowManager; import javax.inject.Inject; /** * Handle the preview of what a back gesture will lead to. */ public class BackPreviewHandler { private static final String BACK_PREDICTABILITY_PROP = "persist.debug.back_predictability"; public static boolean isEnabled() { return SystemProperties.getInt(BACK_PREDICTABILITY_PROP, 0) > 0; } private final IWindowManager mWmService; @Inject public BackPreviewHandler(IWindowManager windowManagerService) { mWmService = windowManagerService; } }
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +15 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,7 @@ import android.util.SparseArray; import android.util.TimeUtils; import android.util.proto.ProtoOutputStream; import android.view.IRecentsAnimationRunner; import android.view.IRemoteAnimationRunner; import android.view.RemoteAnimationAdapter; import android.view.RemoteAnimationDefinition; import android.view.WindowManager; Loading Loading @@ -455,6 +456,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { VrController mVrController; KeyguardController mKeyguardController; private final ClientLifecycleManager mLifecycleManager; @Nullable private final BackGestureController mBackGestureController; private TaskChangeNotificationController mTaskChangeNotificationController; /** The controller for all operations related to locktask. */ private LockTaskController mLockTaskController; Loading Loading @@ -814,6 +819,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { mSystemThread = ActivityThread.currentActivityThread(); mUiContext = mSystemThread.getSystemUiContext(); mLifecycleManager = new ClientLifecycleManager(); mBackGestureController = BackGestureController.isEnabled() ? new BackGestureController() : null; mVisibleActivityProcessTracker = new VisibleActivityProcessTracker(this); mInternal = new LocalService(); GL_ES_VERSION = SystemProperties.getInt("ro.opengles.version", GL_ES_VERSION_UNDEFINED); Loading Loading @@ -1747,6 +1754,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override public void startBackPreview(IRemoteAnimationRunner runner) { if (mBackGestureController == null) { return; } mBackGestureController.startBackPreview(); } /** * Public API to check if the client is allowed to start an activity on specified display. * Loading
services/core/java/com/android/server/wm/BackGestureController.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 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.server.wm; import android.os.SystemProperties; /** * Controller to handle actions related to the back gesture on the server side. */ public class BackGestureController { private static final String BACK_PREDICTABILITY_PROP = "persist.debug.back_predictability"; public static boolean isEnabled() { return SystemProperties.getInt(BACK_PREDICTABILITY_PROP, 0) > 0; } /** * Start a remote animation the back gesture. */ public void startBackPreview() { } }