summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lyn Han <lynhan@google.com> 2022-05-12 00:32:26 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-05-12 00:32:26 +0000
commit7bb4ac3e7ba65a960beaa1c11614339a7fbb64ed (patch)
tree0030f8741590adb77db659783800f3432f2d728a
parent9afcdca11ebd87cb99e9693ba8adc23ba6c0cbfd (diff)
parent21dee3fd9a3e80edde29e2641d67e7ac74c719fa (diff)
Merge "Add debug logging to StackScrollAlgorithm" into tm-dev am: 55f43e04cf am: 21dee3fd9a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18132914 Change-Id: I95b01315c4c0e01023bbb0e675494aa48a7137d8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java36
1 files changed, 34 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
index 2b79986662f1..799fee5e865d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -49,9 +49,10 @@ public class StackScrollAlgorithm {
public static final float START_FRACTION = 0.5f;
- private static final String LOG_TAG = "StackScrollAlgorithm";
- private final ViewGroup mHostView;
+ private static final String TAG = "StackScrollAlgorithm";
+ private static final Boolean DEBUG = false;
+ private final ViewGroup mHostView;
private int mPaddingBetweenElements;
private int mGapHeight;
private int mGapHeightOnLockscreen;
@@ -126,6 +127,37 @@ public class StackScrollAlgorithm {
return getExpansionFractionWithoutShelf(mTempAlgorithmState, ambientState);
}
+ private void log(String s) {
+ if (DEBUG) {
+ android.util.Log.i(TAG, s);
+ }
+ }
+
+ public void logView(View view, String s) {
+ String viewString = "";
+ if (view instanceof ExpandableNotificationRow) {
+ ExpandableNotificationRow row = ((ExpandableNotificationRow) view);
+ if (row.getEntry() == null) {
+ viewString = "ExpandableNotificationRow has null NotificationEntry";
+ } else {
+ viewString = row.getEntry().getSbn().getId() + "";
+ }
+ } else if (view == null) {
+ viewString = "View is null";
+ } else if (view instanceof SectionHeaderView) {
+ viewString = "SectionHeaderView";
+ } else if (view instanceof FooterView) {
+ viewString = "FooterView";
+ } else if (view instanceof MediaContainerView) {
+ viewString = "MediaContainerView";
+ } else if (view instanceof EmptyShadeView) {
+ viewString = "EmptyShadeView";
+ } else {
+ viewString = view.toString();
+ }
+ log(viewString + " " + s);
+ }
+
private void resetChildViewStates() {
int numChildren = mHostView.getChildCount();
for (int i = 0; i < numChildren; i++) {