[automerge] Fix some history issues 2p: 4d46dddbe7

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/17710594

Change-Id: Ia4166d749cab1f571f2becec77b3dfae996d5101
This commit is contained in:
Julia Reynolds
2022-04-12 15:16:04 +00:00
committed by Presubmit Automerger Backend
3 changed files with 7 additions and 5 deletions

View File

@@ -74,8 +74,8 @@
<ImageView <ImageView
android:id="@+id/profile_badge" android:id="@+id/profile_badge"
android:layout_width="wrap_content" android:layout_width="16dp"
android:layout_height="wrap_content" android:layout_height="16dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:contentDescription="@*android:string/notification_work_profile_content_description" android:contentDescription="@*android:string/notification_work_profile_content_description"

View File

@@ -356,8 +356,10 @@ public class NotificationHistoryActivity extends CollapsingToolbarBaseActivity {
} }
final int newState = isChecked ? 1 : 0; final int newState = isChecked ? 1 : 0;
if (oldState != newState) { if (oldState != newState) {
Settings.Secure.putInt(getContentResolver(), for (int user : mUm.getProfileIds(ActivityManager.getCurrentUser(), false)) {
NOTIFICATION_HISTORY_ENABLED, newState); Settings.Secure.putIntForUser(getContentResolver(),
NOTIFICATION_HISTORY_ENABLED, newState, user);
}
mUiEventLogger.log(isChecked ? NotificationHistoryEvent.NOTIFICATION_HISTORY_ON mUiEventLogger.log(isChecked ? NotificationHistoryEvent.NOTIFICATION_HISTORY_ON
: NotificationHistoryEvent.NOTIFICATION_HISTORY_OFF); : NotificationHistoryEvent.NOTIFICATION_HISTORY_OFF);
Log.d(TAG, "onSwitchChange history to " + isChecked); Log.d(TAG, "onSwitchChange history to " + isChecked);

View File

@@ -121,7 +121,7 @@ public class NotificationSbnAdapter extends
int userId = normalizeUserId(sbn); int userId = normalizeUserId(sbn);
if (!mUserBadgeCache.containsKey(userId)) { if (!mUserBadgeCache.containsKey(userId)) {
Drawable profile = mContext.getPackageManager().getUserBadgeForDensity( Drawable profile = mContext.getPackageManager().getUserBadgeForDensity(
UserHandle.of(userId), -1); UserHandle.of(userId), 0);
mUserBadgeCache.put(userId, profile); mUserBadgeCache.put(userId, profile);
} }
holder.setProfileBadge(mUserBadgeCache.get(userId)); holder.setProfileBadge(mUserBadgeCache.get(userId));