Notification history updates

- New strings
- Fix a crash

Test: manual
Fixes: 151833727
Change-Id: I3b0ef5cd9b221be917c71043e5217a43bc5891d0
This commit is contained in:
Julia Reynolds
2020-03-24 09:25:58 -04:00
parent 43d9013aaa
commit 8222a9a650
4 changed files with 17 additions and 11 deletions

View File

@@ -23,6 +23,8 @@ import static android.os.UserHandle.USER_ALL;
import static android.os.UserHandle.USER_CURRENT;
import android.annotation.ColorInt;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.Notification;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -46,6 +48,7 @@ import com.android.internal.util.ContrastColorUtil;
import com.android.settings.R;
import java.util.ArrayList;
import java.util.Currency;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -60,6 +63,7 @@ public class NotificationSbnAdapter extends
private PackageManager mPm;
private @ColorInt int mBackgroundColor;
private boolean mInNightMode;
private @UserIdInt int mCurrentUser;
public NotificationSbnAdapter(Context context, PackageManager pm) {
mContext = context;
@@ -71,6 +75,7 @@ public class NotificationSbnAdapter extends
Configuration currentConfig = mContext.getResources().getConfiguration();
mInNightMode = (currentConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK)
== Configuration.UI_MODE_NIGHT_YES;
mCurrentUser = ActivityManager.getCurrentUser();
setHasStableIds(true);
}
@@ -188,7 +193,7 @@ public class NotificationSbnAdapter extends
private int normalizeUserId(StatusBarNotification sbn) {
int userId = sbn.getUserId();
if (userId == USER_ALL) {
userId = USER_CURRENT;
userId = mCurrentUser;
}
return userId;
}