Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.MotionEvent; import android.view.SurfaceControl; import com.android.systemui.shared.recents.ISystemUiProxy; // Next ID: 29 oneway interface IOverviewProxy { void onActiveNavBarRegionChanges(in Region activeRegion) = 11; Loading Loading @@ -55,6 +56,13 @@ oneway interface IOverviewProxy { */ void onAssistantVisibilityChanged(float visibility) = 14; /** * Sent when the assistant has been invoked with the given type (defined in AssistManager) and * should be shown. This method should be used if SystemUiProxy#setAssistantOverridesRequested * was previously called including this invocation type. */ void onAssistantOverrideInvoked(int invocationType) = 28; /** * Sent when some system ui state changes. */ Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +10 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,15 @@ interface ISystemUiProxy { */ oneway void startAssistant(in Bundle bundle) = 13; /** * Indicates that the given Assist invocation types should be handled by Launcher via * OverviewProxy#onAssistantOverrideInvoked and should not be invoked by SystemUI. * * @param invocationTypes The invocation types that will henceforth be handled via * OverviewProxy (Launcher); other invocation types should be handled by SysUI. */ oneway void setAssistantOverridesRequested(in int[] invocationTypes) = 53; /** * Notifies that the accessibility button in the system's navigation area has been clicked */ Loading Loading @@ -135,5 +144,5 @@ interface ISystemUiProxy { */ oneway void onStatusBarTrackpadEvent(in MotionEvent event) = 52; // Next id = 53 // Next id = 54 } packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +39 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.util.settings.SecureSettings; import dagger.Lazy; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.inject.Inject; Loading Loading @@ -136,6 +137,7 @@ public class AssistManager { protected final Context mContext; private final AssistDisclosure mAssistDisclosure; private final PhoneStateMonitor mPhoneStateMonitor; private final OverviewProxyService mOverviewProxyService; private final UiController mUiController; protected final Lazy<SysUiState> mSysUiState; protected final AssistLogger mAssistLogger; Loading Loading @@ -164,6 +166,9 @@ public class AssistManager { private final CommandQueue mCommandQueue; protected final AssistUtils mAssistUtils; // Invocation types that should be sent over OverviewProxy instead of handled here. private int[] mAssistOverrideInvocationTypes; @Inject public AssistManager( DeviceProvisionedController controller, Loading @@ -184,6 +189,7 @@ public class AssistManager { mCommandQueue = commandQueue; mAssistUtils = assistUtils; mAssistDisclosure = new AssistDisclosure(context, uiHandler); mOverviewProxyService = overviewProxyService; mPhoneStateMonitor = phoneStateMonitor; mAssistLogger = assistLogger; mUserTracker = userTracker; Loading @@ -197,7 +203,7 @@ public class AssistManager { mSysUiState = sysUiState; overviewProxyService.addCallback(new OverviewProxyService.OverviewProxyListener() { mOverviewProxyService.addCallback(new OverviewProxyService.OverviewProxyListener() { @Override public void onAssistantProgress(float progress) { // Progress goes from 0 to 1 to indicate how close the assist gesture is to Loading Loading @@ -260,6 +266,20 @@ public class AssistManager { } public void startAssist(Bundle args) { if (shouldOverrideAssist(args)) { try { if (mOverviewProxyService.getProxy() == null) { Log.w(TAG, "No OverviewProxyService to invoke assistant override"); return; } mOverviewProxyService.getProxy().onAssistantOverrideInvoked( args.getInt(INVOCATION_TYPE_KEY)); } catch (RemoteException e) { Log.w(TAG, "Unable to invoke assistant via OverviewProxyService override", e); } return; } final ComponentName assistComponent = getAssistInfo(); if (assistComponent == null) { return; Loading @@ -283,6 +303,24 @@ public class AssistManager { startAssistInternal(args, assistComponent, isService); } private boolean shouldOverrideAssist(Bundle args) { if (args == null || !args.containsKey(INVOCATION_TYPE_KEY)) { return false; } int invocationType = args.getInt(INVOCATION_TYPE_KEY); return mAssistOverrideInvocationTypes != null && Arrays.stream( mAssistOverrideInvocationTypes).anyMatch(override -> override == invocationType); } /** * @param invocationTypes The invocation types that will henceforth be handled via * OverviewProxy (Launcher); other invocation types should be handled by this class. */ public void setAssistantOverridesRequested(int[] invocationTypes) { mAssistOverrideInvocationTypes = invocationTypes; } /** Called when the user is performing an assistant invocation action (e.g. Active Edge) */ public void onInvocationProgress(int type, float progress) { mUiController.onInvocationProgress(type, progress); Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java +5 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,11 @@ public final class NavBarHelper implements mAssistManagerLazy.get().startAssist(bundle); } @Override public void setAssistantOverridesRequested(int[] invocationTypes) { mAssistManagerLazy.get().setAssistantOverridesRequested(invocationTypes); } @Override public void onNavigationModeChanged(int mode) { mNavBarMode = mode; Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,11 @@ public class NavigationBar extends ViewController<NavigationBarView> implements mAssistManagerLazy.get().startAssist(bundle); } @Override public void setAssistantOverridesRequested(int[] invocationTypes) { mAssistManagerLazy.get().setAssistantOverridesRequested(invocationTypes); } @Override public void onHomeRotationEnabled(boolean enabled) { mView.getRotationButtonController().setHomeRotationEnabled(enabled); Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.MotionEvent; import android.view.SurfaceControl; import com.android.systemui.shared.recents.ISystemUiProxy; // Next ID: 29 oneway interface IOverviewProxy { void onActiveNavBarRegionChanges(in Region activeRegion) = 11; Loading Loading @@ -55,6 +56,13 @@ oneway interface IOverviewProxy { */ void onAssistantVisibilityChanged(float visibility) = 14; /** * Sent when the assistant has been invoked with the given type (defined in AssistManager) and * should be shown. This method should be used if SystemUiProxy#setAssistantOverridesRequested * was previously called including this invocation type. */ void onAssistantOverrideInvoked(int invocationType) = 28; /** * Sent when some system ui state changes. */ Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +10 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,15 @@ interface ISystemUiProxy { */ oneway void startAssistant(in Bundle bundle) = 13; /** * Indicates that the given Assist invocation types should be handled by Launcher via * OverviewProxy#onAssistantOverrideInvoked and should not be invoked by SystemUI. * * @param invocationTypes The invocation types that will henceforth be handled via * OverviewProxy (Launcher); other invocation types should be handled by SysUI. */ oneway void setAssistantOverridesRequested(in int[] invocationTypes) = 53; /** * Notifies that the accessibility button in the system's navigation area has been clicked */ Loading Loading @@ -135,5 +144,5 @@ interface ISystemUiProxy { */ oneway void onStatusBarTrackpadEvent(in MotionEvent event) = 52; // Next id = 53 // Next id = 54 }
packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +39 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import com.android.systemui.util.settings.SecureSettings; import dagger.Lazy; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.inject.Inject; Loading Loading @@ -136,6 +137,7 @@ public class AssistManager { protected final Context mContext; private final AssistDisclosure mAssistDisclosure; private final PhoneStateMonitor mPhoneStateMonitor; private final OverviewProxyService mOverviewProxyService; private final UiController mUiController; protected final Lazy<SysUiState> mSysUiState; protected final AssistLogger mAssistLogger; Loading Loading @@ -164,6 +166,9 @@ public class AssistManager { private final CommandQueue mCommandQueue; protected final AssistUtils mAssistUtils; // Invocation types that should be sent over OverviewProxy instead of handled here. private int[] mAssistOverrideInvocationTypes; @Inject public AssistManager( DeviceProvisionedController controller, Loading @@ -184,6 +189,7 @@ public class AssistManager { mCommandQueue = commandQueue; mAssistUtils = assistUtils; mAssistDisclosure = new AssistDisclosure(context, uiHandler); mOverviewProxyService = overviewProxyService; mPhoneStateMonitor = phoneStateMonitor; mAssistLogger = assistLogger; mUserTracker = userTracker; Loading @@ -197,7 +203,7 @@ public class AssistManager { mSysUiState = sysUiState; overviewProxyService.addCallback(new OverviewProxyService.OverviewProxyListener() { mOverviewProxyService.addCallback(new OverviewProxyService.OverviewProxyListener() { @Override public void onAssistantProgress(float progress) { // Progress goes from 0 to 1 to indicate how close the assist gesture is to Loading Loading @@ -260,6 +266,20 @@ public class AssistManager { } public void startAssist(Bundle args) { if (shouldOverrideAssist(args)) { try { if (mOverviewProxyService.getProxy() == null) { Log.w(TAG, "No OverviewProxyService to invoke assistant override"); return; } mOverviewProxyService.getProxy().onAssistantOverrideInvoked( args.getInt(INVOCATION_TYPE_KEY)); } catch (RemoteException e) { Log.w(TAG, "Unable to invoke assistant via OverviewProxyService override", e); } return; } final ComponentName assistComponent = getAssistInfo(); if (assistComponent == null) { return; Loading @@ -283,6 +303,24 @@ public class AssistManager { startAssistInternal(args, assistComponent, isService); } private boolean shouldOverrideAssist(Bundle args) { if (args == null || !args.containsKey(INVOCATION_TYPE_KEY)) { return false; } int invocationType = args.getInt(INVOCATION_TYPE_KEY); return mAssistOverrideInvocationTypes != null && Arrays.stream( mAssistOverrideInvocationTypes).anyMatch(override -> override == invocationType); } /** * @param invocationTypes The invocation types that will henceforth be handled via * OverviewProxy (Launcher); other invocation types should be handled by this class. */ public void setAssistantOverridesRequested(int[] invocationTypes) { mAssistOverrideInvocationTypes = invocationTypes; } /** Called when the user is performing an assistant invocation action (e.g. Active Edge) */ public void onInvocationProgress(int type, float progress) { mUiController.onInvocationProgress(type, progress); Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavBarHelper.java +5 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,11 @@ public final class NavBarHelper implements mAssistManagerLazy.get().startAssist(bundle); } @Override public void setAssistantOverridesRequested(int[] invocationTypes) { mAssistManagerLazy.get().setAssistantOverridesRequested(invocationTypes); } @Override public void onNavigationModeChanged(int mode) { mNavBarMode = mode; Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +5 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,11 @@ public class NavigationBar extends ViewController<NavigationBarView> implements mAssistManagerLazy.get().startAssist(bundle); } @Override public void setAssistantOverridesRequested(int[] invocationTypes) { mAssistManagerLazy.get().setAssistantOverridesRequested(invocationTypes); } @Override public void onHomeRotationEnabled(boolean enabled) { mView.getRotationButtonController().setHomeRotationEnabled(enabled); Loading