|
44 | 44 | import android.content.pm.PackageManager; |
45 | 45 | import android.content.pm.ResolveInfo; |
46 | 46 | import android.content.pm.ServiceInfo; |
47 | | -import android.content.pm.UserInfo; |
48 | 47 | import android.os.Binder; |
49 | 48 | import android.os.IBinder; |
50 | 49 | import android.os.Message; |
@@ -391,7 +390,7 @@ public void setServiceForegroundLocked(ComponentName className, IBinder token, |
391 | 390 | if (r.isForeground) { |
392 | 391 | r.isForeground = false; |
393 | 392 | if (r.app != null) { |
394 | | - mAm.updateLruProcessLocked(r.app, false, true); |
| 393 | + mAm.updateLruProcessLocked(r.app, false); |
395 | 394 | updateServiceForegroundLocked(r.app, true); |
396 | 395 | } |
397 | 396 | } |
@@ -760,7 +759,8 @@ private ServiceLookupResult retrieveServiceLocked(Intent service, |
760 | 759 | int N = mPendingServices.size(); |
761 | 760 | for (int i=0; i<N; i++) { |
762 | 761 | ServiceRecord pr = mPendingServices.get(i); |
763 | | - if (pr.name.equals(name)) { |
| 762 | + if (pr.serviceInfo.applicationInfo.uid == sInfo.applicationInfo.uid |
| 763 | + && pr.name.equals(name)) { |
764 | 764 | mPendingServices.remove(i); |
765 | 765 | i--; |
766 | 766 | N--; |
@@ -942,7 +942,7 @@ private final boolean scheduleServiceRestartLocked(ServiceRecord r, |
942 | 942 | Slog.w(TAG, "Scheduling restart of crashed service " |
943 | 943 | + r.shortName + " in " + r.restartDelay + "ms"); |
944 | 944 | EventLog.writeEvent(EventLogTags.AM_SCHEDULE_SERVICE_RESTART, |
945 | | - r.shortName, r.restartDelay); |
| 945 | + r.userId, r.shortName, r.restartDelay); |
946 | 946 |
|
947 | 947 | return canceled; |
948 | 948 | } |
@@ -1083,14 +1083,14 @@ private final void realStartServiceLocked(ServiceRecord r, |
1083 | 1083 |
|
1084 | 1084 | app.services.add(r); |
1085 | 1085 | bumpServiceExecutingLocked(r, "create"); |
1086 | | - mAm.updateLruProcessLocked(app, true, true); |
| 1086 | + mAm.updateLruProcessLocked(app, true); |
1087 | 1087 |
|
1088 | 1088 | boolean created = false; |
1089 | 1089 | try { |
1090 | 1090 | mAm.mStringBuilder.setLength(0); |
1091 | 1091 | r.intent.getIntent().toShortString(mAm.mStringBuilder, true, false, true, false); |
1092 | 1092 | EventLog.writeEvent(EventLogTags.AM_CREATE_SERVICE, |
1093 | | - System.identityHashCode(r), r.shortName, |
| 1093 | + r.userId, System.identityHashCode(r), r.shortName, |
1094 | 1094 | mAm.mStringBuilder.toString(), r.app.pid); |
1095 | 1095 | synchronized (r.stats.getBatteryStats()) { |
1096 | 1096 | r.stats.startLaunchedLocked(); |
@@ -1240,7 +1240,7 @@ private final void bringDownServiceLocked(ServiceRecord r, boolean force) { |
1240 | 1240 |
|
1241 | 1241 | if (DEBUG_SERVICE) Slog.v(TAG, "Bringing down " + r + " " + r.intent); |
1242 | 1242 | EventLog.writeEvent(EventLogTags.AM_DESTROY_SERVICE, |
1243 | | - System.identityHashCode(r), r.shortName, |
| 1243 | + r.userId, System.identityHashCode(r), r.shortName, |
1244 | 1244 | (r.app != null) ? r.app.pid : -1); |
1245 | 1245 |
|
1246 | 1246 | mServiceMap.removeServiceByName(r.name, r.userId); |
@@ -1664,7 +1664,7 @@ final void killServicesLocked(ProcessRecord app, |
1664 | 1664 | Slog.w(TAG, "Service crashed " + sr.crashCount |
1665 | 1665 | + " times, stopping: " + sr); |
1666 | 1666 | EventLog.writeEvent(EventLogTags.AM_SERVICE_CRASHED_TOO_MUCH, |
1667 | | - sr.crashCount, sr.shortName, app.pid); |
| 1667 | + sr.userId, sr.crashCount, sr.shortName, app.pid); |
1668 | 1668 | bringDownServiceLocked(sr, true); |
1669 | 1669 | } else if (!allowRestart) { |
1670 | 1670 | bringDownServiceLocked(sr, true); |
|
0 commit comments