Loading src/com/android/settings/applications/RunningState.java +11 −19 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.settings.users.UserUtils; import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.ActivityThread; import android.content.ComponentName; import android.content.Context; import android.content.pm.ApplicationInfo; Loading @@ -29,7 +30,6 @@ import android.content.pm.PackageItemInfo; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; import android.content.pm.UserInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; Loading Loading @@ -449,8 +449,8 @@ public class RunningState { } } boolean updateService(Context userContext, ActivityManager.RunningServiceInfo service) { final PackageManager pm = userContext.getPackageManager(); boolean updateService(Context context, ActivityManager.RunningServiceInfo service) { final PackageManager pm = context.getPackageManager(); boolean changed = false; ServiceItem si = mServices.get(service.service); Loading @@ -459,9 +459,10 @@ public class RunningState { si = new ServiceItem(mUserId); si.mRunningService = service; try { si.mServiceInfo = pm.getServiceInfo(service.service, PackageManager.GET_UNINSTALLED_PACKAGES); } catch (PackageManager.NameNotFoundException e) { si.mServiceInfo = ActivityThread.getPackageManager().getServiceInfo( service.service, PackageManager.GET_UNINSTALLED_PACKAGES, UserHandle.getUserId(service.uid)); } catch (RemoteException e) { } si.mDisplayLabel = makeLabel(pm, si.mRunningService.service.getClassName(), si.mServiceInfo); Loading @@ -484,7 +485,7 @@ public class RunningState { try { Resources clientr = pm.getResourcesForApplication(service.clientPackage); String label = clientr.getString(service.clientLabel); si.mDescription = userContext.getResources().getString( si.mDescription = context.getResources().getString( R.string.service_client_name, label); } catch (PackageManager.NameNotFoundException e) { si.mDescription = null; Loading @@ -494,7 +495,7 @@ public class RunningState { si.mShownAsStarted = true; changed = true; } si.mDescription = userContext.getResources().getString( si.mDescription = context.getResources().getString( R.string.service_started_by_app); } Loading Loading @@ -903,15 +904,6 @@ public class RunningState { for (int i=0; i<NS; i++) { ActivityManager.RunningServiceInfo si = services.get(i); final Context userContext; try { userContext = context.createPackageContextAsUser( "android", 0, new UserHandle(UserHandle.getUserId(si.uid))); } catch (NameNotFoundException e) { // Should always have "android" package throw new RuntimeException(e); } // If this service's process is in use at a higher importance // due to another process bound to one of its services, then we // won't put it in the top-level list of services. Instead we Loading Loading @@ -953,7 +945,7 @@ public class RunningState { ProcessItem proc = procs.get(si.process); if (proc == null) { changed = true; proc = new ProcessItem(userContext, si.uid, si.process); proc = new ProcessItem(context, si.uid, si.process); procs.put(si.process, proc); } Loading @@ -974,7 +966,7 @@ public class RunningState { proc.mDependentProcesses.clear(); proc.mCurSeq = mSequence; } changed |= proc.updateService(userContext, si); changed |= proc.updateService(context, si); } // Now update the map of other processes that are running (but Loading Loading
src/com/android/settings/applications/RunningState.java +11 −19 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.settings.users.UserUtils; import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.ActivityThread; import android.content.ComponentName; import android.content.Context; import android.content.pm.ApplicationInfo; Loading @@ -29,7 +30,6 @@ import android.content.pm.PackageItemInfo; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; import android.content.pm.UserInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Handler; Loading Loading @@ -449,8 +449,8 @@ public class RunningState { } } boolean updateService(Context userContext, ActivityManager.RunningServiceInfo service) { final PackageManager pm = userContext.getPackageManager(); boolean updateService(Context context, ActivityManager.RunningServiceInfo service) { final PackageManager pm = context.getPackageManager(); boolean changed = false; ServiceItem si = mServices.get(service.service); Loading @@ -459,9 +459,10 @@ public class RunningState { si = new ServiceItem(mUserId); si.mRunningService = service; try { si.mServiceInfo = pm.getServiceInfo(service.service, PackageManager.GET_UNINSTALLED_PACKAGES); } catch (PackageManager.NameNotFoundException e) { si.mServiceInfo = ActivityThread.getPackageManager().getServiceInfo( service.service, PackageManager.GET_UNINSTALLED_PACKAGES, UserHandle.getUserId(service.uid)); } catch (RemoteException e) { } si.mDisplayLabel = makeLabel(pm, si.mRunningService.service.getClassName(), si.mServiceInfo); Loading @@ -484,7 +485,7 @@ public class RunningState { try { Resources clientr = pm.getResourcesForApplication(service.clientPackage); String label = clientr.getString(service.clientLabel); si.mDescription = userContext.getResources().getString( si.mDescription = context.getResources().getString( R.string.service_client_name, label); } catch (PackageManager.NameNotFoundException e) { si.mDescription = null; Loading @@ -494,7 +495,7 @@ public class RunningState { si.mShownAsStarted = true; changed = true; } si.mDescription = userContext.getResources().getString( si.mDescription = context.getResources().getString( R.string.service_started_by_app); } Loading Loading @@ -903,15 +904,6 @@ public class RunningState { for (int i=0; i<NS; i++) { ActivityManager.RunningServiceInfo si = services.get(i); final Context userContext; try { userContext = context.createPackageContextAsUser( "android", 0, new UserHandle(UserHandle.getUserId(si.uid))); } catch (NameNotFoundException e) { // Should always have "android" package throw new RuntimeException(e); } // If this service's process is in use at a higher importance // due to another process bound to one of its services, then we // won't put it in the top-level list of services. Instead we Loading Loading @@ -953,7 +945,7 @@ public class RunningState { ProcessItem proc = procs.get(si.process); if (proc == null) { changed = true; proc = new ProcessItem(userContext, si.uid, si.process); proc = new ProcessItem(context, si.uid, si.process); procs.put(si.process, proc); } Loading @@ -974,7 +966,7 @@ public class RunningState { proc.mDependentProcesses.clear(); proc.mCurSeq = mSequence; } changed |= proc.updateService(userContext, si); changed |= proc.updateService(context, si); } // Now update the map of other processes that are running (but Loading