Merge "NotificationPanelViewController: separate DEBUG flag for drawable" into tm-dev am: cbad872980

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18586451

Change-Id: If696b7c8b0eaba4d123530607eae7cbebc09bd03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-05-25 00:06:38 +00:00
committed by Automerger Merge Worker

View File

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