Loading core/java/android/app/ActivityThread.java +6 −2 Original line number Diff line number Diff line Loading @@ -849,8 +849,10 @@ public final class ActivityThread extends ClientTransactionHandler @UnsupportedAppUsage Intent intent; boolean rebind; long bindSeq; public String toString() { return "BindServiceData{token=" + token + " intent=" + intent + "}"; return "BindServiceData{token=" + token + " intent=" + intent + " bindSeq=" + bindSeq + "}"; } } Loading Loading @@ -1107,12 +1109,13 @@ public final class ActivityThread extends ClientTransactionHandler } public final void scheduleBindService(IBinder token, Intent intent, boolean rebind, int processState) { boolean rebind, int processState, long bindSeq) { updateProcessState(processState, false); BindServiceData s = new BindServiceData(); s.token = token; s.intent = intent; s.rebind = rebind; s.bindSeq = bindSeq; if (DEBUG_SERVICE) Slog.v(TAG, "scheduleBindService token=" + token + " intent=" + intent + " uid=" Loading @@ -1124,6 +1127,7 @@ public final class ActivityThread extends ClientTransactionHandler BindServiceData s = new BindServiceData(); s.token = token; s.intent = intent; s.bindSeq = -1; sendMessage(H.UNBIND_SERVICE, s); } Loading core/java/android/app/IApplicationThread.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ oneway interface IApplicationThread { void processInBackground(); @UnsupportedAppUsage void scheduleBindService(IBinder token, in Intent intent, boolean rebind, int processState); in Intent intent, boolean rebind, int processState, long bindSeq); @UnsupportedAppUsage void scheduleUnbindService(IBinder token, in Intent intent); Loading services/core/java/com/android/server/am/ActiveServices.java +12 −1 Original line number Diff line number Diff line Loading @@ -336,6 +336,13 @@ public final class ActiveServices { */ final ArrayMap<ForegroundServiceDelegation, ServiceRecord> mFgsDelegations = new ArrayMap<>(); /** * A global counter for generating sequence numbers to uniquely identify bindService requests. * It is purely for logging purposes. */ @GuardedBy("mAm") private long mBindServiceSeqCounter = 0; /** * Whether there is a rate limit that suppresses immediate re-deferral of new FGS * notifications from each app. On by default, disabled only by shell command for Loading Loading @@ -4429,8 +4436,12 @@ public final class ActiveServices { try { bumpServiceExecutingLocked(r, execInFg, "bind", OomAdjuster.OOM_ADJ_REASON_BIND_SERVICE); if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) { Trace.instant(Trace.TRACE_TAG_ACTIVITY_MANAGER, "requestServiceBinding=" + i.intent.getIntent() + ". bindSeq=" + mBindServiceSeqCounter); } r.app.getThread().scheduleBindService(r, i.intent.getIntent(), rebind, r.app.mState.getReportedProcState()); r.app.mState.getReportedProcState(), mBindServiceSeqCounter++); if (!rebind) { i.requested = true; } Loading Loading
core/java/android/app/ActivityThread.java +6 −2 Original line number Diff line number Diff line Loading @@ -849,8 +849,10 @@ public final class ActivityThread extends ClientTransactionHandler @UnsupportedAppUsage Intent intent; boolean rebind; long bindSeq; public String toString() { return "BindServiceData{token=" + token + " intent=" + intent + "}"; return "BindServiceData{token=" + token + " intent=" + intent + " bindSeq=" + bindSeq + "}"; } } Loading Loading @@ -1107,12 +1109,13 @@ public final class ActivityThread extends ClientTransactionHandler } public final void scheduleBindService(IBinder token, Intent intent, boolean rebind, int processState) { boolean rebind, int processState, long bindSeq) { updateProcessState(processState, false); BindServiceData s = new BindServiceData(); s.token = token; s.intent = intent; s.rebind = rebind; s.bindSeq = bindSeq; if (DEBUG_SERVICE) Slog.v(TAG, "scheduleBindService token=" + token + " intent=" + intent + " uid=" Loading @@ -1124,6 +1127,7 @@ public final class ActivityThread extends ClientTransactionHandler BindServiceData s = new BindServiceData(); s.token = token; s.intent = intent; s.bindSeq = -1; sendMessage(H.UNBIND_SERVICE, s); } Loading
core/java/android/app/IApplicationThread.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ oneway interface IApplicationThread { void processInBackground(); @UnsupportedAppUsage void scheduleBindService(IBinder token, in Intent intent, boolean rebind, int processState); in Intent intent, boolean rebind, int processState, long bindSeq); @UnsupportedAppUsage void scheduleUnbindService(IBinder token, in Intent intent); Loading
services/core/java/com/android/server/am/ActiveServices.java +12 −1 Original line number Diff line number Diff line Loading @@ -336,6 +336,13 @@ public final class ActiveServices { */ final ArrayMap<ForegroundServiceDelegation, ServiceRecord> mFgsDelegations = new ArrayMap<>(); /** * A global counter for generating sequence numbers to uniquely identify bindService requests. * It is purely for logging purposes. */ @GuardedBy("mAm") private long mBindServiceSeqCounter = 0; /** * Whether there is a rate limit that suppresses immediate re-deferral of new FGS * notifications from each app. On by default, disabled only by shell command for Loading Loading @@ -4429,8 +4436,12 @@ public final class ActiveServices { try { bumpServiceExecutingLocked(r, execInFg, "bind", OomAdjuster.OOM_ADJ_REASON_BIND_SERVICE); if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) { Trace.instant(Trace.TRACE_TAG_ACTIVITY_MANAGER, "requestServiceBinding=" + i.intent.getIntent() + ". bindSeq=" + mBindServiceSeqCounter); } r.app.getThread().scheduleBindService(r, i.intent.getIntent(), rebind, r.app.mState.getReportedProcState()); r.app.mState.getReportedProcState(), mBindServiceSeqCounter++); if (!rebind) { i.requested = true; } Loading