Log cold/warm process starts per action type in statsd
Also log the foreground service type. Bug: 234527537 Test: statsd_testdrive 475 Test: statsd_testdrive 476 Test: statsd_testdrive 477 Change-Id: I6267d2cfdb3f17e79276b9a853b6d4c142b887b0 Merged-In: I6267d2cfdb3f17e79276b9a853b6d4c142b887b0
This commit is contained in:
@@ -63,6 +63,12 @@ import static android.os.Process.SYSTEM_UID;
|
|||||||
import static android.os.Process.ZYGOTE_POLICY_FLAG_EMPTY;
|
import static android.os.Process.ZYGOTE_POLICY_FLAG_EMPTY;
|
||||||
|
|
||||||
import static com.android.internal.messages.nano.SystemMessageProto.SystemMessage.NOTE_FOREGROUND_SERVICE_BG_LAUNCH;
|
import static com.android.internal.messages.nano.SystemMessageProto.SystemMessage.NOTE_FOREGROUND_SERVICE_BG_LAUNCH;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_COLD;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_HOT;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__REQUEST_TYPE__BIND;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__REQUEST_TYPE__START;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BACKGROUND_CHECK;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BACKGROUND_CHECK;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_FOREGROUND_SERVICE;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_FOREGROUND_SERVICE;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_MU;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_MU;
|
||||||
@@ -522,8 +528,9 @@ public final class ActiveServices {
|
|||||||
+ " delayedStop=" + r.delayedStop);
|
+ " delayedStop=" + r.delayedStop);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
startServiceInnerLocked(this, r.pendingStarts.get(0).intent, r, false,
|
final ServiceRecord.StartItem si = r.pendingStarts.get(0);
|
||||||
true);
|
startServiceInnerLocked(this, si.intent, r, false, true, si.callingId,
|
||||||
|
r.startRequested);
|
||||||
} catch (TransactionTooLargeException e) {
|
} catch (TransactionTooLargeException e) {
|
||||||
// Ignore, nobody upstack cares.
|
// Ignore, nobody upstack cares.
|
||||||
}
|
}
|
||||||
@@ -865,6 +872,7 @@ public final class ActiveServices {
|
|||||||
if (unscheduleServiceRestartLocked(r, callingUid, false)) {
|
if (unscheduleServiceRestartLocked(r, callingUid, false)) {
|
||||||
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "START SERVICE WHILE RESTART PENDING: " + r);
|
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "START SERVICE WHILE RESTART PENDING: " + r);
|
||||||
}
|
}
|
||||||
|
final boolean wasStartRequested = r.startRequested;
|
||||||
r.lastActivity = SystemClock.uptimeMillis();
|
r.lastActivity = SystemClock.uptimeMillis();
|
||||||
r.startRequested = true;
|
r.startRequested = true;
|
||||||
r.delayedStop = false;
|
r.delayedStop = false;
|
||||||
@@ -954,7 +962,8 @@ public final class ActiveServices {
|
|||||||
if (allowBackgroundActivityStarts) {
|
if (allowBackgroundActivityStarts) {
|
||||||
r.allowBgActivityStartsOnServiceStart(backgroundActivityStartsToken);
|
r.allowBgActivityStartsOnServiceStart(backgroundActivityStartsToken);
|
||||||
}
|
}
|
||||||
ComponentName cmp = startServiceInnerLocked(smap, service, r, callerFg, addToStarting);
|
ComponentName cmp = startServiceInnerLocked(smap, service, r, callerFg, addToStarting,
|
||||||
|
callingUid, wasStartRequested);
|
||||||
return cmp;
|
return cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1150,7 +1159,8 @@ public final class ActiveServices {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ComponentName startServiceInnerLocked(ServiceMap smap, Intent service, ServiceRecord r,
|
ComponentName startServiceInnerLocked(ServiceMap smap, Intent service, ServiceRecord r,
|
||||||
boolean callerFg, boolean addToStarting) throws TransactionTooLargeException {
|
boolean callerFg, boolean addToStarting, int callingUid, boolean wasStartRequested)
|
||||||
|
throws TransactionTooLargeException {
|
||||||
synchronized (mAm.mProcessStats.mLock) {
|
synchronized (mAm.mProcessStats.mLock) {
|
||||||
final ServiceState stracker = r.getTracker();
|
final ServiceState stracker = r.getTracker();
|
||||||
if (stracker != null) {
|
if (stracker != null) {
|
||||||
@@ -1177,6 +1187,15 @@ public final class ActiveServices {
|
|||||||
return new ComponentName("!!", error);
|
return new ComponentName("!!", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FrameworkStatsLog.write(SERVICE_REQUEST_EVENT_REPORTED, uid, callingUid,
|
||||||
|
ActivityManagerService.getShortAction(service.getAction()),
|
||||||
|
SERVICE_REQUEST_EVENT_REPORTED__REQUEST_TYPE__START, false,
|
||||||
|
r.app == null || r.app.getThread() == null
|
||||||
|
? SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_COLD
|
||||||
|
: (wasStartRequested || !r.getConnections().isEmpty()
|
||||||
|
? SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_HOT
|
||||||
|
: SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM));
|
||||||
|
|
||||||
if (r.startRequested && addToStarting) {
|
if (r.startRequested && addToStarting) {
|
||||||
boolean first = smap.mStartingBackground.size() == 0;
|
boolean first = smap.mStartingBackground.size() == 0;
|
||||||
smap.mStartingBackground.add(r);
|
smap.mStartingBackground.add(r);
|
||||||
@@ -2876,6 +2895,8 @@ public final class ActiveServices {
|
|||||||
mAm.requireAllowedAssociationsLocked(s.appInfo.packageName);
|
mAm.requireAllowedAssociationsLocked(s.appInfo.packageName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final boolean wasStartRequested = s.startRequested;
|
||||||
|
final boolean hadConnections = !s.getConnections().isEmpty();
|
||||||
mAm.startAssociationLocked(callerApp.uid, callerApp.processName,
|
mAm.startAssociationLocked(callerApp.uid, callerApp.processName,
|
||||||
callerApp.mState.getCurProcState(), s.appInfo.uid, s.appInfo.longVersionCode,
|
callerApp.mState.getCurProcState(), s.appInfo.uid, s.appInfo.longVersionCode,
|
||||||
s.instanceName, s.processName);
|
s.instanceName, s.processName);
|
||||||
@@ -2962,6 +2983,15 @@ public final class ActiveServices {
|
|||||||
mAm.updateOomAdjPendingTargetsLocked(OomAdjuster.OOM_ADJ_REASON_BIND_SERVICE);
|
mAm.updateOomAdjPendingTargetsLocked(OomAdjuster.OOM_ADJ_REASON_BIND_SERVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FrameworkStatsLog.write(SERVICE_REQUEST_EVENT_REPORTED, s.appInfo.uid, callingUid,
|
||||||
|
ActivityManagerService.getShortAction(service.getAction()),
|
||||||
|
SERVICE_REQUEST_EVENT_REPORTED__REQUEST_TYPE__BIND, false,
|
||||||
|
s.app == null || s.app.getThread() == null
|
||||||
|
? SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_COLD
|
||||||
|
: (wasStartRequested || hadConnections
|
||||||
|
? SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_HOT
|
||||||
|
: SERVICE_REQUEST_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM));
|
||||||
|
|
||||||
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "Bind " + s + " with " + b
|
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "Bind " + s + " with " + b
|
||||||
+ ": received=" + b.intent.received
|
+ ": received=" + b.intent.received
|
||||||
+ " apps=" + b.intent.apps.size()
|
+ " apps=" + b.intent.apps.size()
|
||||||
@@ -6917,7 +6947,8 @@ public final class ActiveServices {
|
|||||||
durationMs,
|
durationMs,
|
||||||
r.mStartForegroundCount,
|
r.mStartForegroundCount,
|
||||||
ActivityManagerUtils.hashComponentNameForAtom(r.shortInstanceName),
|
ActivityManagerUtils.hashComponentNameForAtom(r.shortInstanceName),
|
||||||
r.mFgsHasNotificationPermission);
|
r.mFgsHasNotificationPermission,
|
||||||
|
r.foregroundServiceType);
|
||||||
|
|
||||||
int event = 0;
|
int event = 0;
|
||||||
if (state == FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER) {
|
if (state == FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER) {
|
||||||
|
|||||||
@@ -4993,15 +4993,7 @@ public class ActivityManagerService extends IActivityManager.Stub
|
|||||||
|
|
||||||
|
|
||||||
final HostingRecord hostingRecord = app.getHostingRecord();
|
final HostingRecord hostingRecord = app.getHostingRecord();
|
||||||
final String action = hostingRecord.getAction();
|
String shortAction = getShortAction(hostingRecord.getAction());
|
||||||
String shortAction = action;
|
|
||||||
if (action != null) {
|
|
||||||
// only log the last part of the action string to save stats data.
|
|
||||||
int index = action.lastIndexOf(".");
|
|
||||||
if (index != -1 && index != action.length() - 1) {
|
|
||||||
shortAction = action.substring(index + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FrameworkStatsLog.write(
|
FrameworkStatsLog.write(
|
||||||
FrameworkStatsLog.PROCESS_START_TIME,
|
FrameworkStatsLog.PROCESS_START_TIME,
|
||||||
app.info.uid,
|
app.info.uid,
|
||||||
@@ -5032,6 +5024,20 @@ public class ActivityManagerService extends IActivityManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The last part of the string of an intent's action.
|
||||||
|
*/
|
||||||
|
static @Nullable String getShortAction(@Nullable String action) {
|
||||||
|
String shortAction = action;
|
||||||
|
if (action != null) {
|
||||||
|
int index = action.lastIndexOf('.');
|
||||||
|
if (index != -1 && index != action.length() - 1) {
|
||||||
|
shortAction = action.substring(index + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return shortAction;
|
||||||
|
}
|
||||||
|
|
||||||
void checkTime(long startTime, String where) {
|
void checkTime(long startTime, String where) {
|
||||||
long now = SystemClock.uptimeMillis();
|
long now = SystemClock.uptimeMillis();
|
||||||
if ((now - startTime) > 50) {
|
if ((now - startTime) > 50) {
|
||||||
@@ -14252,7 +14258,7 @@ public class ActivityManagerService extends IActivityManager.Stub
|
|||||||
oldQueue.performReceiveLocked(oldRecord.callerApp, oldRecord.resultTo,
|
oldQueue.performReceiveLocked(oldRecord.callerApp, oldRecord.resultTo,
|
||||||
oldRecord.intent,
|
oldRecord.intent,
|
||||||
Activity.RESULT_CANCELED, null, null,
|
Activity.RESULT_CANCELED, null, null,
|
||||||
false, false, oldRecord.userId);
|
false, false, oldRecord.userId, oldRecord.callingUid, callingUid);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.w(TAG, "Failure ["
|
Slog.w(TAG, "Failure ["
|
||||||
+ queue.mQueueName + "] sending broadcast result of "
|
+ queue.mQueueName + "] sending broadcast result of "
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ import static android.text.TextUtils.formatSimple;
|
|||||||
import static com.android.internal.util.FrameworkStatsLog.BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED;
|
import static com.android.internal.util.FrameworkStatsLog.BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED__EVENT__BOOT_COMPLETED;
|
import static com.android.internal.util.FrameworkStatsLog.BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED__EVENT__BOOT_COMPLETED;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED__EVENT__LOCKED_BOOT_COMPLETED;
|
import static com.android.internal.util.FrameworkStatsLog.BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED__EVENT__LOCKED_BOOT_COMPLETED;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.BROADCAST_DELIVERY_EVENT_REPORTED;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.BROADCAST_DELIVERY_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_COLD;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.BROADCAST_DELIVERY_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.BROADCAST_DELIVERY_EVENT_REPORTED__RECEIVER_TYPE__MANIFEST;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.BROADCAST_DELIVERY_EVENT_REPORTED__RECEIVER_TYPE__RUNTIME;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BROADCAST;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BROADCAST;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BROADCAST_DEFERRAL;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BROADCAST_DEFERRAL;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BROADCAST_LIGHT;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_BROADCAST_LIGHT;
|
||||||
@@ -316,7 +321,7 @@ public final class BroadcastQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final void processCurBroadcastLocked(BroadcastRecord r,
|
private final void processCurBroadcastLocked(BroadcastRecord r,
|
||||||
ProcessRecord app) throws RemoteException {
|
ProcessRecord app, int receiverType, int processTemperature) throws RemoteException {
|
||||||
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
|
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
|
||||||
"Process cur broadcast " + r + " for app " + app);
|
"Process cur broadcast " + r + " for app " + app);
|
||||||
final IApplicationThread thread = app.getThread();
|
final IApplicationThread thread = app.getThread();
|
||||||
@@ -362,6 +367,10 @@ public final class BroadcastQueue {
|
|||||||
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
|
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
|
||||||
"Process cur broadcast " + r + " DELIVERED for app " + app);
|
"Process cur broadcast " + r + " DELIVERED for app " + app);
|
||||||
started = true;
|
started = true;
|
||||||
|
FrameworkStatsLog.write(BROADCAST_DELIVERY_EVENT_REPORTED, app.uid,
|
||||||
|
r.callingUid == -1 ? Process.SYSTEM_UID : r.callingUid,
|
||||||
|
ActivityManagerService.getShortAction(r.intent.getAction()),
|
||||||
|
receiverType, processTemperature);
|
||||||
} finally {
|
} finally {
|
||||||
if (!started) {
|
if (!started) {
|
||||||
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
|
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
|
||||||
@@ -398,7 +407,9 @@ public final class BroadcastQueue {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
mPendingBroadcast = null;
|
mPendingBroadcast = null;
|
||||||
processCurBroadcastLocked(br, app);
|
processCurBroadcastLocked(br, app,
|
||||||
|
BROADCAST_DELIVERY_EVENT_REPORTED__RECEIVER_TYPE__MANIFEST,
|
||||||
|
BROADCAST_DELIVERY_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_COLD);
|
||||||
didSomething = true;
|
didSomething = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Slog.w(TAG, "Exception in new application when starting receiver "
|
Slog.w(TAG, "Exception in new application when starting receiver "
|
||||||
@@ -628,8 +639,8 @@ public final class BroadcastQueue {
|
|||||||
|
|
||||||
void performReceiveLocked(ProcessRecord app, IIntentReceiver receiver,
|
void performReceiveLocked(ProcessRecord app, IIntentReceiver receiver,
|
||||||
Intent intent, int resultCode, String data, Bundle extras,
|
Intent intent, int resultCode, String data, Bundle extras,
|
||||||
boolean ordered, boolean sticky, int sendingUser)
|
boolean ordered, boolean sticky, int sendingUser,
|
||||||
throws RemoteException {
|
int receiverUid, int callingUid) throws RemoteException {
|
||||||
// Send the intent to the receiver asynchronously using one-way binder calls.
|
// Send the intent to the receiver asynchronously using one-way binder calls.
|
||||||
if (app != null) {
|
if (app != null) {
|
||||||
final IApplicationThread thread = app.getThread();
|
final IApplicationThread thread = app.getThread();
|
||||||
@@ -663,6 +674,12 @@ public final class BroadcastQueue {
|
|||||||
receiver.performReceive(intent, resultCode, data, extras, ordered,
|
receiver.performReceive(intent, resultCode, data, extras, ordered,
|
||||||
sticky, sendingUser);
|
sticky, sendingUser);
|
||||||
}
|
}
|
||||||
|
FrameworkStatsLog.write(BROADCAST_DELIVERY_EVENT_REPORTED,
|
||||||
|
receiverUid == -1 ? Process.SYSTEM_UID : receiverUid,
|
||||||
|
callingUid == -1 ? Process.SYSTEM_UID : callingUid,
|
||||||
|
ActivityManagerService.getShortAction(intent.getAction()),
|
||||||
|
BROADCAST_DELIVERY_EVENT_REPORTED__RECEIVER_TYPE__RUNTIME,
|
||||||
|
BROADCAST_DELIVERY_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deliverToRegisteredReceiverLocked(BroadcastRecord r,
|
private void deliverToRegisteredReceiverLocked(BroadcastRecord r,
|
||||||
@@ -965,7 +982,8 @@ public final class BroadcastQueue {
|
|||||||
maybeReportBroadcastDispatchedEventLocked(r, filter.owningUid);
|
maybeReportBroadcastDispatchedEventLocked(r, filter.owningUid);
|
||||||
performReceiveLocked(filter.receiverList.app, filter.receiverList.receiver,
|
performReceiveLocked(filter.receiverList.app, filter.receiverList.receiver,
|
||||||
new Intent(r.intent), r.resultCode, r.resultData,
|
new Intent(r.intent), r.resultCode, r.resultData,
|
||||||
r.resultExtras, r.ordered, r.initialSticky, r.userId);
|
r.resultExtras, r.ordered, r.initialSticky, r.userId,
|
||||||
|
filter.receiverList.uid, r.callingUid);
|
||||||
// parallel broadcasts are fire-and-forget, not bookended by a call to
|
// parallel broadcasts are fire-and-forget, not bookended by a call to
|
||||||
// finishReceiverLocked(), so we manage their activity-start token here
|
// finishReceiverLocked(), so we manage their activity-start token here
|
||||||
if (filter.receiverList.app != null
|
if (filter.receiverList.app != null
|
||||||
@@ -1317,7 +1335,8 @@ public final class BroadcastQueue {
|
|||||||
}
|
}
|
||||||
performReceiveLocked(r.callerApp, r.resultTo,
|
performReceiveLocked(r.callerApp, r.resultTo,
|
||||||
new Intent(r.intent), r.resultCode,
|
new Intent(r.intent), r.resultCode,
|
||||||
r.resultData, r.resultExtras, false, false, r.userId);
|
r.resultData, r.resultExtras, false, false, r.userId,
|
||||||
|
r.callingUid, r.callingUid);
|
||||||
logBootCompletedBroadcastCompletionLatencyIfPossible(r);
|
logBootCompletedBroadcastCompletionLatencyIfPossible(r);
|
||||||
// Set this to null so that the reference
|
// Set this to null so that the reference
|
||||||
// (local and remote) isn't kept in the mBroadcastHistory.
|
// (local and remote) isn't kept in the mBroadcastHistory.
|
||||||
@@ -1837,7 +1856,9 @@ public final class BroadcastQueue {
|
|||||||
app.addPackage(info.activityInfo.packageName,
|
app.addPackage(info.activityInfo.packageName,
|
||||||
info.activityInfo.applicationInfo.longVersionCode, mService.mProcessStats);
|
info.activityInfo.applicationInfo.longVersionCode, mService.mProcessStats);
|
||||||
maybeAddAllowBackgroundActivityStartsToken(app, r);
|
maybeAddAllowBackgroundActivityStartsToken(app, r);
|
||||||
processCurBroadcastLocked(r, app);
|
processCurBroadcastLocked(r, app,
|
||||||
|
BROADCAST_DELIVERY_EVENT_REPORTED__RECEIVER_TYPE__MANIFEST,
|
||||||
|
BROADCAST_DELIVERY_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM);
|
||||||
return;
|
return;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.w(TAG, "Exception when sending broadcast to "
|
Slog.w(TAG, "Exception when sending broadcast to "
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ import static android.os.Process.PROC_PARENS;
|
|||||||
import static android.os.Process.PROC_SPACE_TERM;
|
import static android.os.Process.PROC_SPACE_TERM;
|
||||||
import static android.os.Process.SYSTEM_UID;
|
import static android.os.Process.SYSTEM_UID;
|
||||||
|
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.PROVIDER_ACQUISITION_EVENT_REPORTED;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.PROVIDER_ACQUISITION_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_COLD;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.PROVIDER_ACQUISITION_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM;
|
||||||
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_MU;
|
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_MU;
|
||||||
import static com.android.server.am.ActivityManagerService.TAG_MU;
|
import static com.android.server.am.ActivityManagerService.TAG_MU;
|
||||||
import static com.android.server.am.ProcessProfileRecord.HOSTING_COMPONENT_TYPE_PROVIDER;
|
import static com.android.server.am.ProcessProfileRecord.HOSTING_COMPONENT_TYPE_PROVIDER;
|
||||||
@@ -73,6 +76,7 @@ import android.util.SparseArray;
|
|||||||
import com.android.internal.annotations.GuardedBy;
|
import com.android.internal.annotations.GuardedBy;
|
||||||
import com.android.internal.os.BackgroundThread;
|
import com.android.internal.os.BackgroundThread;
|
||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
|
import com.android.internal.util.FrameworkStatsLog;
|
||||||
import com.android.server.LocalServices;
|
import com.android.server.LocalServices;
|
||||||
import com.android.server.RescueParty;
|
import com.android.server.RescueParty;
|
||||||
import com.android.server.pm.UserManagerInternal;
|
import com.android.server.pm.UserManagerInternal;
|
||||||
@@ -241,6 +245,10 @@ public class ContentProviderHelper {
|
|||||||
ContentProviderHolder holder = cpr.newHolder(null, true);
|
ContentProviderHolder holder = cpr.newHolder(null, true);
|
||||||
// don't give caller the provider object, it needs to make its own.
|
// don't give caller the provider object, it needs to make its own.
|
||||||
holder.provider = null;
|
holder.provider = null;
|
||||||
|
FrameworkStatsLog.write(
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED,
|
||||||
|
r.uid, callingUid,
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM);
|
||||||
return holder;
|
return holder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +315,10 @@ public class ContentProviderHelper {
|
|||||||
dyingProc = cpr.proc;
|
dyingProc = cpr.proc;
|
||||||
} else {
|
} else {
|
||||||
cpr.proc.mState.setVerifiedAdj(cpr.proc.mState.getSetAdj());
|
cpr.proc.mState.setVerifiedAdj(cpr.proc.mState.getSetAdj());
|
||||||
|
FrameworkStatsLog.write(
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED,
|
||||||
|
cpr.proc.uid, callingUid,
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(origId);
|
Binder.restoreCallingIdentity(origId);
|
||||||
@@ -479,6 +491,10 @@ public class ContentProviderHelper {
|
|||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FrameworkStatsLog.write(
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED,
|
||||||
|
proc.uid, callingUid,
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_WARM);
|
||||||
} else {
|
} else {
|
||||||
checkTime(startTime, "getContentProviderImpl: before start process");
|
checkTime(startTime, "getContentProviderImpl: before start process");
|
||||||
proc = mService.startProcessLocked(
|
proc = mService.startProcessLocked(
|
||||||
@@ -495,6 +511,10 @@ public class ContentProviderHelper {
|
|||||||
+ ": process is bad");
|
+ ": process is bad");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
FrameworkStatsLog.write(
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED,
|
||||||
|
proc.uid, callingUid,
|
||||||
|
PROVIDER_ACQUISITION_EVENT_REPORTED__PROC_START_TYPE__PROCESS_START_TYPE_COLD);
|
||||||
}
|
}
|
||||||
cpr.launchingApp = proc;
|
cpr.launchingApp = proc;
|
||||||
mLaunchingProviders.add(cpr);
|
mLaunchingProviders.add(cpr);
|
||||||
|
|||||||
Reference in New Issue
Block a user