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

View File

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