Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.recents; import android.graphics.Rect; import android.os.Bundle; import android.view.MotionEvent; /** Loading Loading @@ -82,4 +83,13 @@ interface ISystemUiProxy { */ boolean supportsRoundedCornersOnWindows() = 11; /** * Proxies the assistant gesture's progress started from navigation bar. */ void onAssistantProgress(float progress) = 12; /** * Start the assistant. */ void startAssistant(in Bundle bundle) = 13; } packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +39 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUP import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS; import android.annotation.FloatRange; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -269,6 +270,30 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) { if (!verifyCaller("onAssistantProgress")) { return; } long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> notifyAssistantProgress(progress)); } finally { Binder.restoreCallingIdentity(token); } } public void startAssistant(Bundle bundle) { if (!verifyCaller("startAssistant")) { return; } long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> notifyStartAssistant(bundle)); } finally { Binder.restoreCallingIdentity(token); } } private boolean verifyCaller(String reason) { final int callerId = Binder.getCallingUserHandle().getIdentifier(); if (callerId != mCurrentBoundedUserId) { Loading Loading @@ -590,6 +615,18 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } private void notifyAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).onAssistantProgress(progress); } } private void notifyStartAssistant(Bundle bundle) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).startAssistant(bundle); } } private void updateEnabledState() { mIsEnabled = mContext.getPackageManager().resolveServiceAsUser(mQuickStepIntent, MATCH_DIRECT_BOOT_UNAWARE, Loading Loading @@ -637,5 +674,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis default void onOverviewShown(boolean fromHome) {} default void onQuickScrubStarted() {} default void onBackButtonAlphaChanged(float alpha, boolean animate) {} default void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {} default void startAssistant(Bundle bundle) {} } } packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,11 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback updateScreenPinningGestures(); } @Override public void startAssistant(Bundle bundle) { mAssistManager.startAssist(bundle); } @Override public void onBackButtonAlphaChanged(float alpha, boolean animate) { final ButtonDispatcher backButton = mNavigationBarView.getBackButton(); Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.recents; import android.graphics.Rect; import android.os.Bundle; import android.view.MotionEvent; /** Loading Loading @@ -82,4 +83,13 @@ interface ISystemUiProxy { */ boolean supportsRoundedCornersOnWindows() = 11; /** * Proxies the assistant gesture's progress started from navigation bar. */ void onAssistantProgress(float progress) = 12; /** * Start the assistant. */ void startAssistant(in Bundle bundle) = 13; }
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +39 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUP import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY; import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS; import android.annotation.FloatRange; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; Loading Loading @@ -269,6 +270,30 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) { if (!verifyCaller("onAssistantProgress")) { return; } long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> notifyAssistantProgress(progress)); } finally { Binder.restoreCallingIdentity(token); } } public void startAssistant(Bundle bundle) { if (!verifyCaller("startAssistant")) { return; } long token = Binder.clearCallingIdentity(); try { mHandler.post(() -> notifyStartAssistant(bundle)); } finally { Binder.restoreCallingIdentity(token); } } private boolean verifyCaller(String reason) { final int callerId = Binder.getCallingUserHandle().getIdentifier(); if (callerId != mCurrentBoundedUserId) { Loading Loading @@ -590,6 +615,18 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } private void notifyAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).onAssistantProgress(progress); } } private void notifyStartAssistant(Bundle bundle) { for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) { mConnectionCallbacks.get(i).startAssistant(bundle); } } private void updateEnabledState() { mIsEnabled = mContext.getPackageManager().resolveServiceAsUser(mQuickStepIntent, MATCH_DIRECT_BOOT_UNAWARE, Loading Loading @@ -637,5 +674,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis default void onOverviewShown(boolean fromHome) {} default void onQuickScrubStarted() {} default void onBackButtonAlphaChanged(float alpha, boolean animate) {} default void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) {} default void startAssistant(Bundle bundle) {} } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java +5 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,11 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback updateScreenPinningGestures(); } @Override public void startAssistant(Bundle bundle) { mAssistManager.startAssist(bundle); } @Override public void onBackButtonAlphaChanged(float alpha, boolean animate) { final ButtonDispatcher backButton = mNavigationBarView.getBackButton(); Loading