Loading src/com/android/settings/applications/InstalledAppDetails.java +3 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,9 @@ public class InstalledAppDetails extends AppInfoBase @Override public void onPrepareOptionsMenu(Menu menu) { if (mFinishing) { return; } boolean showIt = true; if (mUpdatedSysApp) { showIt = false; Loading src/com/android/settings/notification/AppNotificationSettings.java +20 −10 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private AppRow mAppRow; private boolean mCreated; private boolean mIsSystemPackage; private int mUid; @Override public void onActivityCreated(Bundle savedInstanceState) { Loading Loading @@ -110,22 +111,22 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { final String pkg = args != null && args.containsKey(AppInfoBase.ARG_PACKAGE_NAME) ? args.getString(AppInfoBase.ARG_PACKAGE_NAME) : intent.getStringExtra(Settings.EXTRA_APP_PACKAGE); final int uid = args != null && args.containsKey(AppInfoBase.ARG_PACKAGE_UID) mUid = args != null && args.containsKey(AppInfoBase.ARG_PACKAGE_UID) ? args.getInt(AppInfoBase.ARG_PACKAGE_UID) : intent.getIntExtra(Settings.EXTRA_APP_UID, -1); if (uid == -1 || TextUtils.isEmpty(pkg)) { if (mUid == -1 || TextUtils.isEmpty(pkg)) { Log.w(TAG, "Missing extras: " + Settings.EXTRA_APP_PACKAGE + " was " + pkg + ", " + Settings.EXTRA_APP_UID + " was " + uid); + Settings.EXTRA_APP_UID + " was " + mUid); toastAndFinish(); return; } if (DEBUG) Log.d(TAG, "Load details for pkg=" + pkg + " uid=" + uid); if (DEBUG) Log.d(TAG, "Load details for pkg=" + pkg + " uid=" + mUid); final PackageManager pm = getPackageManager(); final PackageInfo info = findPackageInfo(pm, pkg, uid); final PackageInfo info = findPackageInfo(pm, pkg, mUid); if (info == null) { Log.w(TAG, "Failed to find package info: " + Settings.EXTRA_APP_PACKAGE + " was " + pkg + ", " + Settings.EXTRA_APP_UID + " was " + uid); + ", " + Settings.EXTRA_APP_UID + " was " + mUid); toastAndFinish(); return; } Loading Loading @@ -157,7 +158,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { if (banned) { MetricsLogger.action(getActivity(), MetricsLogger.ACTION_BAN_APP_NOTES, pkg); } final boolean success = mBackend.setNotificationsBanned(pkg, uid, banned); final boolean success = mBackend.setNotificationsBanned(pkg, mUid, banned); if (success) { updateDependents(banned); } Loading @@ -169,7 +170,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean priority = (Boolean) newValue; return mBackend.setHighPriority(pkg, uid, priority); return mBackend.setHighPriority(pkg, mUid, priority); } }); Loading @@ -177,7 +178,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean peekable = (Boolean) newValue; return mBackend.setPeekable(pkg, uid, peekable); return mBackend.setPeekable(pkg, mUid, peekable); } }); Loading @@ -185,7 +186,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean sensitive = (Boolean) newValue; return mBackend.setSensitive(pkg, uid, sensitive); return mBackend.setSensitive(pkg, mUid, sensitive); } }); Loading @@ -203,6 +204,15 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { } } @Override public void onResume() { super.onResume(); if (mUid != -1 && getPackageManager().getPackagesForUid(mUid) == null) { // App isn't around anymore, must have been removed. finish(); } } private void updateDependents(boolean banned) { final boolean lockscreenSecure = new LockPatternUtils(getActivity()).isSecure( UserHandle.myUserId()); Loading Loading
src/com/android/settings/applications/InstalledAppDetails.java +3 −0 Original line number Diff line number Diff line Loading @@ -379,6 +379,9 @@ public class InstalledAppDetails extends AppInfoBase @Override public void onPrepareOptionsMenu(Menu menu) { if (mFinishing) { return; } boolean showIt = true; if (mUpdatedSysApp) { showIt = false; Loading
src/com/android/settings/notification/AppNotificationSettings.java +20 −10 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { private AppRow mAppRow; private boolean mCreated; private boolean mIsSystemPackage; private int mUid; @Override public void onActivityCreated(Bundle savedInstanceState) { Loading Loading @@ -110,22 +111,22 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { final String pkg = args != null && args.containsKey(AppInfoBase.ARG_PACKAGE_NAME) ? args.getString(AppInfoBase.ARG_PACKAGE_NAME) : intent.getStringExtra(Settings.EXTRA_APP_PACKAGE); final int uid = args != null && args.containsKey(AppInfoBase.ARG_PACKAGE_UID) mUid = args != null && args.containsKey(AppInfoBase.ARG_PACKAGE_UID) ? args.getInt(AppInfoBase.ARG_PACKAGE_UID) : intent.getIntExtra(Settings.EXTRA_APP_UID, -1); if (uid == -1 || TextUtils.isEmpty(pkg)) { if (mUid == -1 || TextUtils.isEmpty(pkg)) { Log.w(TAG, "Missing extras: " + Settings.EXTRA_APP_PACKAGE + " was " + pkg + ", " + Settings.EXTRA_APP_UID + " was " + uid); + Settings.EXTRA_APP_UID + " was " + mUid); toastAndFinish(); return; } if (DEBUG) Log.d(TAG, "Load details for pkg=" + pkg + " uid=" + uid); if (DEBUG) Log.d(TAG, "Load details for pkg=" + pkg + " uid=" + mUid); final PackageManager pm = getPackageManager(); final PackageInfo info = findPackageInfo(pm, pkg, uid); final PackageInfo info = findPackageInfo(pm, pkg, mUid); if (info == null) { Log.w(TAG, "Failed to find package info: " + Settings.EXTRA_APP_PACKAGE + " was " + pkg + ", " + Settings.EXTRA_APP_UID + " was " + uid); + ", " + Settings.EXTRA_APP_UID + " was " + mUid); toastAndFinish(); return; } Loading Loading @@ -157,7 +158,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { if (banned) { MetricsLogger.action(getActivity(), MetricsLogger.ACTION_BAN_APP_NOTES, pkg); } final boolean success = mBackend.setNotificationsBanned(pkg, uid, banned); final boolean success = mBackend.setNotificationsBanned(pkg, mUid, banned); if (success) { updateDependents(banned); } Loading @@ -169,7 +170,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean priority = (Boolean) newValue; return mBackend.setHighPriority(pkg, uid, priority); return mBackend.setHighPriority(pkg, mUid, priority); } }); Loading @@ -177,7 +178,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean peekable = (Boolean) newValue; return mBackend.setPeekable(pkg, uid, peekable); return mBackend.setPeekable(pkg, mUid, peekable); } }); Loading @@ -185,7 +186,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean sensitive = (Boolean) newValue; return mBackend.setSensitive(pkg, uid, sensitive); return mBackend.setSensitive(pkg, mUid, sensitive); } }); Loading @@ -203,6 +204,15 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { } } @Override public void onResume() { super.onResume(); if (mUid != -1 && getPackageManager().getPackagesForUid(mUid) == null) { // App isn't around anymore, must have been removed. finish(); } } private void updateDependents(boolean banned) { final boolean lockscreenSecure = new LockPatternUtils(getActivity()).isSecure( UserHandle.myUserId()); Loading