blob: b7275634c6a602b71adad61ec28969fcb486ca5a [file] [log] [blame]
Hongming Jine0ab6b12020-01-16 14:52:19 -08001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.systemui.accessibility;
18
Miranda Kephart7b2c3132020-03-27 09:54:14 -040019import static android.view.WindowManager.ScreenshotSource.SCREENSHOT_GLOBAL_ACTIONS;
20
sallyyuen93edd112020-04-01 11:09:45 -070021import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
22
Hongming Jine0ab6b12020-01-16 14:52:19 -080023import android.accessibilityservice.AccessibilityService;
24import android.app.PendingIntent;
25import android.app.RemoteAction;
26import android.content.BroadcastReceiver;
27import android.content.Context;
28import android.content.Intent;
29import android.content.IntentFilter;
sallyyuen93edd112020-04-01 11:09:45 -070030import android.content.res.Configuration;
Hongming Jine0ab6b12020-01-16 14:52:19 -080031import android.graphics.drawable.Icon;
32import android.hardware.input.InputManager;
33import android.os.Handler;
34import android.os.Looper;
35import android.os.PowerManager;
36import android.os.RemoteException;
37import android.os.SystemClock;
sallyyuen93edd112020-04-01 11:09:45 -070038import android.os.UserHandle;
Hongming Jine0ab6b12020-01-16 14:52:19 -080039import android.util.Log;
40import android.view.Display;
41import android.view.IWindowManager;
42import android.view.InputDevice;
43import android.view.KeyCharacterMap;
44import android.view.KeyEvent;
45import android.view.WindowManager;
46import android.view.WindowManagerGlobal;
47import android.view.accessibility.AccessibilityManager;
48
49import com.android.internal.R;
sallyyuen93edd112020-04-01 11:09:45 -070050import com.android.internal.accessibility.dialog.AccessibilityButtonChooserActivity;
Hongming Jine0ab6b12020-01-16 14:52:19 -080051import com.android.internal.util.ScreenshotHelper;
52import com.android.systemui.Dependency;
53import com.android.systemui.SystemUI;
54import com.android.systemui.recents.Recents;
55import com.android.systemui.statusbar.phone.StatusBar;
56
sallyyuen93edd112020-04-01 11:09:45 -070057import java.util.Locale;
58
Hongming Jine0ab6b12020-01-16 14:52:19 -080059import javax.inject.Inject;
60import javax.inject.Singleton;
61
62/**
63 * Class to register system actions with accessibility framework.
64 */
65@Singleton
66public class SystemActions extends SystemUI {
67 private static final String TAG = "SystemActions";
Hongming Jine0ab6b12020-01-16 14:52:19 -080068
69 /**
70 * Action ID to go back.
71 */
72 private static final int SYSTEM_ACTION_ID_BACK = AccessibilityService.GLOBAL_ACTION_BACK; // = 1
73
74 /**
75 * Action ID to go home.
76 */
77 private static final int SYSTEM_ACTION_ID_HOME = AccessibilityService.GLOBAL_ACTION_HOME; // = 2
78
79 /**
80 * Action ID to toggle showing the overview of recent apps. Will fail on platforms that don't
81 * show recent apps.
82 */
83 private static final int SYSTEM_ACTION_ID_RECENTS =
84 AccessibilityService.GLOBAL_ACTION_RECENTS; // = 3
85
86 /**
87 * Action ID to open the notifications.
88 */
89 private static final int SYSTEM_ACTION_ID_NOTIFICATIONS =
90 AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS; // = 4
91
92 /**
93 * Action ID to open the quick settings.
94 */
95 private static final int SYSTEM_ACTION_ID_QUICK_SETTINGS =
96 AccessibilityService.GLOBAL_ACTION_QUICK_SETTINGS; // = 5
97
98 /**
99 * Action ID to open the power long-press dialog.
100 */
101 private static final int SYSTEM_ACTION_ID_POWER_DIALOG =
102 AccessibilityService.GLOBAL_ACTION_POWER_DIALOG; // = 6
103
104 /**
Hongming Jine0ab6b12020-01-16 14:52:19 -0800105 * Action ID to lock the screen
106 */
107 private static final int SYSTEM_ACTION_ID_LOCK_SCREEN =
108 AccessibilityService.GLOBAL_ACTION_LOCK_SCREEN; // = 8
109
110 /**
111 * Action ID to take a screenshot
112 */
113 private static final int SYSTEM_ACTION_ID_TAKE_SCREENSHOT =
114 AccessibilityService.GLOBAL_ACTION_TAKE_SCREENSHOT; // = 9
115
116 /**
sallyyuen93edd112020-04-01 11:09:45 -0700117 * Action ID to trigger the accessibility button
Hongming Jine0ab6b12020-01-16 14:52:19 -0800118 */
sallyyuen93edd112020-04-01 11:09:45 -0700119 public static final int SYSTEM_ACTION_ID_ACCESSIBILITY_BUTTON =
120 AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_BUTTON; // 11
121
122 /**
123 * Action ID to show accessibility button's menu of services
124 */
125 public static final int SYSTEM_ACTION_ID_ACCESSIBILITY_BUTTON_CHOOSER =
126 AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_BUTTON_CHOOSER; // 12
Hongming Jine0ab6b12020-01-16 14:52:19 -0800127
sallyyuen40dd5592020-05-01 10:02:53 -0700128 public static final int SYSTEM_ACTION_ID_ACCESSIBILITY_SHORTCUT =
129 AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_SHORTCUT; // 13
130
Hongming Jine0ab6b12020-01-16 14:52:19 -0800131 private Recents mRecents;
132 private StatusBar mStatusBar;
133 private SystemActionsBroadcastReceiver mReceiver;
sallyyuen93edd112020-04-01 11:09:45 -0700134 private Locale mLocale;
135 private AccessibilityManager mA11yManager;
Hongming Jine0ab6b12020-01-16 14:52:19 -0800136
137 @Inject
138 public SystemActions(Context context) {
139 super(context);
140 mRecents = Dependency.get(Recents.class);
141 mStatusBar = Dependency.get(StatusBar.class);
142 mReceiver = new SystemActionsBroadcastReceiver();
sallyyuen93edd112020-04-01 11:09:45 -0700143 mLocale = mContext.getResources().getConfiguration().getLocales().get(0);
144 mA11yManager = (AccessibilityManager) mContext.getSystemService(
145 Context.ACCESSIBILITY_SERVICE);
Hongming Jine0ab6b12020-01-16 14:52:19 -0800146 }
147
148 @Override
149 public void start() {
150 mContext.registerReceiverForAllUsers(mReceiver, mReceiver.createIntentFilter(), null, null);
sallyyuen93edd112020-04-01 11:09:45 -0700151 registerActions();
152 }
Hongming Jine0ab6b12020-01-16 14:52:19 -0800153
sallyyuen93edd112020-04-01 11:09:45 -0700154 @Override
155 public void onConfigurationChanged(Configuration newConfig) {
156 super.onConfigurationChanged(newConfig);
157 final Locale locale = mContext.getResources().getConfiguration().getLocales().get(0);
158 if (!locale.equals(mLocale)) {
159 mLocale = locale;
160 registerActions();
161 }
162 }
163
164 private void registerActions() {
165 RemoteAction actionBack = createRemoteAction(
166 R.string.accessibility_system_action_back_label,
167 SystemActionsBroadcastReceiver.INTENT_ACTION_BACK);
168
169 RemoteAction actionHome = createRemoteAction(
170 R.string.accessibility_system_action_home_label,
171 SystemActionsBroadcastReceiver.INTENT_ACTION_HOME);
172
173 RemoteAction actionRecents = createRemoteAction(
174 R.string.accessibility_system_action_recents_label,
175 SystemActionsBroadcastReceiver.INTENT_ACTION_RECENTS);
176
177 RemoteAction actionNotifications = createRemoteAction(
178 R.string.accessibility_system_action_notifications_label,
179 SystemActionsBroadcastReceiver.INTENT_ACTION_NOTIFICATIONS);
180
181 RemoteAction actionQuickSettings = createRemoteAction(
182 R.string.accessibility_system_action_quick_settings_label,
183 SystemActionsBroadcastReceiver.INTENT_ACTION_QUICK_SETTINGS);
184
185 RemoteAction actionPowerDialog = createRemoteAction(
186 R.string.accessibility_system_action_power_dialog_label,
187 SystemActionsBroadcastReceiver.INTENT_ACTION_POWER_DIALOG);
188
189 RemoteAction actionLockScreen = createRemoteAction(
190 R.string.accessibility_system_action_lock_screen_label,
191 SystemActionsBroadcastReceiver.INTENT_ACTION_LOCK_SCREEN);
192
193 RemoteAction actionTakeScreenshot = createRemoteAction(
194 R.string.accessibility_system_action_screenshot_label,
195 SystemActionsBroadcastReceiver.INTENT_ACTION_TAKE_SCREENSHOT);
196
sallyyuen40dd5592020-05-01 10:02:53 -0700197 RemoteAction actionAccessibilityShortcut = createRemoteAction(
198 R.string.accessibility_system_action_hardware_a11y_shortcut_label,
199 SystemActionsBroadcastReceiver.INTENT_ACTION_ACCESSIBILITY_SHORTCUT);
200
sallyyuen93edd112020-04-01 11:09:45 -0700201 mA11yManager.registerSystemAction(actionBack, SYSTEM_ACTION_ID_BACK);
202 mA11yManager.registerSystemAction(actionHome, SYSTEM_ACTION_ID_HOME);
203 mA11yManager.registerSystemAction(actionRecents, SYSTEM_ACTION_ID_RECENTS);
204 mA11yManager.registerSystemAction(actionNotifications, SYSTEM_ACTION_ID_NOTIFICATIONS);
205 mA11yManager.registerSystemAction(actionQuickSettings, SYSTEM_ACTION_ID_QUICK_SETTINGS);
206 mA11yManager.registerSystemAction(actionPowerDialog, SYSTEM_ACTION_ID_POWER_DIALOG);
207 mA11yManager.registerSystemAction(actionLockScreen, SYSTEM_ACTION_ID_LOCK_SCREEN);
208 mA11yManager.registerSystemAction(actionTakeScreenshot, SYSTEM_ACTION_ID_TAKE_SCREENSHOT);
sallyyuen40dd5592020-05-01 10:02:53 -0700209 mA11yManager.registerSystemAction(
210 actionAccessibilityShortcut, SYSTEM_ACTION_ID_ACCESSIBILITY_SHORTCUT);
sallyyuen93edd112020-04-01 11:09:45 -0700211 }
212
213 /**
214 * Register a system action.
215 * @param actionId the action ID to register.
216 */
217 public void register(int actionId) {
218 int labelId;
219 String intent;
220 switch (actionId) {
221 case SYSTEM_ACTION_ID_BACK:
222 labelId = R.string.accessibility_system_action_back_label;
223 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_BACK;
224 break;
225 case SYSTEM_ACTION_ID_HOME:
226 labelId = R.string.accessibility_system_action_home_label;
227 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_HOME;
228 break;
229 case SYSTEM_ACTION_ID_RECENTS:
230 labelId = R.string.accessibility_system_action_recents_label;
231 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_RECENTS;
232 break;
233 case SYSTEM_ACTION_ID_NOTIFICATIONS:
234 labelId = R.string.accessibility_system_action_notifications_label;
235 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_NOTIFICATIONS;
236 break;
237 case SYSTEM_ACTION_ID_QUICK_SETTINGS:
238 labelId = R.string.accessibility_system_action_quick_settings_label;
239 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_QUICK_SETTINGS;
240 break;
241 case SYSTEM_ACTION_ID_POWER_DIALOG:
242 labelId = R.string.accessibility_system_action_power_dialog_label;
243 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_POWER_DIALOG;
244 break;
245 case SYSTEM_ACTION_ID_LOCK_SCREEN:
246 labelId = R.string.accessibility_system_action_lock_screen_label;
247 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_LOCK_SCREEN;
248 break;
249 case SYSTEM_ACTION_ID_TAKE_SCREENSHOT:
250 labelId = R.string.accessibility_system_action_screenshot_label;
251 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_TAKE_SCREENSHOT;
252 break;
253 case SYSTEM_ACTION_ID_ACCESSIBILITY_BUTTON:
sallyyuen40dd5592020-05-01 10:02:53 -0700254 labelId = R.string.accessibility_system_action_on_screen_a11y_shortcut_label;
sallyyuen93edd112020-04-01 11:09:45 -0700255 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_ACCESSIBILITY_BUTTON;
256 break;
257 case SYSTEM_ACTION_ID_ACCESSIBILITY_BUTTON_CHOOSER:
sallyyuen40dd5592020-05-01 10:02:53 -0700258 labelId =
259 R.string.accessibility_system_action_on_screen_a11y_shortcut_chooser_label;
sallyyuen93edd112020-04-01 11:09:45 -0700260 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_ACCESSIBILITY_BUTTON_CHOOSER;
261 break;
sallyyuen40dd5592020-05-01 10:02:53 -0700262 case SYSTEM_ACTION_ID_ACCESSIBILITY_SHORTCUT:
263 labelId = R.string.accessibility_system_action_hardware_a11y_shortcut_label;
264 intent = SystemActionsBroadcastReceiver.INTENT_ACTION_ACCESSIBILITY_SHORTCUT;
265 break;
sallyyuen93edd112020-04-01 11:09:45 -0700266 default:
267 return;
268 }
269 mA11yManager.registerSystemAction(createRemoteAction(labelId, intent), actionId);
270 }
271
272 private RemoteAction createRemoteAction(int labelId, String intent) {
Hongming Jine0ab6b12020-01-16 14:52:19 -0800273 // TODO(b/148087487): update the icon used below to a valid one
sallyyuen93edd112020-04-01 11:09:45 -0700274 return new RemoteAction(
Hongming Jine0ab6b12020-01-16 14:52:19 -0800275 Icon.createWithResource(mContext, R.drawable.ic_info),
sallyyuen93edd112020-04-01 11:09:45 -0700276 mContext.getString(labelId),
277 mContext.getString(labelId),
278 mReceiver.createPendingIntent(mContext, intent));
279 }
Hongming Jine0ab6b12020-01-16 14:52:19 -0800280
sallyyuen93edd112020-04-01 11:09:45 -0700281 /**
282 * Unregister a system action.
283 * @param actionId the action ID to unregister.
284 */
285 public void unregister(int actionId) {
286 mA11yManager.unregisterSystemAction(actionId);
Hongming Jine0ab6b12020-01-16 14:52:19 -0800287 }
288
289 private void handleBack() {
290 sendDownAndUpKeyEvents(KeyEvent.KEYCODE_BACK);
291 }
292
293 private void handleHome() {
294 sendDownAndUpKeyEvents(KeyEvent.KEYCODE_HOME);
295 }
296
297 private void sendDownAndUpKeyEvents(int keyCode) {
298 final long downTime = SystemClock.uptimeMillis();
299 sendKeyEventIdentityCleared(keyCode, KeyEvent.ACTION_DOWN, downTime, downTime);
300 sendKeyEventIdentityCleared(
301 keyCode, KeyEvent.ACTION_UP, downTime, SystemClock.uptimeMillis());
302 }
303
304 private void sendKeyEventIdentityCleared(int keyCode, int action, long downTime, long time) {
305 KeyEvent event = KeyEvent.obtain(downTime, time, action, keyCode, 0, 0,
306 KeyCharacterMap.VIRTUAL_KEYBOARD, 0, KeyEvent.FLAG_FROM_SYSTEM,
307 InputDevice.SOURCE_KEYBOARD, null);
308 InputManager.getInstance()
309 .injectInputEvent(event, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
310 event.recycle();
311 }
312
313 private void handleRecents() {
314 mRecents.toggleRecentApps();
315 }
316
317 private void handleNotifications() {
318 mStatusBar.animateExpandNotificationsPanel();
319 }
320
321 private void handleQuickSettings() {
322 mStatusBar.animateExpandSettingsPanel(null);
323 }
324
325 private void handlePowerDialog() {
326 IWindowManager windowManager = WindowManagerGlobal.getWindowManagerService();
327
328 try {
329 windowManager.showGlobalActions();
330 } catch (RemoteException e) {
331 Log.e(TAG, "failed to display power dialog.");
332 }
333 }
334
Hongming Jine0ab6b12020-01-16 14:52:19 -0800335 private void handleLockScreen() {
336 IWindowManager windowManager = WindowManagerGlobal.getWindowManagerService();
337
338 mContext.getSystemService(PowerManager.class).goToSleep(SystemClock.uptimeMillis(),
339 PowerManager.GO_TO_SLEEP_REASON_ACCESSIBILITY, 0);
340 try {
341 windowManager.lockNow(null);
342 } catch (RemoteException e) {
343 Log.e(TAG, "failed to lock screen.");
344 }
345 }
346
347 private void handleTakeScreenshot() {
348 ScreenshotHelper screenshotHelper = new ScreenshotHelper(mContext);
Miranda Kephart7b2c3132020-03-27 09:54:14 -0400349 screenshotHelper.takeScreenshot(WindowManager.TAKE_SCREENSHOT_FULLSCREEN, true, true,
350 SCREENSHOT_GLOBAL_ACTIONS, new Handler(Looper.getMainLooper()), null);
Hongming Jine0ab6b12020-01-16 14:52:19 -0800351 }
352
sallyyuen93edd112020-04-01 11:09:45 -0700353 private void handleAccessibilityButton() {
Hongming Jine0ab6b12020-01-16 14:52:19 -0800354 AccessibilityManager.getInstance(mContext).notifyAccessibilityButtonClicked(
355 Display.DEFAULT_DISPLAY);
356 }
357
sallyyuen93edd112020-04-01 11:09:45 -0700358 private void handleAccessibilityButtonChooser() {
359 final Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
360 intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
361 final String chooserClassName = AccessibilityButtonChooserActivity.class.getName();
362 intent.setClassName(CHOOSER_PACKAGE_NAME, chooserClassName);
363 mContext.startActivityAsUser(intent, UserHandle.CURRENT);
364 }
365
sallyyuen40dd5592020-05-01 10:02:53 -0700366 private void handleAccessibilityShortcut() {
367 mA11yManager.performAccessibilityShortcut();
368 }
369
Hongming Jine0ab6b12020-01-16 14:52:19 -0800370 private class SystemActionsBroadcastReceiver extends BroadcastReceiver {
371 private static final String INTENT_ACTION_BACK = "SYSTEM_ACTION_BACK";
372 private static final String INTENT_ACTION_HOME = "SYSTEM_ACTION_HOME";
373 private static final String INTENT_ACTION_RECENTS = "SYSTEM_ACTION_RECENTS";
374 private static final String INTENT_ACTION_NOTIFICATIONS = "SYSTEM_ACTION_NOTIFICATIONS";
375 private static final String INTENT_ACTION_QUICK_SETTINGS = "SYSTEM_ACTION_QUICK_SETTINGS";
376 private static final String INTENT_ACTION_POWER_DIALOG = "SYSTEM_ACTION_POWER_DIALOG";
Hongming Jine0ab6b12020-01-16 14:52:19 -0800377 private static final String INTENT_ACTION_LOCK_SCREEN = "SYSTEM_ACTION_LOCK_SCREEN";
378 private static final String INTENT_ACTION_TAKE_SCREENSHOT = "SYSTEM_ACTION_TAKE_SCREENSHOT";
sallyyuen93edd112020-04-01 11:09:45 -0700379 private static final String INTENT_ACTION_ACCESSIBILITY_BUTTON =
380 "SYSTEM_ACTION_ACCESSIBILITY_BUTTON";
381 private static final String INTENT_ACTION_ACCESSIBILITY_BUTTON_CHOOSER =
382 "SYSTEM_ACTION_ACCESSIBILITY_BUTTON_MENU";
sallyyuen40dd5592020-05-01 10:02:53 -0700383 private static final String INTENT_ACTION_ACCESSIBILITY_SHORTCUT =
384 "SYSTEM_ACTION_ACCESSIBILITY_SHORTCUT";
Hongming Jine0ab6b12020-01-16 14:52:19 -0800385
386 private PendingIntent createPendingIntent(Context context, String intentAction) {
387 switch (intentAction) {
388 case INTENT_ACTION_BACK:
389 case INTENT_ACTION_HOME:
390 case INTENT_ACTION_RECENTS:
391 case INTENT_ACTION_NOTIFICATIONS:
392 case INTENT_ACTION_QUICK_SETTINGS:
393 case INTENT_ACTION_POWER_DIALOG:
Hongming Jine0ab6b12020-01-16 14:52:19 -0800394 case INTENT_ACTION_LOCK_SCREEN:
395 case INTENT_ACTION_TAKE_SCREENSHOT:
sallyyuen93edd112020-04-01 11:09:45 -0700396 case INTENT_ACTION_ACCESSIBILITY_BUTTON:
sallyyuen40dd5592020-05-01 10:02:53 -0700397 case INTENT_ACTION_ACCESSIBILITY_BUTTON_CHOOSER:
398 case INTENT_ACTION_ACCESSIBILITY_SHORTCUT: {
Hongming Jine0ab6b12020-01-16 14:52:19 -0800399 Intent intent = new Intent(intentAction);
400 return PendingIntent.getBroadcast(context, 0, intent, 0);
401 }
402 default:
403 break;
404 }
405 return null;
406 }
407
408 private IntentFilter createIntentFilter() {
409 IntentFilter intentFilter = new IntentFilter();
410 intentFilter.addAction(INTENT_ACTION_BACK);
411 intentFilter.addAction(INTENT_ACTION_HOME);
412 intentFilter.addAction(INTENT_ACTION_RECENTS);
413 intentFilter.addAction(INTENT_ACTION_NOTIFICATIONS);
414 intentFilter.addAction(INTENT_ACTION_QUICK_SETTINGS);
415 intentFilter.addAction(INTENT_ACTION_POWER_DIALOG);
Hongming Jine0ab6b12020-01-16 14:52:19 -0800416 intentFilter.addAction(INTENT_ACTION_LOCK_SCREEN);
417 intentFilter.addAction(INTENT_ACTION_TAKE_SCREENSHOT);
sallyyuen93edd112020-04-01 11:09:45 -0700418 intentFilter.addAction(INTENT_ACTION_ACCESSIBILITY_BUTTON);
419 intentFilter.addAction(INTENT_ACTION_ACCESSIBILITY_BUTTON_CHOOSER);
sallyyuen40dd5592020-05-01 10:02:53 -0700420 intentFilter.addAction(INTENT_ACTION_ACCESSIBILITY_SHORTCUT);
Hongming Jine0ab6b12020-01-16 14:52:19 -0800421 return intentFilter;
422 }
423
424 @Override
425 public void onReceive(Context context, Intent intent) {
426 String intentAction = intent.getAction();
427 switch (intentAction) {
428 case INTENT_ACTION_BACK: {
429 handleBack();
430 break;
431 }
432 case INTENT_ACTION_HOME: {
433 handleHome();
434 break;
435 }
436 case INTENT_ACTION_RECENTS: {
437 handleRecents();
438 break;
439 }
440 case INTENT_ACTION_NOTIFICATIONS: {
441 handleNotifications();
442 break;
443 }
444 case INTENT_ACTION_QUICK_SETTINGS: {
445 handleQuickSettings();
446 break;
447 }
448 case INTENT_ACTION_POWER_DIALOG: {
449 handlePowerDialog();
450 break;
451 }
Hongming Jine0ab6b12020-01-16 14:52:19 -0800452 case INTENT_ACTION_LOCK_SCREEN: {
453 handleLockScreen();
454 break;
455 }
456 case INTENT_ACTION_TAKE_SCREENSHOT: {
457 handleTakeScreenshot();
458 break;
459 }
sallyyuen93edd112020-04-01 11:09:45 -0700460 case INTENT_ACTION_ACCESSIBILITY_BUTTON: {
461 handleAccessibilityButton();
462 break;
463 }
464 case INTENT_ACTION_ACCESSIBILITY_BUTTON_CHOOSER: {
465 handleAccessibilityButtonChooser();
Hongming Jine0ab6b12020-01-16 14:52:19 -0800466 break;
467 }
sallyyuen40dd5592020-05-01 10:02:53 -0700468 case INTENT_ACTION_ACCESSIBILITY_SHORTCUT: {
469 handleAccessibilityShortcut();
470 break;
471 }
Hongming Jine0ab6b12020-01-16 14:52:19 -0800472 default:
473 break;
474 }
475 }
476 }
477}