Merge "Log the timed out event for SHORT_SERVICE type FGS." into udc-dev
This commit is contained in:
@@ -88,6 +88,7 @@ import static com.android.internal.messages.nano.SystemMessageProto.SystemMessag
|
|||||||
import static com.android.internal.util.FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__DENIED;
|
import static com.android.internal.util.FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__DENIED;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER;
|
import static com.android.internal.util.FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__EXIT;
|
import static com.android.internal.util.FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__EXIT;
|
||||||
|
import static com.android.internal.util.FrameworkStatsLog.FOREGROUND_SERVICE_STATE_CHANGED__STATE__TIMED_OUT;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED;
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__PACKAGE_STOPPED_STATE__PACKAGE_STATE_NORMAL;
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__PACKAGE_STOPPED_STATE__PACKAGE_STATE_NORMAL;
|
||||||
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__PACKAGE_STOPPED_STATE__PACKAGE_STATE_STOPPED;
|
import static com.android.internal.util.FrameworkStatsLog.SERVICE_REQUEST_EVENT_REPORTED__PACKAGE_STOPPED_STATE__PACKAGE_STATE_STOPPED;
|
||||||
@@ -3240,6 +3241,12 @@ public final class ActiveServices {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Slog.e(TAG_SERVICE, "Short FGS timed out: " + sr);
|
Slog.e(TAG_SERVICE, "Short FGS timed out: " + sr);
|
||||||
|
final long now = SystemClock.uptimeMillis();
|
||||||
|
logFGSStateChangeLocked(sr,
|
||||||
|
FOREGROUND_SERVICE_STATE_CHANGED__STATE__TIMED_OUT,
|
||||||
|
now > sr.mFgsEnterTime ? (int) (now - sr.mFgsEnterTime) : 0,
|
||||||
|
FGS_STOP_REASON_UNKNOWN,
|
||||||
|
FGS_TYPE_POLICY_CHECK_UNKNOWN);
|
||||||
try {
|
try {
|
||||||
sr.app.getThread().scheduleTimeoutService(sr, sr.getShortFgsInfo().getStartId());
|
sr.app.getThread().scheduleTimeoutService(sr, sr.getShortFgsInfo().getStartId());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -7897,7 +7904,8 @@ public final class ActiveServices {
|
|||||||
boolean allowWhileInUsePermissionInFgs;
|
boolean allowWhileInUsePermissionInFgs;
|
||||||
@PowerExemptionManager.ReasonCode int fgsStartReasonCode;
|
@PowerExemptionManager.ReasonCode int fgsStartReasonCode;
|
||||||
if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER
|
if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER
|
||||||
|| state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__EXIT) {
|
|| state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__EXIT
|
||||||
|
|| state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__TIMED_OUT) {
|
||||||
allowWhileInUsePermissionInFgs = r.mAllowWhileInUsePermissionInFgsAtEntering;
|
allowWhileInUsePermissionInFgs = r.mAllowWhileInUsePermissionInFgsAtEntering;
|
||||||
fgsStartReasonCode = r.mAllowStartForegroundAtEntering;
|
fgsStartReasonCode = r.mAllowStartForegroundAtEntering;
|
||||||
} else {
|
} else {
|
||||||
@@ -7931,9 +7939,9 @@ public final class ActiveServices {
|
|||||||
r.mFgsDelegation != null ? r.mFgsDelegation.mOptions.mClientUid : INVALID_UID,
|
r.mFgsDelegation != null ? r.mFgsDelegation.mOptions.mClientUid : INVALID_UID,
|
||||||
r.mFgsDelegation != null ? r.mFgsDelegation.mOptions.mDelegationService
|
r.mFgsDelegation != null ? r.mFgsDelegation.mOptions.mDelegationService
|
||||||
: ForegroundServiceDelegationOptions.DELEGATION_SERVICE_DEFAULT,
|
: ForegroundServiceDelegationOptions.DELEGATION_SERVICE_DEFAULT,
|
||||||
0,
|
0 /* api_sate */,
|
||||||
null,
|
null /* api_type */,
|
||||||
null);
|
null /* api_timestamp */);
|
||||||
|
|
||||||
int event = 0;
|
int event = 0;
|
||||||
if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER) {
|
if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER) {
|
||||||
@@ -7942,7 +7950,9 @@ public final class ActiveServices {
|
|||||||
event = EventLogTags.AM_FOREGROUND_SERVICE_STOP;
|
event = EventLogTags.AM_FOREGROUND_SERVICE_STOP;
|
||||||
} else if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__DENIED) {
|
} else if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__DENIED) {
|
||||||
event = EventLogTags.AM_FOREGROUND_SERVICE_DENIED;
|
event = EventLogTags.AM_FOREGROUND_SERVICE_DENIED;
|
||||||
} else {
|
} else if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__TIMED_OUT) {
|
||||||
|
event = EventLogTags.AM_FOREGROUND_SERVICE_TIMED_OUT;
|
||||||
|
}else {
|
||||||
// Unknown event.
|
// Unknown event.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,10 +121,11 @@ option java_package com.android.server.am
|
|||||||
# Similarly, tags below are used by UserManagerService
|
# Similarly, tags below are used by UserManagerService
|
||||||
30091 um_user_visibility_changed (userId|1|5),(visible|1)
|
30091 um_user_visibility_changed (userId|1|5),(visible|1)
|
||||||
|
|
||||||
# Foreground service start/stop events.
|
# Foreground service start/stop/denied/timed_out events.
|
||||||
30100 am_foreground_service_start (User|1|5),(Component Name|3),(allowWhileInUse|1),(startReasonCode|3),(targetSdk|1|1),(callerTargetSdk|1|1),(notificationWasDeferred|1),(notificationShown|1),(durationMs|1|3),(startForegroundCount|1|1),(stopReason|3),(fgsType|1)
|
30100 am_foreground_service_start (User|1|5),(Component Name|3),(allowWhileInUse|1),(startReasonCode|3),(targetSdk|1|1),(callerTargetSdk|1|1),(notificationWasDeferred|1),(notificationShown|1),(durationMs|1|3),(startForegroundCount|1|1),(stopReason|3),(fgsType|1)
|
||||||
30101 am_foreground_service_denied (User|1|5),(Component Name|3),(allowWhileInUse|1),(startReasonCode|3),(targetSdk|1|1),(callerTargetSdk|1|1),(notificationWasDeferred|1),(notificationShown|1),(durationMs|1|3),(startForegroundCount|1|1),(stopReason|3),(fgsType|1)
|
30101 am_foreground_service_denied (User|1|5),(Component Name|3),(allowWhileInUse|1),(startReasonCode|3),(targetSdk|1|1),(callerTargetSdk|1|1),(notificationWasDeferred|1),(notificationShown|1),(durationMs|1|3),(startForegroundCount|1|1),(stopReason|3),(fgsType|1)
|
||||||
30102 am_foreground_service_stop (User|1|5),(Component Name|3),(allowWhileInUse|1),(startReasonCode|3),(targetSdk|1|1),(callerTargetSdk|1|1),(notificationWasDeferred|1),(notificationShown|1),(durationMs|1|3),(startForegroundCount|1|1),(stopReason|3),(fgsType|1)
|
30102 am_foreground_service_stop (User|1|5),(Component Name|3),(allowWhileInUse|1),(startReasonCode|3),(targetSdk|1|1),(callerTargetSdk|1|1),(notificationWasDeferred|1),(notificationShown|1),(durationMs|1|3),(startForegroundCount|1|1),(stopReason|3),(fgsType|1)
|
||||||
|
30103 am_foreground_service_timed_out (User|1|5),(Component Name|3),(allowWhileInUse|1),(startReasonCode|3),(targetSdk|1|1),(callerTargetSdk|1|1),(notificationWasDeferred|1),(notificationShown|1),(durationMs|1|3),(startForegroundCount|1|1),(stopReason|3),(fgsType|1)
|
||||||
|
|
||||||
# Intent Sender redirect for UserHandle.USER_CURRENT
|
# Intent Sender redirect for UserHandle.USER_CURRENT
|
||||||
30110 am_intent_sender_redirect_user (userId|1|5)
|
30110 am_intent_sender_redirect_user (userId|1|5)
|
||||||
|
|||||||
Reference in New Issue
Block a user