Loading src/com/android/settings/applications/AppInfoBase.java +0 −18 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment protected boolean mAppControlRestricted = false; protected ApplicationsState mState; private ApplicationsState.Session mSession; protected ApplicationsState.AppEntry mAppEntry; protected PackageInfo mPackageInfo; protected int mUserId; Loading @@ -76,7 +75,6 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment mFinishing = false; mState = ApplicationsState.getInstance(getActivity().getApplication()); mSession = mState.newSession(this); Context context = getActivity(); mDpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE); Loading @@ -84,9 +82,6 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment IBinder b = ServiceManager.getService(Context.USB_SERVICE); mUsbManager = IUsbManager.Stub.asInterface(b); // Need to make sure we have loaded applications at this point. mSession.resume(); retrieveAppEntry(); } Loading @@ -94,25 +89,12 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment public void onResume() { super.onResume(); mAppControlRestricted = mUserManager.hasUserRestriction(UserManager.DISALLOW_APPS_CONTROL); mSession.resume(); if (!refreshUi()) { setIntentAndFinish(true, true); } } @Override public void onPause() { super.onPause(); mSession.pause(); } @Override public void onDestroyView() { super.onDestroyView(); mSession.release(); } protected String retrieveAppEntry() { final Bundle args = getArguments(); mPackageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null; Loading src/com/android/settings/applications/ApplicationsState.java +21 −8 Original line number Diff line number Diff line Loading @@ -878,20 +878,33 @@ public class ApplicationsState { synchronized (mEntriesMap) { AppEntry entry = mEntriesMap.get(userId).get(packageName); if (entry == null) { for (int i=0; i<mApplications.size(); i++) { ApplicationInfo info = mApplications.get(i); if (packageName.equals(info.packageName) && userId == UserHandle.getUserId(info.uid)) { entry = getEntryLocked(info); break; ApplicationInfo info = getAppInfoLocked(packageName, userId); if (info == null) { try { info = mIpm.getApplicationInfo(packageName, 0, userId); } catch (RemoteException e) { Log.w(TAG, "getEntry couldn't reach PackageManager", e); return null; } } entry = getEntryLocked(info); } if (DEBUG_LOCKING) Log.v(TAG, "...getEntry releasing lock"); return entry; } } private ApplicationInfo getAppInfoLocked(String pkg, int userId) { for (int i = 0; i < mApplications.size(); i++) { ApplicationInfo info = mApplications.get(i); if (pkg.equals(info.packageName) && userId == UserHandle.getUserId(info.uid)) { return info; } } return null; } void ensureIcon(AppEntry entry) { if (entry.icon != null) { return; Loading Loading @@ -1153,8 +1166,8 @@ public class ApplicationsState { mMainHandler.sendMessage(msg); } } if (mCurComputingSizePkg == null || (mCurComputingSizePkg.equals(stats.packageName) if (mCurComputingSizePkg != null && (mCurComputingSizePkg.equals(stats.packageName) && mCurComputingSizeUserId == stats.userHandle)) { mCurComputingSizePkg = null; sendEmptyMessage(MSG_LOAD_SIZES); Loading src/com/android/settings/applications/InstalledAppDetails.java +1 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,7 @@ public class InstalledAppDetails extends AppInfoBase if (mFinishing) { return; } mState.requestSize(mPackageName, mUserId); AppItem app = new AppItem(mAppEntry.info.uid); app.addUid(mAppEntry.info.uid); if (mStatsSession != null) { Loading Loading
src/com/android/settings/applications/AppInfoBase.java +0 −18 Original line number Diff line number Diff line Loading @@ -54,7 +54,6 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment protected boolean mAppControlRestricted = false; protected ApplicationsState mState; private ApplicationsState.Session mSession; protected ApplicationsState.AppEntry mAppEntry; protected PackageInfo mPackageInfo; protected int mUserId; Loading @@ -76,7 +75,6 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment mFinishing = false; mState = ApplicationsState.getInstance(getActivity().getApplication()); mSession = mState.newSession(this); Context context = getActivity(); mDpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE); Loading @@ -84,9 +82,6 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment IBinder b = ServiceManager.getService(Context.USB_SERVICE); mUsbManager = IUsbManager.Stub.asInterface(b); // Need to make sure we have loaded applications at this point. mSession.resume(); retrieveAppEntry(); } Loading @@ -94,25 +89,12 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment public void onResume() { super.onResume(); mAppControlRestricted = mUserManager.hasUserRestriction(UserManager.DISALLOW_APPS_CONTROL); mSession.resume(); if (!refreshUi()) { setIntentAndFinish(true, true); } } @Override public void onPause() { super.onPause(); mSession.pause(); } @Override public void onDestroyView() { super.onDestroyView(); mSession.release(); } protected String retrieveAppEntry() { final Bundle args = getArguments(); mPackageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null; Loading
src/com/android/settings/applications/ApplicationsState.java +21 −8 Original line number Diff line number Diff line Loading @@ -878,20 +878,33 @@ public class ApplicationsState { synchronized (mEntriesMap) { AppEntry entry = mEntriesMap.get(userId).get(packageName); if (entry == null) { for (int i=0; i<mApplications.size(); i++) { ApplicationInfo info = mApplications.get(i); if (packageName.equals(info.packageName) && userId == UserHandle.getUserId(info.uid)) { entry = getEntryLocked(info); break; ApplicationInfo info = getAppInfoLocked(packageName, userId); if (info == null) { try { info = mIpm.getApplicationInfo(packageName, 0, userId); } catch (RemoteException e) { Log.w(TAG, "getEntry couldn't reach PackageManager", e); return null; } } entry = getEntryLocked(info); } if (DEBUG_LOCKING) Log.v(TAG, "...getEntry releasing lock"); return entry; } } private ApplicationInfo getAppInfoLocked(String pkg, int userId) { for (int i = 0; i < mApplications.size(); i++) { ApplicationInfo info = mApplications.get(i); if (pkg.equals(info.packageName) && userId == UserHandle.getUserId(info.uid)) { return info; } } return null; } void ensureIcon(AppEntry entry) { if (entry.icon != null) { return; Loading Loading @@ -1153,8 +1166,8 @@ public class ApplicationsState { mMainHandler.sendMessage(msg); } } if (mCurComputingSizePkg == null || (mCurComputingSizePkg.equals(stats.packageName) if (mCurComputingSizePkg != null && (mCurComputingSizePkg.equals(stats.packageName) && mCurComputingSizeUserId == stats.userHandle)) { mCurComputingSizePkg = null; sendEmptyMessage(MSG_LOAD_SIZES); Loading
src/com/android/settings/applications/InstalledAppDetails.java +1 −0 Original line number Diff line number Diff line Loading @@ -251,6 +251,7 @@ public class InstalledAppDetails extends AppInfoBase if (mFinishing) { return; } mState.requestSize(mPackageName, mUserId); AppItem app = new AppItem(mAppEntry.info.uid); app.addUid(mAppEntry.info.uid); if (mStatsSession != null) { Loading