diff options
| author | 2018-10-17 19:38:03 +0000 | |
|---|---|---|
| committer | 2018-10-17 19:38:03 +0000 | |
| commit | b10e4373c94a66b9aee29f743330f20b5e112baa (patch) | |
| tree | 4a9b22115ec1c535d8c0539656f6bb4ddc475858 | |
| parent | 90412b0d096b248c4395e18d7ccb62fba4a9bc4f (diff) | |
| parent | 3bf2d203792f940ecf14d9a5e7031ef7de8fe361 (diff) | |
Merge changes I3070e95f,Ia500dea6
* changes:
Fixed groups with min priority children
Added logging to debug the notification view hierarchy
5 files changed, 122 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java index f69ad43ed79c..5b3082b04d58 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java @@ -327,6 +327,17 @@ public class NotificationViewHierarchyManager { entry.notification) && !entry.row.isRemoved(); boolean showOnKeyguard = mLockscreenUserManager.shouldShowOnKeyguard(entry .notification); + if (!showOnKeyguard) { + // min priority notifications should show if their summary is showing + if (mGroupManager.isChildInGroupWithSummary(entry.notification)) { + ExpandableNotificationRow summary = mGroupManager.getLogicalGroupSummary( + entry.notification); + if (summary != null && mLockscreenUserManager.shouldShowOnKeyguard( + summary.getStatusBarNotification())) { + showOnKeyguard = true; + } + } + } if (suppressedSummary || mLockscreenUserManager.shouldHideNotifications(userId) || (isLocked && !showOnKeyguard)) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 23492aa62e37..8110c1c98dec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -102,6 +102,9 @@ import com.android.systemui.statusbar.notification.stack.ExpandableViewState; import com.android.systemui.statusbar.notification.stack.NotificationChildrenContainer; import com.android.systemui.statusbar.notification.stack.StackScrollState; +import java.io.FileDescriptor; +import java.io.PrintWriter; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import java.util.function.BooleanSupplier; @@ -3076,6 +3079,36 @@ public class ExpandableNotificationRow extends ActivatableNotificationView boolean onClick(View v, int x, int y, MenuItem item); } + @Override + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + super.dump(fd, pw, args); + pw.println(" Notification: " + getStatusBarNotification().getKey()); + pw.print(" visibility: " + getVisibility()); + pw.print(", alpha: " + getAlpha()); + pw.print(", translation: " + getTranslation()); + pw.print(", removed: " + isRemoved()); + pw.print(", privateShowing: " + (getShowingLayout() == mPrivateLayout)); + pw.println(); + pw.print(" "); + if (mNotificationViewState != null) { + mNotificationViewState.dump(fd, pw, args); + } else { + pw.print("no viewState!!!"); + } + pw.println(); + pw.println(); + if (mIsSummaryWithChildren) { + List<ExpandableNotificationRow> notificationChildren = getNotificationChildren(); + pw.println(" Children: " + notificationChildren.size()); + pw.println(" {"); + for(ExpandableNotificationRow child : notificationChildren) { + child.dump(fd, pw, args); + } + pw.println(" }"); + pw.println(); + } + } + /** * Background task for executing IPCs to check if the notification is a system notification. The * output is used for both the blocking helper and the notification info. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java index 46019e3b48ea..38d657b967a0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java @@ -25,16 +25,19 @@ import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; +import com.android.systemui.Dumpable; import com.android.systemui.statusbar.notification.stack.ExpandableViewState; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.StackScrollState; +import java.io.FileDescriptor; +import java.io.PrintWriter; import java.util.ArrayList; /** * An abstract view for expandable views. */ -public abstract class ExpandableView extends FrameLayout { +public abstract class ExpandableView extends FrameLayout implements Dumpable { public static final float NO_ROUNDNESS = -1; protected OnHeightChangedListener mOnHeightChangedListener; @@ -559,6 +562,10 @@ public abstract class ExpandableView extends FrameLayout { return false; } + @Override + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + } + /** * A listener notifying when {@link #getActualHeight} changes. */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 33ac390de29f..bac42ffceb92 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -4912,6 +4912,34 @@ public class NotificationStackScrollLayout extends ViewGroup mMaxTopPadding, mShouldShowShelfOnly ? "T" : "f", mQsExpansionFraction)); + int childCount = getChildCount(); + pw.println(" Number of children: " + childCount); + pw.println(); + + for (int i = 0; i < childCount; i++) { + ExpandableView child = (ExpandableView) getChildAt(i); + child.dump(fd, pw, args); + if (!(child instanceof ExpandableNotificationRow)) { + pw.println(" " + child.getClass().getSimpleName()); + // Notifications dump it's viewstate as part of their dump to support children + ExpandableViewState viewState = mCurrentStackScrollState.getViewStateForView( + child); + if (viewState == null) { + pw.println(" no viewState!!!"); + } else { + pw.print(" "); + viewState.dump(fd, pw, args); + pw.println(); + pw.println(); + } + } + } + pw.println(" Transient Views: " + childCount); + int transientViewCount = getTransientViewCount(); + for (int i = 0; i < transientViewCount; i++) { + ExpandableView child = (ExpandableView) getTransientView(i); + child.dump(fd, pw, args); + } } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ViewState.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ViewState.java index 1f3244f2177d..a15fd7083017 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ViewState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ViewState.java @@ -25,6 +25,7 @@ import android.util.Property; import android.view.View; import android.view.animation.Interpolator; +import com.android.systemui.Dumpable; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.statusbar.notification.row.ExpandableView; @@ -32,12 +33,17 @@ import com.android.systemui.statusbar.notification.AnimatableProperty; import com.android.systemui.statusbar.notification.PropertyAnimator; import com.android.systemui.statusbar.policy.HeadsUpUtil; +import java.io.FileDescriptor; +import java.io.PrintWriter; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + /** * A state of a view. This can be used to apply a set of view properties to a view with * {@link com.android.systemui.statusbar.notification.stack.StackScrollState} or start * animations with {@link com.android.systemui.statusbar.notification.stack.StackStateAnimator}. */ -public class ViewState { +public class ViewState implements Dumpable { /** * Some animation properties that can be used to update running animations but not creating @@ -710,4 +716,39 @@ public class ViewState { animator.cancel(); } } + + @Override + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { + StringBuilder result = new StringBuilder(); + result.append("ViewState { "); + + boolean first = true; + Class currentClass = this.getClass(); + while (currentClass != null) { + Field[] fields = currentClass.getDeclaredFields(); + // Print field names paired with their values + for (Field field : fields) { + int modifiers = field.getModifiers(); + if (Modifier.isStatic(modifiers) || field.isSynthetic() + || Modifier.isTransient(modifiers)) { + continue; + } + if (!first) { + result.append(", "); + } + try { + result.append(field.getName()); + result.append(": "); + //requires access to private field: + field.setAccessible(true); + result.append(field.get(this)); + } catch (IllegalAccessException ex) { + } + first = false; + } + currentClass = currentClass.getSuperclass(); + } + result.append(" }"); + pw.print(result); + } } |