Loading packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -583,7 +583,7 @@ <dimen name="managed_profile_toast_padding">4dp</dimen> <!-- Thickness of the assist disclosure beams --> <dimen name="assist_disclosure_thickness">4dp</dimen> <dimen name="assist_disclosure_thickness">3dp</dimen> <!-- Thickness of the shadows of the assist disclosure beams --> <dimen name="assist_disclosure_shadow_thickness">1.5dp</dimen> Loading packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +1 −8 Original line number Diff line number Diff line Loading @@ -125,14 +125,11 @@ public class AssistManager { } } public void onGestureInvoked(boolean vibrate) { public void onGestureInvoked() { if (mAssistComponent == null) { return; } if (vibrate) { vibrate(); } final boolean isService = isAssistantService(); if (isService || !isVoiceSessionRunning()) { showOrb(); Loading Loading @@ -290,10 +287,6 @@ public class AssistManager { v.setImageDrawable(null); } private void vibrate() { mView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); } private boolean isAssistantService() { return mAssistComponent == null ? false : mAssistComponent.equals(getVoiceInteractorComponentName()); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +12 −25 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ import com.android.systemui.EventLogConstants; import com.android.systemui.EventLogTags; import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.SwipeHelper; import com.android.systemui.assist.AssistManager; import com.android.systemui.doze.DozeHost; import com.android.systemui.doze.DozeLog; Loading Loading @@ -676,8 +677,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNotificationPanelDebugText.setVisibility(View.VISIBLE); } updateShowSearchHoldoff(); try { boolean showNav = mWindowManagerService.hasNavigationBar(); if (DEBUG) Log.v(TAG, "hasNavigationBar=" + showNav); Loading Loading @@ -1013,11 +1012,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, return mStatusBarWindow; } public void invokeAssistGesture(boolean vibrate) { mHandler.removeCallbacks(mInvokeAssist); mAssistManager.onGestureInvoked(vibrate); } public int getStatusBarHeight() { if (mNaturalBarHeight < 0) { final Resources res = mContext.getResources(); Loading @@ -1044,31 +1038,28 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } }; private int mShowSearchHoldoff = 0; private Runnable mInvokeAssist = new Runnable() { public void run() { private final View.OnLongClickListener mLongPressHomeListener = new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (shouldDisableNavbarGestures()) { return false; } mAssistManager.prepareBeforeInvocation(); invokeAssistGesture(true /* vibrate */); mAssistManager.onGestureInvoked(); awakenDreams(); if (mNavigationBarView != null) { mNavigationBarView.abortCurrentGesture(); } return true; } }; View.OnTouchListener mHomeActionListener = new View.OnTouchListener() { private final View.OnTouchListener mHomeActionListener = new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if (!shouldDisableNavbarGestures()) { mHandler.removeCallbacks(mInvokeAssist); mHandler.postDelayed(mInvokeAssist, mShowSearchHoldoff); } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mHandler.removeCallbacks(mInvokeAssist); awakenDreams(); break; } Loading Loading @@ -1096,6 +1087,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNavigationBarView.getBackButton().setLongClickable(true); mNavigationBarView.getBackButton().setOnLongClickListener(mLongPressBackRecentsListener); mNavigationBarView.getHomeButton().setOnTouchListener(mHomeActionListener); mNavigationBarView.getHomeButton().setOnLongClickListener(mLongPressHomeListener); mAssistManager.onConfigurationChanged(); } Loading Loading @@ -1236,10 +1228,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } private void updateShowSearchHoldoff() { mShowSearchHoldoff = ViewConfiguration.getLongPressTimeout(); } private void updateNotificationShade() { if (mStackScroller == null) return; Loading Loading @@ -2922,7 +2910,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, updateResources(); repositionNavigationBar(); updateShowSearchHoldoff(); updateRowStates(); mIconController.updateResources(); mScreenPinningRequest.onConfigurationChanged(); Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +7 −13 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class KeyButtonView extends ImageView { if (isLongClickable()) { // Just an old-fashioned ImageView performLongClick(); } else { } else if (mSupportsLongpress) { sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); } Loading Loading @@ -92,7 +92,7 @@ public class KeyButtonView extends ImageView { super.onInitializeAccessibilityNodeInfo(info); if (mCode != 0) { info.addAction(new AccessibilityNodeInfo.AccessibilityAction(ACTION_CLICK, null)); if (mSupportsLongpress) { if (mSupportsLongpress || isLongClickable()) { info.addAction( new AccessibilityNodeInfo.AccessibilityAction(ACTION_LONG_CLICK, null)); } Loading @@ -115,7 +115,7 @@ public class KeyButtonView extends ImageView { sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); playSoundEffect(SoundEffectConstants.CLICK); return true; } else if (action == ACTION_LONG_CLICK && mCode != 0 && mSupportsLongpress) { } else if (action == ACTION_LONG_CLICK && mCode != 0) { sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS); sendEvent(KeyEvent.ACTION_UP, 0); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); Loading Loading @@ -144,10 +144,8 @@ public class KeyButtonView extends ImageView { // Provide the same haptic feedback that the system offers for virtual keys. performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); } if (mSupportsLongpress) { removeCallbacks(mCheckLongPress); postDelayed(mCheckLongPress, ViewConfiguration.getLongPressTimeout()); } break; case MotionEvent.ACTION_MOVE: x = (int)ev.getX(); Loading @@ -162,9 +160,7 @@ public class KeyButtonView extends ImageView { if (mCode != 0) { sendEvent(KeyEvent.ACTION_UP, KeyEvent.FLAG_CANCELED); } if (mSupportsLongpress) { removeCallbacks(mCheckLongPress); } break; case MotionEvent.ACTION_UP: final boolean doIt = isPressed(); Loading @@ -183,9 +179,7 @@ public class KeyButtonView extends ImageView { performClick(); } } if (mSupportsLongpress) { removeCallbacks(mCheckLongPress); } break; } Loading Loading
packages/SystemUI/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line Loading @@ -583,7 +583,7 @@ <dimen name="managed_profile_toast_padding">4dp</dimen> <!-- Thickness of the assist disclosure beams --> <dimen name="assist_disclosure_thickness">4dp</dimen> <dimen name="assist_disclosure_thickness">3dp</dimen> <!-- Thickness of the shadows of the assist disclosure beams --> <dimen name="assist_disclosure_shadow_thickness">1.5dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +1 −8 Original line number Diff line number Diff line Loading @@ -125,14 +125,11 @@ public class AssistManager { } } public void onGestureInvoked(boolean vibrate) { public void onGestureInvoked() { if (mAssistComponent == null) { return; } if (vibrate) { vibrate(); } final boolean isService = isAssistantService(); if (isService || !isVoiceSessionRunning()) { showOrb(); Loading Loading @@ -290,10 +287,6 @@ public class AssistManager { v.setImageDrawable(null); } private void vibrate() { mView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); } private boolean isAssistantService() { return mAssistComponent == null ? false : mAssistComponent.equals(getVoiceInteractorComponentName()); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +12 −25 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ import com.android.systemui.EventLogConstants; import com.android.systemui.EventLogTags; import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.SwipeHelper; import com.android.systemui.assist.AssistManager; import com.android.systemui.doze.DozeHost; import com.android.systemui.doze.DozeLog; Loading Loading @@ -676,8 +677,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNotificationPanelDebugText.setVisibility(View.VISIBLE); } updateShowSearchHoldoff(); try { boolean showNav = mWindowManagerService.hasNavigationBar(); if (DEBUG) Log.v(TAG, "hasNavigationBar=" + showNav); Loading Loading @@ -1013,11 +1012,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, return mStatusBarWindow; } public void invokeAssistGesture(boolean vibrate) { mHandler.removeCallbacks(mInvokeAssist); mAssistManager.onGestureInvoked(vibrate); } public int getStatusBarHeight() { if (mNaturalBarHeight < 0) { final Resources res = mContext.getResources(); Loading @@ -1044,31 +1038,28 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } }; private int mShowSearchHoldoff = 0; private Runnable mInvokeAssist = new Runnable() { public void run() { private final View.OnLongClickListener mLongPressHomeListener = new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (shouldDisableNavbarGestures()) { return false; } mAssistManager.prepareBeforeInvocation(); invokeAssistGesture(true /* vibrate */); mAssistManager.onGestureInvoked(); awakenDreams(); if (mNavigationBarView != null) { mNavigationBarView.abortCurrentGesture(); } return true; } }; View.OnTouchListener mHomeActionListener = new View.OnTouchListener() { private final View.OnTouchListener mHomeActionListener = new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if (!shouldDisableNavbarGestures()) { mHandler.removeCallbacks(mInvokeAssist); mHandler.postDelayed(mInvokeAssist, mShowSearchHoldoff); } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: mHandler.removeCallbacks(mInvokeAssist); awakenDreams(); break; } Loading Loading @@ -1096,6 +1087,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNavigationBarView.getBackButton().setLongClickable(true); mNavigationBarView.getBackButton().setOnLongClickListener(mLongPressBackRecentsListener); mNavigationBarView.getHomeButton().setOnTouchListener(mHomeActionListener); mNavigationBarView.getHomeButton().setOnLongClickListener(mLongPressHomeListener); mAssistManager.onConfigurationChanged(); } Loading Loading @@ -1236,10 +1228,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } private void updateShowSearchHoldoff() { mShowSearchHoldoff = ViewConfiguration.getLongPressTimeout(); } private void updateNotificationShade() { if (mStackScroller == null) return; Loading Loading @@ -2922,7 +2910,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, updateResources(); repositionNavigationBar(); updateShowSearchHoldoff(); updateRowStates(); mIconController.updateResources(); mScreenPinningRequest.onConfigurationChanged(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +7 −13 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class KeyButtonView extends ImageView { if (isLongClickable()) { // Just an old-fashioned ImageView performLongClick(); } else { } else if (mSupportsLongpress) { sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); } Loading Loading @@ -92,7 +92,7 @@ public class KeyButtonView extends ImageView { super.onInitializeAccessibilityNodeInfo(info); if (mCode != 0) { info.addAction(new AccessibilityNodeInfo.AccessibilityAction(ACTION_CLICK, null)); if (mSupportsLongpress) { if (mSupportsLongpress || isLongClickable()) { info.addAction( new AccessibilityNodeInfo.AccessibilityAction(ACTION_LONG_CLICK, null)); } Loading @@ -115,7 +115,7 @@ public class KeyButtonView extends ImageView { sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED); playSoundEffect(SoundEffectConstants.CLICK); return true; } else if (action == ACTION_LONG_CLICK && mCode != 0 && mSupportsLongpress) { } else if (action == ACTION_LONG_CLICK && mCode != 0) { sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.FLAG_LONG_PRESS); sendEvent(KeyEvent.ACTION_UP, 0); sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); Loading Loading @@ -144,10 +144,8 @@ public class KeyButtonView extends ImageView { // Provide the same haptic feedback that the system offers for virtual keys. performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); } if (mSupportsLongpress) { removeCallbacks(mCheckLongPress); postDelayed(mCheckLongPress, ViewConfiguration.getLongPressTimeout()); } break; case MotionEvent.ACTION_MOVE: x = (int)ev.getX(); Loading @@ -162,9 +160,7 @@ public class KeyButtonView extends ImageView { if (mCode != 0) { sendEvent(KeyEvent.ACTION_UP, KeyEvent.FLAG_CANCELED); } if (mSupportsLongpress) { removeCallbacks(mCheckLongPress); } break; case MotionEvent.ACTION_UP: final boolean doIt = isPressed(); Loading @@ -183,9 +179,7 @@ public class KeyButtonView extends ImageView { performClick(); } } if (mSupportsLongpress) { removeCallbacks(mCheckLongPress); } break; } Loading