Merge changes from topic "presubmit-am-1e7fa8f458a24c9bb07a3501870823fc"
* changes:
[automerge] Fix some history issues 2p: 4d46dddbe7 2p: cf0c8f9868
[automerge] Fix some history issues 2p: 4d46dddbe7
Fix some history issues
diff --git a/res/layout/notification_sbn_log_row.xml b/res/layout/notification_sbn_log_row.xml
index 91d6600..23bc110 100644
--- a/res/layout/notification_sbn_log_row.xml
+++ b/res/layout/notification_sbn_log_row.xml
@@ -74,8 +74,8 @@
<ImageView
android:id="@+id/profile_badge"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="16dp"
+ android:layout_height="16dp"
android:layout_marginEnd="6dp"
android:scaleType="fitCenter"
android:contentDescription="@*android:string/notification_work_profile_content_description"
diff --git a/src/com/android/settings/notification/history/NotificationHistoryActivity.java b/src/com/android/settings/notification/history/NotificationHistoryActivity.java
index ec09a9f..4fecfc9 100644
--- a/src/com/android/settings/notification/history/NotificationHistoryActivity.java
+++ b/src/com/android/settings/notification/history/NotificationHistoryActivity.java
@@ -356,8 +356,10 @@
}
final int newState = isChecked ? 1 : 0;
if (oldState != newState) {
- Settings.Secure.putInt(getContentResolver(),
- NOTIFICATION_HISTORY_ENABLED, newState);
+ for (int user : mUm.getProfileIds(ActivityManager.getCurrentUser(), false)) {
+ Settings.Secure.putIntForUser(getContentResolver(),
+ NOTIFICATION_HISTORY_ENABLED, newState, user);
+ }
mUiEventLogger.log(isChecked ? NotificationHistoryEvent.NOTIFICATION_HISTORY_ON
: NotificationHistoryEvent.NOTIFICATION_HISTORY_OFF);
Log.d(TAG, "onSwitchChange history to " + isChecked);
diff --git a/src/com/android/settings/notification/history/NotificationSbnAdapter.java b/src/com/android/settings/notification/history/NotificationSbnAdapter.java
index 7eca3b7..1d61ae7 100644
--- a/src/com/android/settings/notification/history/NotificationSbnAdapter.java
+++ b/src/com/android/settings/notification/history/NotificationSbnAdapter.java
@@ -121,7 +121,7 @@
int userId = normalizeUserId(sbn);
if (!mUserBadgeCache.containsKey(userId)) {
Drawable profile = mContext.getPackageManager().getUserBadgeForDensity(
- UserHandle.of(userId), -1);
+ UserHandle.of(userId), 0);
mUserBadgeCache.put(userId, profile);
}
holder.setProfileBadge(mUserBadgeCache.get(userId));