Don't crash on apps only installed for other users.

Change-Id: I13d415441aa1c7d09df7adccd4e2d2f9bbd3dbfb
Fixes: 28151314
This commit is contained in:
Julia Reynolds
2016-04-25 16:45:49 -04:00
parent c8d363e24c
commit 175bba9ed9

View File

@@ -80,21 +80,23 @@ public class AppNotificationSettings extends NotificationSettingsBase {
mBlock = (RestrictedSwitchPreference) getPreferenceScreen().findPreference(KEY_BLOCK); mBlock = (RestrictedSwitchPreference) getPreferenceScreen().findPreference(KEY_BLOCK);
mSilent = (RestrictedSwitchPreference) getPreferenceScreen().findPreference(KEY_SILENT); mSilent = (RestrictedSwitchPreference) getPreferenceScreen().findPreference(KEY_SILENT);
mAppRow = mBackend.loadAppRow(mContext, mPm, mPkgInfo); if (mPkgInfo != null) {
mAppRow = mBackend.loadAppRow(mContext, mPm, mPkgInfo);
NotificationManager.Policy policy = NotificationManager.Policy policy =
NotificationManager.from(mContext).getNotificationPolicy(); NotificationManager.from(mContext).getNotificationPolicy();
mDndVisualEffectsSuppressed = policy == null ? false : policy.suppressedVisualEffects != 0; mDndVisualEffectsSuppressed = policy == null ? false : policy.suppressedVisualEffects != 0;
// load settings intent // load settings intent
ArrayMap<String, AppRow> rows = new ArrayMap<String, AppRow>(); ArrayMap<String, AppRow> rows = new ArrayMap<String, AppRow>();
rows.put(mAppRow.pkg, mAppRow); rows.put(mAppRow.pkg, mAppRow);
collectConfigActivities(rows); collectConfigActivities(rows);
setupImportancePrefs(mAppRow.systemApp, mAppRow.appImportance, mAppRow.banned); setupImportancePrefs(mAppRow.systemApp, mAppRow.appImportance, mAppRow.banned);
setupPriorityPref(mAppRow.appBypassDnd); setupPriorityPref(mAppRow.appBypassDnd);
setupVisOverridePref(mAppRow.appVisOverride); setupVisOverridePref(mAppRow.appVisOverride);
updateDependents(mAppRow.appImportance); updateDependents(mAppRow.appImportance);
}
} }
@Override @Override