Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +32 −44 Original line number Diff line number Diff line Loading @@ -810,7 +810,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { event.recycle(); break; case MSG_HANDLE_ALL_APPS: launchAllAppsAction(); launchAllAppsAction((KeyEvent) msg.obj); break; case MSG_RINGER_TOGGLE_CHORD: handleRingerChordGesture(); Loading Loading @@ -1879,7 +1879,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } private void launchAllAppsAction() { private void launchAllAppsAction(KeyEvent event) { if (mHasFeatureLeanback || mHasFeatureWatch) { // TV and watch support the all apps intent notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS); Intent intent = new Intent(Intent.ACTION_ALL_APPS); if (mHasFeatureLeanback) { Intent intentLauncher = new Intent(Intent.ACTION_MAIN); Loading @@ -1892,14 +1896,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } startActivityAsUser(intent, UserHandle.CURRENT); } private void launchAllAppsViaA11y() { } else { notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); AccessibilityManagerInternal accessibilityManager = getAccessibilityManagerInternal(); if (accessibilityManager != null) { accessibilityManager.performSystemAction( AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS); } } dismissKeyboardShortcutsMenu(); } Loading Loading @@ -2076,15 +2081,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, "Home - Long Press"); switch (mLongPressOnHomeBehavior) { case LONG_PRESS_HOME_ALL_APPS: if (mHasFeatureLeanback) { launchAllAppsAction(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS); } else { launchAllAppsViaA11y(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); } launchAllAppsAction(event); break; case LONG_PRESS_HOME_ASSIST: notifyKeyGestureCompleted(event, Loading Loading @@ -3695,18 +3692,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { break; case KeyEvent.KEYCODE_ALL_APPS: if (firstDown) { if (mHasFeatureLeanback) { mHandler.removeMessages(MSG_HANDLE_ALL_APPS); Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS); Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS, new KeyEvent(event)); msg.setAsynchronous(true); msg.sendToTarget(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS); } else { launchAllAppsViaA11y(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); } } return true; case KeyEvent.KEYCODE_NOTIFICATION: Loading Loading @@ -3759,9 +3749,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_CAPS_LOCK); } else if (mPendingMetaAction) { if (!canceled) { launchAllAppsViaA11y(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); launchAllAppsAction(event); } mPendingMetaAction = false; } Loading Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +32 −44 Original line number Diff line number Diff line Loading @@ -810,7 +810,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { event.recycle(); break; case MSG_HANDLE_ALL_APPS: launchAllAppsAction(); launchAllAppsAction((KeyEvent) msg.obj); break; case MSG_RINGER_TOGGLE_CHORD: handleRingerChordGesture(); Loading Loading @@ -1879,7 +1879,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } private void launchAllAppsAction() { private void launchAllAppsAction(KeyEvent event) { if (mHasFeatureLeanback || mHasFeatureWatch) { // TV and watch support the all apps intent notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS); Intent intent = new Intent(Intent.ACTION_ALL_APPS); if (mHasFeatureLeanback) { Intent intentLauncher = new Intent(Intent.ACTION_MAIN); Loading @@ -1892,14 +1896,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } startActivityAsUser(intent, UserHandle.CURRENT); } private void launchAllAppsViaA11y() { } else { notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); AccessibilityManagerInternal accessibilityManager = getAccessibilityManagerInternal(); if (accessibilityManager != null) { accessibilityManager.performSystemAction( AccessibilityService.GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS); } } dismissKeyboardShortcutsMenu(); } Loading Loading @@ -2076,15 +2081,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, "Home - Long Press"); switch (mLongPressOnHomeBehavior) { case LONG_PRESS_HOME_ALL_APPS: if (mHasFeatureLeanback) { launchAllAppsAction(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS); } else { launchAllAppsViaA11y(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); } launchAllAppsAction(event); break; case LONG_PRESS_HOME_ASSIST: notifyKeyGestureCompleted(event, Loading Loading @@ -3695,18 +3692,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { break; case KeyEvent.KEYCODE_ALL_APPS: if (firstDown) { if (mHasFeatureLeanback) { mHandler.removeMessages(MSG_HANDLE_ALL_APPS); Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS); Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS, new KeyEvent(event)); msg.setAsynchronous(true); msg.sendToTarget(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ALL_APPS); } else { launchAllAppsViaA11y(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); } } return true; case KeyEvent.KEYCODE_NOTIFICATION: Loading Loading @@ -3759,9 +3749,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_CAPS_LOCK); } else if (mPendingMetaAction) { if (!canceled) { launchAllAppsViaA11y(); notifyKeyGestureCompleted(event, KeyGestureEvent.KEY_GESTURE_TYPE_ACCESSIBILITY_ALL_APPS); launchAllAppsAction(event); } mPendingMetaAction = false; } Loading