Loading go/quickstep/src/com/android/quickstep/TouchInteractionService.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -52,6 +52,7 @@ public class TouchInteractionService extends Service { ISystemUiProxy iSystemUiProxy = ISystemUiProxy.Stub ISystemUiProxy iSystemUiProxy = ISystemUiProxy.Stub .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); mRecentsModel.setSystemUiProxy(iSystemUiProxy); mRecentsModel.setSystemUiProxy(iSystemUiProxy); mRecentsModel.onInitializeSystemUI(bundle); } } @Override @Override Loading @@ -77,6 +78,11 @@ public class TouchInteractionService extends Service { mOverviewCommandHelper.onTip(actionType, viewType); mOverviewCommandHelper.onTip(actionType, viewType); } } @Override public void onAssistantAvailable(boolean available) { // TODO handle assistant } /** Deprecated methods **/ /** Deprecated methods **/ public void onQuickStep(MotionEvent motionEvent) { } public void onQuickStep(MotionEvent motionEvent) { } Loading quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -29,11 +29,11 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.ObjectAnimator; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.RectF; import android.graphics.Region; import android.graphics.Region; import android.os.UserHandle; import android.view.MotionEvent; import android.view.MotionEvent; import android.view.View; import android.view.View; import android.view.animation.Interpolator; import android.view.animation.Interpolator; Loading Loading @@ -102,9 +102,10 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe final RecentsView recentsView = activity.getOverviewPanel(); final RecentsView recentsView = activity.getOverviewPanel(); final TaskView runningTaskView = recentsView.getRunningTaskView(); final TaskView runningTaskView = recentsView.getRunningTaskView(); final View workspaceView; final View workspaceView; if (runningTaskView != null) { if (runningTaskView != null && runningTaskView.getTask().key.getComponent() != null) { ComponentName component = runningTaskView.getTask().key.sourceComponent; workspaceView = activity.getWorkspace().getFirstMatchForAppClose( workspaceView = activity.getWorkspace().getFirstMatchForAppClose(component); runningTaskView.getTask().key.getComponent().getPackageName(), UserHandle.of(runningTaskView.getTask().key.userId)); } else { } else { workspaceView = null; workspaceView = null; } } Loading quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,7 @@ public class TouchInteractionService extends Service { .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); runWhenUserUnlocked(() -> { runWhenUserUnlocked(() -> { mRecentsModel.setSystemUiProxy(mISystemUiProxy); mRecentsModel.setSystemUiProxy(mISystemUiProxy); mRecentsModel.onInitializeSystemUI(bundle); mOverviewInteractionState.setSystemUiProxy(mISystemUiProxy); mOverviewInteractionState.setSystemUiProxy(mISystemUiProxy); }); }); Loading Loading @@ -121,6 +122,11 @@ public class TouchInteractionService extends Service { mOverviewCommandHelper.onTip(actionType, viewType); mOverviewCommandHelper.onTip(actionType, viewType); } } @Override public void onAssistantAvailable(boolean available) { mAssistantAvailable = available; } /** Deprecated methods **/ /** Deprecated methods **/ public void onQuickStep(MotionEvent motionEvent) { } public void onQuickStep(MotionEvent motionEvent) { } Loading Loading @@ -174,6 +180,7 @@ public class TouchInteractionService extends Service { private TaskOverlayFactory mTaskOverlayFactory; private TaskOverlayFactory mTaskOverlayFactory; private InputConsumerController mInputConsumer; private InputConsumerController mInputConsumer; private SwipeSharedState mSwipeSharedState; private SwipeSharedState mSwipeSharedState; private boolean mAssistantAvailable; private boolean mIsUserUnlocked; private boolean mIsUserUnlocked; private List<Runnable> mOnUserUnlockedCallbacks; private List<Runnable> mOnUserUnlockedCallbacks; Loading Loading @@ -308,7 +315,7 @@ public class TouchInteractionService extends Service { if (runningTaskInfo == null && !mSwipeSharedState.goingToLauncher) { if (runningTaskInfo == null && !mSwipeSharedState.goingToLauncher) { return InputConsumer.NO_OP; return InputConsumer.NO_OP; } else if (mOverviewInteractionState.isSwipeUpGestureEnabled() } else if (mAssistantAvailable && mOverviewInteractionState.isSwipeUpGestureEnabled() && FeatureFlags.ENABLE_ASSISTANT_GESTURE.get() && FeatureFlags.ENABLE_ASSISTANT_GESTURE.get() && AssistantTouchConsumer.withinTouchRegion(this, event.getX())) { && AssistantTouchConsumer.withinTouchRegion(this, event.getX())) { return new AssistantTouchConsumer(this, mRecentsModel.getSystemUiProxy()); return new AssistantTouchConsumer(this, mRecentsModel.getSystemUiProxy()); Loading quickstep/src/com/android/quickstep/RecentsModel.java +11 −34 Original line number Original line Diff line number Diff line Loading @@ -16,12 +16,15 @@ package com.android.quickstep; package com.android.quickstep; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUPPORTS_WINDOW_CORNERS; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS; import android.annotation.TargetApi; import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.ActivityManager; import android.content.ComponentCallbacks2; import android.content.ComponentCallbacks2; import android.content.Context; import android.content.Context; import android.os.Build; import android.os.Build; import android.os.Bundle; import android.os.HandlerThread; import android.os.HandlerThread; import android.os.Process; import android.os.Process; import android.os.RemoteException; import android.os.RemoteException; Loading Loading @@ -59,8 +62,8 @@ public class RecentsModel extends TaskStackChangeListener { private final TaskIconCache mIconCache; private final TaskIconCache mIconCache; private final TaskThumbnailCache mThumbnailCache; private final TaskThumbnailCache mThumbnailCache; private float mWindowCornerRadius = -1; private float mWindowCornerRadius = 0; private Boolean mSupportsRoundedCornersOnWindows; private boolean mSupportsRoundedCornersOnWindows; private RecentsModel(Context context) { private RecentsModel(Context context) { mContext = context; mContext = context; Loading @@ -73,6 +76,12 @@ public class RecentsModel extends TaskStackChangeListener { ActivityManagerWrapper.getInstance().registerTaskStackListener(this); ActivityManagerWrapper.getInstance().registerTaskStackListener(this); } } public void onInitializeSystemUI(Bundle params) { mWindowCornerRadius = params.getFloat(KEY_EXTRA_WINDOW_CORNER_RADIUS, 0); mSupportsRoundedCornersOnWindows = params.getBoolean(KEY_EXTRA_SUPPORTS_WINDOW_CORNERS, false); } public TaskIconCache getIconCache() { public TaskIconCache getIconCache() { return mIconCache; return mIconCache; } } Loading Loading @@ -182,42 +191,10 @@ public class RecentsModel extends TaskStackChangeListener { } } public float getWindowCornerRadius() { public float getWindowCornerRadius() { // The window corner radius is expressed in pixels and won't change if the // display density changes. It's safe to cache the value. if (mWindowCornerRadius == -1) { if (mSystemUiProxy != null) { try { mWindowCornerRadius = mSystemUiProxy.getWindowCornerRadius(); } catch (RemoteException e) { Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner " + "radius"); return 0; } } else { Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius"); return 0; } } return mWindowCornerRadius; return mWindowCornerRadius; } } public boolean supportsRoundedCornersOnWindows() { public boolean supportsRoundedCornersOnWindows() { if (mSupportsRoundedCornersOnWindows == null) { if (mSystemUiProxy != null) { try { mSupportsRoundedCornersOnWindows = mSystemUiProxy.supportsRoundedCornersOnWindows(); } catch (RemoteException e) { Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner " + "radius"); return false; } } else { Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius"); return false; } } return mSupportsRoundedCornersOnWindows; return mSupportsRoundedCornersOnWindows; } } Loading quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java +18 −15 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue; import android.provider.Settings; import android.provider.Settings; import android.util.Log; import androidx.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry; Loading @@ -46,6 +47,8 @@ import java.util.concurrent.Executor; */ */ public class QuickStepOnOffRule implements TestRule { public class QuickStepOnOffRule implements TestRule { static final String TAG = "QuickStepOnOffRule"; public enum Mode { public enum Mode { ON, OFF, BOTH ON, OFF, BOTH } } Loading Loading @@ -73,14 +76,17 @@ public class QuickStepOnOffRule implements TestRule { return new Statement() { return new Statement() { @Override @Override public void evaluate() throws Throwable { public void evaluate() throws Throwable { try { if (SwipeUpSetting.isSwipeUpSettingAvailable()) { if (SwipeUpSetting.isSwipeUpSettingAvailable()) { try { if (mode == ON || mode == BOTH) { if (mode == ON || mode == BOTH) { evaluateWithQuickstepOn(); evaluateWithQuickstepOn(); } } if (mode == OFF || mode == BOTH) { if (mode == OFF || mode == BOTH) { evaluateWithQuickstepOff(); evaluateWithQuickstepOff(); } } } finally { setSwipeUpSetting(null); } } else { } else { // Execute without changing the setting, if the requested mode is // Execute without changing the setting, if the requested mode is // compatible. // compatible. Loading @@ -92,13 +98,10 @@ public class QuickStepOnOffRule implements TestRule { evaluateWithoutChangingSetting(base); evaluateWithoutChangingSetting(base); } } } } } finally { setSwipeUpSetting(null); } } } public void setSwipeUpSetting(String value) { public void setSwipeUpSetting(String value) { Log.d(TAG, "setSwipeUpSetting: " + value); assertTrue("Couldn't change Quickstep mode", assertTrue("Couldn't change Quickstep mode", Settings.Secure.putString( Settings.Secure.putString( InstrumentationRegistry.getInstrumentation().getTargetContext(). InstrumentationRegistry.getInstrumentation().getTargetContext(). Loading Loading
go/quickstep/src/com/android/quickstep/TouchInteractionService.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -52,6 +52,7 @@ public class TouchInteractionService extends Service { ISystemUiProxy iSystemUiProxy = ISystemUiProxy.Stub ISystemUiProxy iSystemUiProxy = ISystemUiProxy.Stub .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); mRecentsModel.setSystemUiProxy(iSystemUiProxy); mRecentsModel.setSystemUiProxy(iSystemUiProxy); mRecentsModel.onInitializeSystemUI(bundle); } } @Override @Override Loading @@ -77,6 +78,11 @@ public class TouchInteractionService extends Service { mOverviewCommandHelper.onTip(actionType, viewType); mOverviewCommandHelper.onTip(actionType, viewType); } } @Override public void onAssistantAvailable(boolean available) { // TODO handle assistant } /** Deprecated methods **/ /** Deprecated methods **/ public void onQuickStep(MotionEvent motionEvent) { } public void onQuickStep(MotionEvent motionEvent) { } Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -29,11 +29,11 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.ObjectAnimator; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.RectF; import android.graphics.Region; import android.graphics.Region; import android.os.UserHandle; import android.view.MotionEvent; import android.view.MotionEvent; import android.view.View; import android.view.View; import android.view.animation.Interpolator; import android.view.animation.Interpolator; Loading Loading @@ -102,9 +102,10 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe final RecentsView recentsView = activity.getOverviewPanel(); final RecentsView recentsView = activity.getOverviewPanel(); final TaskView runningTaskView = recentsView.getRunningTaskView(); final TaskView runningTaskView = recentsView.getRunningTaskView(); final View workspaceView; final View workspaceView; if (runningTaskView != null) { if (runningTaskView != null && runningTaskView.getTask().key.getComponent() != null) { ComponentName component = runningTaskView.getTask().key.sourceComponent; workspaceView = activity.getWorkspace().getFirstMatchForAppClose( workspaceView = activity.getWorkspace().getFirstMatchForAppClose(component); runningTaskView.getTask().key.getComponent().getPackageName(), UserHandle.of(runningTaskView.getTask().key.userId)); } else { } else { workspaceView = null; workspaceView = null; } } Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,7 @@ public class TouchInteractionService extends Service { .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); runWhenUserUnlocked(() -> { runWhenUserUnlocked(() -> { mRecentsModel.setSystemUiProxy(mISystemUiProxy); mRecentsModel.setSystemUiProxy(mISystemUiProxy); mRecentsModel.onInitializeSystemUI(bundle); mOverviewInteractionState.setSystemUiProxy(mISystemUiProxy); mOverviewInteractionState.setSystemUiProxy(mISystemUiProxy); }); }); Loading Loading @@ -121,6 +122,11 @@ public class TouchInteractionService extends Service { mOverviewCommandHelper.onTip(actionType, viewType); mOverviewCommandHelper.onTip(actionType, viewType); } } @Override public void onAssistantAvailable(boolean available) { mAssistantAvailable = available; } /** Deprecated methods **/ /** Deprecated methods **/ public void onQuickStep(MotionEvent motionEvent) { } public void onQuickStep(MotionEvent motionEvent) { } Loading Loading @@ -174,6 +180,7 @@ public class TouchInteractionService extends Service { private TaskOverlayFactory mTaskOverlayFactory; private TaskOverlayFactory mTaskOverlayFactory; private InputConsumerController mInputConsumer; private InputConsumerController mInputConsumer; private SwipeSharedState mSwipeSharedState; private SwipeSharedState mSwipeSharedState; private boolean mAssistantAvailable; private boolean mIsUserUnlocked; private boolean mIsUserUnlocked; private List<Runnable> mOnUserUnlockedCallbacks; private List<Runnable> mOnUserUnlockedCallbacks; Loading Loading @@ -308,7 +315,7 @@ public class TouchInteractionService extends Service { if (runningTaskInfo == null && !mSwipeSharedState.goingToLauncher) { if (runningTaskInfo == null && !mSwipeSharedState.goingToLauncher) { return InputConsumer.NO_OP; return InputConsumer.NO_OP; } else if (mOverviewInteractionState.isSwipeUpGestureEnabled() } else if (mAssistantAvailable && mOverviewInteractionState.isSwipeUpGestureEnabled() && FeatureFlags.ENABLE_ASSISTANT_GESTURE.get() && FeatureFlags.ENABLE_ASSISTANT_GESTURE.get() && AssistantTouchConsumer.withinTouchRegion(this, event.getX())) { && AssistantTouchConsumer.withinTouchRegion(this, event.getX())) { return new AssistantTouchConsumer(this, mRecentsModel.getSystemUiProxy()); return new AssistantTouchConsumer(this, mRecentsModel.getSystemUiProxy()); Loading
quickstep/src/com/android/quickstep/RecentsModel.java +11 −34 Original line number Original line Diff line number Diff line Loading @@ -16,12 +16,15 @@ package com.android.quickstep; package com.android.quickstep; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUPPORTS_WINDOW_CORNERS; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS; import android.annotation.TargetApi; import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.ActivityManager; import android.content.ComponentCallbacks2; import android.content.ComponentCallbacks2; import android.content.Context; import android.content.Context; import android.os.Build; import android.os.Build; import android.os.Bundle; import android.os.HandlerThread; import android.os.HandlerThread; import android.os.Process; import android.os.Process; import android.os.RemoteException; import android.os.RemoteException; Loading Loading @@ -59,8 +62,8 @@ public class RecentsModel extends TaskStackChangeListener { private final TaskIconCache mIconCache; private final TaskIconCache mIconCache; private final TaskThumbnailCache mThumbnailCache; private final TaskThumbnailCache mThumbnailCache; private float mWindowCornerRadius = -1; private float mWindowCornerRadius = 0; private Boolean mSupportsRoundedCornersOnWindows; private boolean mSupportsRoundedCornersOnWindows; private RecentsModel(Context context) { private RecentsModel(Context context) { mContext = context; mContext = context; Loading @@ -73,6 +76,12 @@ public class RecentsModel extends TaskStackChangeListener { ActivityManagerWrapper.getInstance().registerTaskStackListener(this); ActivityManagerWrapper.getInstance().registerTaskStackListener(this); } } public void onInitializeSystemUI(Bundle params) { mWindowCornerRadius = params.getFloat(KEY_EXTRA_WINDOW_CORNER_RADIUS, 0); mSupportsRoundedCornersOnWindows = params.getBoolean(KEY_EXTRA_SUPPORTS_WINDOW_CORNERS, false); } public TaskIconCache getIconCache() { public TaskIconCache getIconCache() { return mIconCache; return mIconCache; } } Loading Loading @@ -182,42 +191,10 @@ public class RecentsModel extends TaskStackChangeListener { } } public float getWindowCornerRadius() { public float getWindowCornerRadius() { // The window corner radius is expressed in pixels and won't change if the // display density changes. It's safe to cache the value. if (mWindowCornerRadius == -1) { if (mSystemUiProxy != null) { try { mWindowCornerRadius = mSystemUiProxy.getWindowCornerRadius(); } catch (RemoteException e) { Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner " + "radius"); return 0; } } else { Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius"); return 0; } } return mWindowCornerRadius; return mWindowCornerRadius; } } public boolean supportsRoundedCornersOnWindows() { public boolean supportsRoundedCornersOnWindows() { if (mSupportsRoundedCornersOnWindows == null) { if (mSystemUiProxy != null) { try { mSupportsRoundedCornersOnWindows = mSystemUiProxy.supportsRoundedCornersOnWindows(); } catch (RemoteException e) { Log.w(TAG, "Connection to ISystemUIProxy was lost, ignoring window corner " + "radius"); return false; } } else { Log.w(TAG, "ISystemUIProxy is null, ignoring window corner radius"); return false; } } return mSupportsRoundedCornersOnWindows; return mSupportsRoundedCornersOnWindows; } } Loading
quickstep/tests/src/com/android/quickstep/QuickStepOnOffRule.java +18 −15 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.systemui.shared.system.SettingsCompat.SWIPE_UP_SETTING import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue; import android.provider.Settings; import android.provider.Settings; import android.util.Log; import androidx.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry; Loading @@ -46,6 +47,8 @@ import java.util.concurrent.Executor; */ */ public class QuickStepOnOffRule implements TestRule { public class QuickStepOnOffRule implements TestRule { static final String TAG = "QuickStepOnOffRule"; public enum Mode { public enum Mode { ON, OFF, BOTH ON, OFF, BOTH } } Loading Loading @@ -73,14 +76,17 @@ public class QuickStepOnOffRule implements TestRule { return new Statement() { return new Statement() { @Override @Override public void evaluate() throws Throwable { public void evaluate() throws Throwable { try { if (SwipeUpSetting.isSwipeUpSettingAvailable()) { if (SwipeUpSetting.isSwipeUpSettingAvailable()) { try { if (mode == ON || mode == BOTH) { if (mode == ON || mode == BOTH) { evaluateWithQuickstepOn(); evaluateWithQuickstepOn(); } } if (mode == OFF || mode == BOTH) { if (mode == OFF || mode == BOTH) { evaluateWithQuickstepOff(); evaluateWithQuickstepOff(); } } } finally { setSwipeUpSetting(null); } } else { } else { // Execute without changing the setting, if the requested mode is // Execute without changing the setting, if the requested mode is // compatible. // compatible. Loading @@ -92,13 +98,10 @@ public class QuickStepOnOffRule implements TestRule { evaluateWithoutChangingSetting(base); evaluateWithoutChangingSetting(base); } } } } } finally { setSwipeUpSetting(null); } } } public void setSwipeUpSetting(String value) { public void setSwipeUpSetting(String value) { Log.d(TAG, "setSwipeUpSetting: " + value); assertTrue("Couldn't change Quickstep mode", assertTrue("Couldn't change Quickstep mode", Settings.Secure.putString( Settings.Secure.putString( InstrumentationRegistry.getInstrumentation().getTargetContext(). InstrumentationRegistry.getInstrumentation().getTargetContext(). Loading