Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +20 −19 Original line number Diff line number Diff line Loading @@ -216,7 +216,8 @@ import javax.inject.Provider; @CentralSurfacesComponent.CentralSurfacesScope public class NotificationPanelViewController extends PanelViewController { private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private static final boolean DEBUG_LOGCAT = Log.isLoggable(TAG, Log.DEBUG); private static final boolean DEBUG_DRAWABLE = false; /** * The parallax amount of the quick settings translation when dragging down the panel Loading Loading @@ -816,7 +817,7 @@ public class NotificationPanelViewController extends PanelViewController { mSettingsChangeObserver = new SettingsChangeObserver(handler); mSplitShadeEnabled = LargeScreenUtils.shouldUseSplitNotificationShade(mResources); mView.setWillNotDraw(!DEBUG); mView.setWillNotDraw(!DEBUG_DRAWABLE); mLargeScreenShadeHeaderController = largeScreenShadeHeaderController; mLayoutInflater = layoutInflater; mFeatureFlags = featureFlags; Loading Loading @@ -890,7 +891,7 @@ public class NotificationPanelViewController extends PanelViewController { mView.setOnApplyWindowInsetsListener(new OnApplyWindowInsetsListener()); if (DEBUG) { if (DEBUG_DRAWABLE) { mView.getOverlay().add(new DebugDrawable()); } Loading Loading @@ -1189,7 +1190,7 @@ public class NotificationPanelViewController extends PanelViewController { } private void reInflateViews() { if (DEBUG) Log.d(TAG, "reInflateViews"); if (DEBUG_LOGCAT) Log.d(TAG, "reInflateViews"); // Re-inflate the status view group. KeyguardStatusView keyguardStatusView = mNotificationContainerParent.findViewById(R.id.keyguard_status_view); Loading Loading @@ -1743,7 +1744,7 @@ public class NotificationPanelViewController extends PanelViewController { } private boolean onQsIntercept(MotionEvent event) { if (DEBUG) Log.d(TAG, "onQsIntercept"); if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept"); int pointerIndex = event.findPointerIndex(mTrackingPointer); if (pointerIndex < 0) { pointerIndex = 0; Loading Loading @@ -1798,7 +1799,7 @@ public class NotificationPanelViewController extends PanelViewController { if ((h > getTouchSlop(event) || (h < -getTouchSlop(event) && mQsExpanded)) && Math.abs(h) > Math.abs(x - mInitialTouchX) && shouldQuickSettingsIntercept(mInitialTouchX, mInitialTouchY, h)) { if (DEBUG) Log.d(TAG, "onQsIntercept - start tracking expansion"); if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept - start tracking expansion"); mView.getParent().requestDisallowInterceptTouchEvent(true); mQsTracking = true; traceQsJank(true /* startTracing */, false /* wasCancelled */); Loading Loading @@ -2075,7 +2076,7 @@ public class NotificationPanelViewController extends PanelViewController { private void handleQsDown(MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN && shouldQuickSettingsIntercept( event.getX(), event.getY(), -1)) { if (DEBUG) Log.d(TAG, "handleQsDown"); if (DEBUG_LOGCAT) Log.d(TAG, "handleQsDown"); mFalsingCollector.onQsDown(); mQsTracking = true; onQsExpansionStarted(); Loading Loading @@ -2189,7 +2190,7 @@ public class NotificationPanelViewController extends PanelViewController { break; case MotionEvent.ACTION_MOVE: if (DEBUG) Log.d(TAG, "onQSTouch move"); if (DEBUG_LOGCAT) Log.d(TAG, "onQSTouch move"); setQsExpansion(h + mInitialHeightOnTouch); if (h >= getFalsingThreshold()) { mQsTouchAboveFalsingThreshold = true; Loading Loading @@ -2341,7 +2342,7 @@ public class NotificationPanelViewController extends PanelViewController { mCentralSurfaces.executeRunnableDismissingKeyguard(null, null /* cancelAction */, false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */); } if (DEBUG) { if (DEBUG_DRAWABLE) { mView.invalidate(); } } Loading Loading @@ -2998,7 +2999,7 @@ public class NotificationPanelViewController extends PanelViewController { // This is a circular dependency and should be avoided, otherwise we'll have // a stack overflow. if (mStackScrollerMeasuringPass > 2) { if (DEBUG) Log.d(TAG, "Unstable notification panel height. Aborting."); if (DEBUG_LOGCAT) Log.d(TAG, "Unstable notification panel height. Aborting."); } else { positionClockAndNotifications(); } Loading Loading @@ -3032,7 +3033,7 @@ public class NotificationPanelViewController extends PanelViewController { updateNotificationTranslucency(); updatePanelExpanded(); updateGestureExclusionRect(); if (DEBUG) { if (DEBUG_DRAWABLE) { mView.invalidate(); } } Loading Loading @@ -3675,7 +3676,7 @@ public class NotificationPanelViewController extends PanelViewController { public void onQsPanelScrollChanged(int scrollY) { mLargeScreenShadeHeaderController.setQsScrollY(scrollY); if (scrollY > 0 && !mQsFullyExpanded) { if (DEBUG) Log.d(TAG, "Scrolling while not expanded. Forcing expand"); if (DEBUG_LOGCAT) Log.d(TAG, "Scrolling while not expanded. Forcing expand"); // If we are scrolling QS, we should be fully expanded. expandWithQs(); } Loading Loading @@ -4070,7 +4071,7 @@ public class NotificationPanelViewController extends PanelViewController { } public void setHeaderDebugInfo(String text) { if (DEBUG) mHeaderDebugInfo = text; if (DEBUG_DRAWABLE) mHeaderDebugInfo = text; } public void onThemeChanged() { Loading Loading @@ -4112,7 +4113,7 @@ public class NotificationPanelViewController extends PanelViewController { } if (!isFullyCollapsed() && onQsIntercept(event)) { if (DEBUG) Log.d(TAG, "onQsIntercept true"); if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept true"); return true; } return super.onInterceptTouchEvent(event); Loading Loading @@ -4183,7 +4184,7 @@ public class NotificationPanelViewController extends PanelViewController { handled |= mHeadsUpTouchHelper.onTouchEvent(event); if (!mHeadsUpTouchHelper.isTrackingHeadsUp() && handleQsTouch(event)) { if (DEBUG) Log.d(TAG, "handleQsTouch true"); if (DEBUG_LOGCAT) Log.d(TAG, "handleQsTouch true"); return true; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed()) { Loading Loading @@ -4623,7 +4624,7 @@ public class NotificationPanelViewController extends PanelViewController { private class ConfigurationListener implements ConfigurationController.ConfigurationListener { @Override public void onThemeChanged() { if (DEBUG) Log.d(TAG, "onThemeChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onThemeChanged"); mThemeResId = mView.getContext().getThemeResId(); reInflateViews(); } Loading @@ -4631,7 +4632,7 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void onSmallestScreenWidthChanged() { Trace.beginSection("onSmallestScreenWidthChanged"); if (DEBUG) Log.d(TAG, "onSmallestScreenWidthChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onSmallestScreenWidthChanged"); // Can affect multi-user switcher visibility as it depends on screen size by default: // it is enabled only for devices with large screens (see config_keyguardUserSwitcher) Loading @@ -4648,7 +4649,7 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void onDensityOrFontScaleChanged() { if (DEBUG) Log.d(TAG, "onDensityOrFontScaleChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onDensityOrFontScaleChanged"); reInflateViews(); } } Loading @@ -4661,7 +4662,7 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void onChange(boolean selfChange) { if (DEBUG) Log.d(TAG, "onSettingsChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onSettingsChanged"); // Can affect multi-user switcher visibility reInflateViews(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +20 −19 Original line number Diff line number Diff line Loading @@ -216,7 +216,8 @@ import javax.inject.Provider; @CentralSurfacesComponent.CentralSurfacesScope public class NotificationPanelViewController extends PanelViewController { private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); private static final boolean DEBUG_LOGCAT = Log.isLoggable(TAG, Log.DEBUG); private static final boolean DEBUG_DRAWABLE = false; /** * The parallax amount of the quick settings translation when dragging down the panel Loading Loading @@ -816,7 +817,7 @@ public class NotificationPanelViewController extends PanelViewController { mSettingsChangeObserver = new SettingsChangeObserver(handler); mSplitShadeEnabled = LargeScreenUtils.shouldUseSplitNotificationShade(mResources); mView.setWillNotDraw(!DEBUG); mView.setWillNotDraw(!DEBUG_DRAWABLE); mLargeScreenShadeHeaderController = largeScreenShadeHeaderController; mLayoutInflater = layoutInflater; mFeatureFlags = featureFlags; Loading Loading @@ -890,7 +891,7 @@ public class NotificationPanelViewController extends PanelViewController { mView.setOnApplyWindowInsetsListener(new OnApplyWindowInsetsListener()); if (DEBUG) { if (DEBUG_DRAWABLE) { mView.getOverlay().add(new DebugDrawable()); } Loading Loading @@ -1189,7 +1190,7 @@ public class NotificationPanelViewController extends PanelViewController { } private void reInflateViews() { if (DEBUG) Log.d(TAG, "reInflateViews"); if (DEBUG_LOGCAT) Log.d(TAG, "reInflateViews"); // Re-inflate the status view group. KeyguardStatusView keyguardStatusView = mNotificationContainerParent.findViewById(R.id.keyguard_status_view); Loading Loading @@ -1743,7 +1744,7 @@ public class NotificationPanelViewController extends PanelViewController { } private boolean onQsIntercept(MotionEvent event) { if (DEBUG) Log.d(TAG, "onQsIntercept"); if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept"); int pointerIndex = event.findPointerIndex(mTrackingPointer); if (pointerIndex < 0) { pointerIndex = 0; Loading Loading @@ -1798,7 +1799,7 @@ public class NotificationPanelViewController extends PanelViewController { if ((h > getTouchSlop(event) || (h < -getTouchSlop(event) && mQsExpanded)) && Math.abs(h) > Math.abs(x - mInitialTouchX) && shouldQuickSettingsIntercept(mInitialTouchX, mInitialTouchY, h)) { if (DEBUG) Log.d(TAG, "onQsIntercept - start tracking expansion"); if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept - start tracking expansion"); mView.getParent().requestDisallowInterceptTouchEvent(true); mQsTracking = true; traceQsJank(true /* startTracing */, false /* wasCancelled */); Loading Loading @@ -2075,7 +2076,7 @@ public class NotificationPanelViewController extends PanelViewController { private void handleQsDown(MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN && shouldQuickSettingsIntercept( event.getX(), event.getY(), -1)) { if (DEBUG) Log.d(TAG, "handleQsDown"); if (DEBUG_LOGCAT) Log.d(TAG, "handleQsDown"); mFalsingCollector.onQsDown(); mQsTracking = true; onQsExpansionStarted(); Loading Loading @@ -2189,7 +2190,7 @@ public class NotificationPanelViewController extends PanelViewController { break; case MotionEvent.ACTION_MOVE: if (DEBUG) Log.d(TAG, "onQSTouch move"); if (DEBUG_LOGCAT) Log.d(TAG, "onQSTouch move"); setQsExpansion(h + mInitialHeightOnTouch); if (h >= getFalsingThreshold()) { mQsTouchAboveFalsingThreshold = true; Loading Loading @@ -2341,7 +2342,7 @@ public class NotificationPanelViewController extends PanelViewController { mCentralSurfaces.executeRunnableDismissingKeyguard(null, null /* cancelAction */, false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */); } if (DEBUG) { if (DEBUG_DRAWABLE) { mView.invalidate(); } } Loading Loading @@ -2998,7 +2999,7 @@ public class NotificationPanelViewController extends PanelViewController { // This is a circular dependency and should be avoided, otherwise we'll have // a stack overflow. if (mStackScrollerMeasuringPass > 2) { if (DEBUG) Log.d(TAG, "Unstable notification panel height. Aborting."); if (DEBUG_LOGCAT) Log.d(TAG, "Unstable notification panel height. Aborting."); } else { positionClockAndNotifications(); } Loading Loading @@ -3032,7 +3033,7 @@ public class NotificationPanelViewController extends PanelViewController { updateNotificationTranslucency(); updatePanelExpanded(); updateGestureExclusionRect(); if (DEBUG) { if (DEBUG_DRAWABLE) { mView.invalidate(); } } Loading Loading @@ -3675,7 +3676,7 @@ public class NotificationPanelViewController extends PanelViewController { public void onQsPanelScrollChanged(int scrollY) { mLargeScreenShadeHeaderController.setQsScrollY(scrollY); if (scrollY > 0 && !mQsFullyExpanded) { if (DEBUG) Log.d(TAG, "Scrolling while not expanded. Forcing expand"); if (DEBUG_LOGCAT) Log.d(TAG, "Scrolling while not expanded. Forcing expand"); // If we are scrolling QS, we should be fully expanded. expandWithQs(); } Loading Loading @@ -4070,7 +4071,7 @@ public class NotificationPanelViewController extends PanelViewController { } public void setHeaderDebugInfo(String text) { if (DEBUG) mHeaderDebugInfo = text; if (DEBUG_DRAWABLE) mHeaderDebugInfo = text; } public void onThemeChanged() { Loading Loading @@ -4112,7 +4113,7 @@ public class NotificationPanelViewController extends PanelViewController { } if (!isFullyCollapsed() && onQsIntercept(event)) { if (DEBUG) Log.d(TAG, "onQsIntercept true"); if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept true"); return true; } return super.onInterceptTouchEvent(event); Loading Loading @@ -4183,7 +4184,7 @@ public class NotificationPanelViewController extends PanelViewController { handled |= mHeadsUpTouchHelper.onTouchEvent(event); if (!mHeadsUpTouchHelper.isTrackingHeadsUp() && handleQsTouch(event)) { if (DEBUG) Log.d(TAG, "handleQsTouch true"); if (DEBUG_LOGCAT) Log.d(TAG, "handleQsTouch true"); return true; } if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed()) { Loading Loading @@ -4623,7 +4624,7 @@ public class NotificationPanelViewController extends PanelViewController { private class ConfigurationListener implements ConfigurationController.ConfigurationListener { @Override public void onThemeChanged() { if (DEBUG) Log.d(TAG, "onThemeChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onThemeChanged"); mThemeResId = mView.getContext().getThemeResId(); reInflateViews(); } Loading @@ -4631,7 +4632,7 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void onSmallestScreenWidthChanged() { Trace.beginSection("onSmallestScreenWidthChanged"); if (DEBUG) Log.d(TAG, "onSmallestScreenWidthChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onSmallestScreenWidthChanged"); // Can affect multi-user switcher visibility as it depends on screen size by default: // it is enabled only for devices with large screens (see config_keyguardUserSwitcher) Loading @@ -4648,7 +4649,7 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void onDensityOrFontScaleChanged() { if (DEBUG) Log.d(TAG, "onDensityOrFontScaleChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onDensityOrFontScaleChanged"); reInflateViews(); } } Loading @@ -4661,7 +4662,7 @@ public class NotificationPanelViewController extends PanelViewController { @Override public void onChange(boolean selfChange) { if (DEBUG) Log.d(TAG, "onSettingsChanged"); if (DEBUG_LOGCAT) Log.d(TAG, "onSettingsChanged"); // Can affect multi-user switcher visibility reInflateViews(); Loading