Fix issue #7178865: Selecting an app from Settings > Apps>...
...all crashes on a secondary user Change-Id: I977932bce3ea2816e4c9d1002488b658a96e3986
This commit is contained in:
@@ -379,8 +379,6 @@ public class InstalledAppDetails extends Fragment
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle icicle) {
|
public void onCreate(Bundle icicle) {
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
|
|
||||||
setHasOptionsMenu(true);
|
|
||||||
|
|
||||||
mState = ApplicationsState.getInstance(getActivity().getApplication());
|
mState = ApplicationsState.getInstance(getActivity().getApplication());
|
||||||
mSession = mState.newSession(this);
|
mSession = mState.newSession(this);
|
||||||
@@ -393,6 +391,10 @@ public class InstalledAppDetails extends Fragment
|
|||||||
mSmsManager = ISms.Stub.asInterface(ServiceManager.getService("isms"));
|
mSmsManager = ISms.Stub.asInterface(ServiceManager.getService("isms"));
|
||||||
|
|
||||||
mCanBeOnSdCardChecker = new CanBeOnSdCardChecker();
|
mCanBeOnSdCardChecker = new CanBeOnSdCardChecker();
|
||||||
|
|
||||||
|
retrieveAppEntry();
|
||||||
|
|
||||||
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -452,6 +454,8 @@ public class InstalledAppDetails extends Fragment
|
|||||||
boolean showIt = true;
|
boolean showIt = true;
|
||||||
if (mUpdatedSysApp) {
|
if (mUpdatedSysApp) {
|
||||||
showIt = false;
|
showIt = false;
|
||||||
|
} else if (mAppEntry == null) {
|
||||||
|
showIt = false;
|
||||||
} else if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
} else if ((mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
||||||
showIt = false;
|
showIt = false;
|
||||||
} else if (mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
|
} else if (mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
|
||||||
@@ -549,10 +553,7 @@ public class InstalledAppDetails extends Fragment
|
|||||||
public void onRunningStateChanged(boolean running) {
|
public void onRunningStateChanged(boolean running) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean refreshUi() {
|
private String retrieveAppEntry() {
|
||||||
if (mMoveInProgress) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
final Bundle args = getArguments();
|
final Bundle args = getArguments();
|
||||||
String packageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null;
|
String packageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null;
|
||||||
if (packageName == null) {
|
if (packageName == null) {
|
||||||
@@ -563,7 +564,15 @@ public class InstalledAppDetails extends Fragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mAppEntry = mState.getEntry(packageName);
|
mAppEntry = mState.getEntry(packageName);
|
||||||
|
return packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean refreshUi() {
|
||||||
|
if (mMoveInProgress) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
final String packageName = retrieveAppEntry();
|
||||||
|
|
||||||
if (mAppEntry == null) {
|
if (mAppEntry == null) {
|
||||||
return false; // onCreate must have failed, make sure to exit
|
return false; // onCreate must have failed, make sure to exit
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user