|
161 | 161 | import com.android.systemui.statusbar.phone.StatusBar; |
162 | 162 | import com.android.systemui.statusbar.policy.ConfigurationController; |
163 | 163 | import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; |
| 164 | +import com.android.systemui.statusbar.policy.DeviceProvisionedController; |
| 165 | +import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; |
164 | 166 | import com.android.systemui.statusbar.policy.HeadsUpUtil; |
165 | 167 | import com.android.systemui.statusbar.policy.ScrollAdapter; |
166 | 168 | import com.android.systemui.statusbar.policy.ZenModeController; |
@@ -304,6 +306,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd |
304 | 306 | private boolean mExpandedInThisMotion; |
305 | 307 | private boolean mShouldShowShelfOnly; |
306 | 308 | protected boolean mScrollingEnabled; |
| 309 | + private boolean mIsCurrentUserSetup; |
307 | 310 | protected FooterView mFooterView; |
308 | 311 | protected EmptyShadeView mEmptyShadeView; |
309 | 312 | private boolean mDismissAllInProgress; |
@@ -514,6 +517,8 @@ public void getOutline(View view, Outline outline) { |
514 | 517 | private final NotifPipeline mNotifPipeline; |
515 | 518 | private final NotifCollection mNotifCollection; |
516 | 519 | private final NotificationEntryManager mEntryManager; |
| 520 | + private final DeviceProvisionedController mDeviceProvisionedController = |
| 521 | + Dependency.get(DeviceProvisionedController.class); |
517 | 522 | private final IStatusBarService mBarService = IStatusBarService.Stub.asInterface( |
518 | 523 | ServiceManager.getService(Context.STATUS_BAR_SERVICE)); |
519 | 524 | @VisibleForTesting |
@@ -692,6 +697,29 @@ public NotificationStackScrollLayout( |
692 | 697 | }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL, |
693 | 698 | Settings.Secure.NOTIFICATION_HISTORY_ENABLED); |
694 | 699 |
|
| 700 | + mDeviceProvisionedController.addCallback( |
| 701 | + new DeviceProvisionedListener() { |
| 702 | + @Override |
| 703 | + public void onDeviceProvisionedChanged() { |
| 704 | + updateCurrentUserIsSetup(); |
| 705 | + } |
| 706 | + |
| 707 | + @Override |
| 708 | + public void onUserSwitched() { |
| 709 | + updateCurrentUserIsSetup(); |
| 710 | + } |
| 711 | + |
| 712 | + @Override |
| 713 | + public void onUserSetupChanged() { |
| 714 | + updateCurrentUserIsSetup(); |
| 715 | + } |
| 716 | + |
| 717 | + private void updateCurrentUserIsSetup() { |
| 718 | + setCurrentUserSetup(mDeviceProvisionedController.isCurrentUserSetup()); |
| 719 | + } |
| 720 | + }); |
| 721 | + |
| 722 | + |
695 | 723 | mFeatureFlags = featureFlags; |
696 | 724 | mNotifPipeline = notifPipeline; |
697 | 725 | mEntryManager = entryManager; |
@@ -819,6 +847,7 @@ public void updateFooter() { |
819 | 847 | boolean showDismissView = mClearAllEnabled && hasActiveClearableNotifications(ROWS_ALL); |
820 | 848 | mStatusBar.setHasClearableNotifs(hasActiveClearableNotifications(ROWS_ALL)); |
821 | 849 | boolean showFooterView = (showDismissView || hasActiveNotifications()) |
| 850 | + && mIsCurrentUserSetup // see: b/193149550 |
822 | 851 | && mStatusBarState != StatusBarState.KEYGUARD |
823 | 852 | && !mRemoteInputManager.getController().isRemoteInputActive(); |
824 | 853 | boolean showHistory = Settings.Secure.getIntForUser(mContext.getContentResolver(), |
@@ -6030,6 +6059,16 @@ public float calculateAppearFractionBypass() { |
6030 | 6059 | return MathUtils.smoothStep(0, totalDistance, dragDownAmount); |
6031 | 6060 | } |
6032 | 6061 |
|
| 6062 | + /** |
| 6063 | + * Sets whether the current user is set up, which is required to show the footer (b/193149550) |
| 6064 | + */ |
| 6065 | + public void setCurrentUserSetup(boolean isCurrentUserSetup) { |
| 6066 | + if (mIsCurrentUserSetup != isCurrentUserSetup) { |
| 6067 | + mIsCurrentUserSetup = isCurrentUserSetup; |
| 6068 | + updateFooter(); |
| 6069 | + } |
| 6070 | + } |
| 6071 | + |
6033 | 6072 | /** |
6034 | 6073 | * A listener that is notified when the empty space below the notifications is clicked on |
6035 | 6074 | */ |
|
0 commit comments