Merge changes I81990d63,I053a6220

* changes:
  Fix settings crash if launched with null args
  Fix settings crash on noti listener screen
This commit is contained in:
TreeHugger Robot
2018-09-08 04:52:19 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 11 deletions

View File

@@ -112,10 +112,12 @@ abstract public class NotificationSettingsBase extends DashboardFragment {
mPkgInfo = findPackageInfo(mPkg, mUid); mPkgInfo = findPackageInfo(mPkg, mUid);
if (mPkgInfo != null) {
mUserId = UserHandle.getUserId(mUid); mUserId = UserHandle.getUserId(mUid);
mSuspendedAppsAdmin = RestrictedLockUtilsInternal.checkIfApplicationIsSuspended( mSuspendedAppsAdmin = RestrictedLockUtilsInternal.checkIfApplicationIsSuspended(
mContext, mPkg, mUserId); mContext, mPkg, mUserId);
loadChannel(); loadChannel();
loadAppRow(); loadAppRow();
loadChannelGroup(); loadChannelGroup();
@@ -127,6 +129,7 @@ abstract public class NotificationSettingsBase extends DashboardFragment {
controller.onResume(mAppRow, mChannel, mChannelGroup, mSuspendedAppsAdmin); controller.onResume(mAppRow, mChannel, mChannelGroup, mSuspendedAppsAdmin);
} }
} }
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {

View File

@@ -117,7 +117,7 @@ public abstract class ManagedServiceSettings extends EmptyTextSettings {
CharSequence title = null; CharSequence title = null;
try { try {
title = mPm.getApplicationInfoAsUser( title = mPm.getApplicationInfoAsUser(
service.packageName, 0, getCurrentUser(managedProfileId)).loadLabel(mPm); service.packageName, 0, UserHandle.myUserId()).loadLabel(mPm);
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
// unlikely, as we are iterating over live services. // unlikely, as we are iterating over live services.
Log.e(TAG, "can't find package name", e); Log.e(TAG, "can't find package name", e);