Merge "Update service map when application info is updated" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1147ae1205
@@ -3592,6 +3592,21 @@ public final class ActiveServices {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateServiceApplicationInfoLocked(ApplicationInfo applicationInfo) {
|
||||
final int userId = UserHandle.getUserId(applicationInfo.uid);
|
||||
ServiceMap serviceMap = mServiceMap.get(userId);
|
||||
if (serviceMap != null) {
|
||||
ArrayMap<ComponentName, ServiceRecord> servicesByName = serviceMap.mServicesByName;
|
||||
for (int j = servicesByName.size() - 1; j >= 0; j--) {
|
||||
ServiceRecord serviceRecord = servicesByName.valueAt(j);
|
||||
if (applicationInfo.packageName.equals(serviceRecord.appInfo.packageName)) {
|
||||
serviceRecord.appInfo = applicationInfo;
|
||||
serviceRecord.serviceInfo.applicationInfo = applicationInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void serviceForegroundCrash(ProcessRecord app, CharSequence serviceRecord) {
|
||||
mAm.crashApplication(app.uid, app.pid, app.info.packageName, app.userId,
|
||||
"Context.startForegroundService() did not then call Service.startForeground(): "
|
||||
|
||||
@@ -21455,6 +21455,7 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
return ActivityManager.BROADCAST_SUCCESS;
|
||||
}
|
||||
mStackSupervisor.updateActivityApplicationInfoLocked(aInfo);
|
||||
mServices.updateServiceApplicationInfoLocked(aInfo);
|
||||
sendPackageBroadcastLocked(ApplicationThreadConstants.PACKAGE_REPLACED,
|
||||
new String[] {ssp}, userId);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ final class ServiceRecord extends Binder implements ComponentName.WithComponentN
|
||||
// original intent used to find service.
|
||||
final ServiceInfo serviceInfo;
|
||||
// all information about the service.
|
||||
final ApplicationInfo appInfo;
|
||||
ApplicationInfo appInfo;
|
||||
// information about service's app.
|
||||
final int userId; // user that this service is running as
|
||||
final String packageName; // the package implementing intent's component
|
||||
|
||||
Reference in New Issue
Block a user