Loading packages/SystemUI/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ <uses-permission android:name="android.permission.REGISTER_WINDOW_MANAGER_LISTENERS" /> <uses-permission android:name="android.permission.SET_ORIENTATION" /> <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> <uses-permission android:name="android.permission.MONITOR_INPUT" /> <!-- DreamManager --> <uses-permission android:name="android.permission.READ_DREAM_STATE" /> Loading packages/SystemUI/res/values/dimens.xml +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,14 @@ <dimen name="navigation_handle_sample_horizontal_margin">10dp</dimen> <dimen name="navigation_home_handle_width">72dp</dimen> <!-- Size of the nav bar edge panels, should be greater to the edge sensitivity + the drag threshold --> <dimen name="navigation_edge_panel_width">52dp</dimen> <dimen name="navigation_edge_panel_height">52dp</dimen> <!-- The threshold to drag to trigger the edge action --> <dimen name="navigation_edge_action_drag_threshold">16dp</dimen> <!-- Luminance threshold to determine black/white contrast for the navigation affordances --> <item name="navigation_luminance_threshold" type="dimen" format="float">0.5</item> <!-- Luminance change threshold that allows applying new value if difference was exceeded --> Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,9 @@ interface ISystemUiProxy { * Start the assistant. */ void startAssistant(in Bundle bundle) = 13; /** * Creates a new gesture monitor */ Bundle monitorGestureInput(String name, int displayId) = 14; } packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationAssistantAction.java→packages/SystemUI/shared/src/com/android/systemui/shared/system/InputMonitorCompat.java +66 −0 Original line number Diff line number Diff line /* /** * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); Loading @@ -13,42 +13,54 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.shared.system; package com.android.systemui.statusbar.phone; import android.annotation.NonNull; import android.os.Bundle; import android.view.MotionEvent; import android.os.Looper; import android.view.Choreographer; import android.view.InputMonitor; import com.android.systemui.assist.AssistManager; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.shared.system.InputChannelCompat.InputEventListener; import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver; /** * Assistant is triggered with this action * @see android.view.InputMonitor */ public class NavigationAssistantAction extends NavigationGestureAction { private static final String TAG = "NavigationAssistantActions"; public class InputMonitorCompat { private final InputMonitor mInputMonitor; private final AssistManager mAssistManager; private InputMonitorCompat(InputMonitor monitor) { mInputMonitor = monitor; } public NavigationAssistantAction(@NonNull NavigationBarView navigationBarView, @NonNull OverviewProxyService service, AssistManager assistManager) { super(navigationBarView, service); mAssistManager = assistManager; /** * @see InputMonitor#pilferPointers() */ public void pilferPointers() { mInputMonitor.pilferPointers(); } @Override public boolean isEnabled() { return true; /** * @see InputMonitor#dispose() */ public void dispose() { mInputMonitor.dispose(); } @Override public boolean disableProxyEvents() { return true; /** * @see InputMonitor#getInputChannel() */ public InputEventReceiver getInputReceiver(Looper looper, Choreographer choreographer, InputEventListener listener) { return new InputEventReceiver(mInputMonitor.getInputChannel(), looper, choreographer, listener); } @Override public void onGestureStart(MotionEvent event) { mAssistManager.startAssist(new Bundle()); /** * Gets the input monitor stored in a bundle */ public static InputMonitorCompat fromBundle(Bundle bundle, String key) { return new InputMonitorCompat((InputMonitor) bundle.getParcelable(key)); } } packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public class QuickStepContract { public static final String KEY_EXTRA_SYSUI_PROXY = "extra_sysui_proxy"; public static final String KEY_EXTRA_INPUT_CHANNEL = "extra_input_channel"; public static final String KEY_EXTRA_INPUT_MONITOR = "extra_input_monitor"; public static final String KEY_EXTRA_WINDOW_CORNER_RADIUS = "extra_window_corner_radius"; public static final String KEY_EXTRA_SUPPORTS_WINDOW_CORNERS = "extra_supports_window_corners"; Loading Loading
packages/SystemUI/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ <uses-permission android:name="android.permission.REGISTER_WINDOW_MANAGER_LISTENERS" /> <uses-permission android:name="android.permission.SET_ORIENTATION" /> <uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> <uses-permission android:name="android.permission.MONITOR_INPUT" /> <!-- DreamManager --> <uses-permission android:name="android.permission.READ_DREAM_STATE" /> Loading
packages/SystemUI/res/values/dimens.xml +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,14 @@ <dimen name="navigation_handle_sample_horizontal_margin">10dp</dimen> <dimen name="navigation_home_handle_width">72dp</dimen> <!-- Size of the nav bar edge panels, should be greater to the edge sensitivity + the drag threshold --> <dimen name="navigation_edge_panel_width">52dp</dimen> <dimen name="navigation_edge_panel_height">52dp</dimen> <!-- The threshold to drag to trigger the edge action --> <dimen name="navigation_edge_action_drag_threshold">16dp</dimen> <!-- Luminance threshold to determine black/white contrast for the navigation affordances --> <item name="navigation_luminance_threshold" type="dimen" format="float">0.5</item> <!-- Luminance change threshold that allows applying new value if difference was exceeded --> Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,9 @@ interface ISystemUiProxy { * Start the assistant. */ void startAssistant(in Bundle bundle) = 13; /** * Creates a new gesture monitor */ Bundle monitorGestureInput(String name, int displayId) = 14; }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationAssistantAction.java→packages/SystemUI/shared/src/com/android/systemui/shared/system/InputMonitorCompat.java +66 −0 Original line number Diff line number Diff line /* /** * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); Loading @@ -13,42 +13,54 @@ * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.shared.system; package com.android.systemui.statusbar.phone; import android.annotation.NonNull; import android.os.Bundle; import android.view.MotionEvent; import android.os.Looper; import android.view.Choreographer; import android.view.InputMonitor; import com.android.systemui.assist.AssistManager; import com.android.systemui.recents.OverviewProxyService; import com.android.systemui.shared.system.InputChannelCompat.InputEventListener; import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver; /** * Assistant is triggered with this action * @see android.view.InputMonitor */ public class NavigationAssistantAction extends NavigationGestureAction { private static final String TAG = "NavigationAssistantActions"; public class InputMonitorCompat { private final InputMonitor mInputMonitor; private final AssistManager mAssistManager; private InputMonitorCompat(InputMonitor monitor) { mInputMonitor = monitor; } public NavigationAssistantAction(@NonNull NavigationBarView navigationBarView, @NonNull OverviewProxyService service, AssistManager assistManager) { super(navigationBarView, service); mAssistManager = assistManager; /** * @see InputMonitor#pilferPointers() */ public void pilferPointers() { mInputMonitor.pilferPointers(); } @Override public boolean isEnabled() { return true; /** * @see InputMonitor#dispose() */ public void dispose() { mInputMonitor.dispose(); } @Override public boolean disableProxyEvents() { return true; /** * @see InputMonitor#getInputChannel() */ public InputEventReceiver getInputReceiver(Looper looper, Choreographer choreographer, InputEventListener listener) { return new InputEventReceiver(mInputMonitor.getInputChannel(), looper, choreographer, listener); } @Override public void onGestureStart(MotionEvent event) { mAssistManager.startAssist(new Bundle()); /** * Gets the input monitor stored in a bundle */ public static InputMonitorCompat fromBundle(Bundle bundle, String key) { return new InputMonitorCompat((InputMonitor) bundle.getParcelable(key)); } }
packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public class QuickStepContract { public static final String KEY_EXTRA_SYSUI_PROXY = "extra_sysui_proxy"; public static final String KEY_EXTRA_INPUT_CHANNEL = "extra_input_channel"; public static final String KEY_EXTRA_INPUT_MONITOR = "extra_input_monitor"; public static final String KEY_EXTRA_WINDOW_CORNER_RADIUS = "extra_window_corner_radius"; public static final String KEY_EXTRA_SUPPORTS_WINDOW_CORNERS = "extra_supports_window_corners"; Loading