Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a8982c4 authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

Merge "Temporary tracking of JobStatus unprepare" into oc-dev am: ddd55793

am: 71eaea2c

Change-Id: I4872cb46070d48e355c11044e744378e553e55d2
parents 967e3f26 71eaea2c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -107,6 +107,9 @@ public final class JobStatus {
    private GrantedUriPermissions uriPerms;
    private boolean prepared;

    static final boolean DEBUG_PREPARE = true;
    private Throwable unpreparedPoint = null;

    /**
     * Earliest point in the future at which this job will be eligible to run. A value of 0
     * indicates there is no delay constraint. See {@link #hasTimingDelayConstraint()}.
@@ -410,6 +413,9 @@ public final class JobStatus {
            return;
        }
        prepared = true;
        if (DEBUG_PREPARE) {
            unpreparedPoint = null;
        }
        final ClipData clip = job.getClipData();
        if (clip != null) {
            uriPerms = GrantedUriPermissions.createFromClip(am, clip, sourceUid, sourcePackageName,
@@ -420,9 +426,15 @@ public final class JobStatus {
    public void unprepareLocked(IActivityManager am) {
        if (!prepared) {
            Slog.wtf(TAG, "Hasn't been prepared: " + this);
            if (DEBUG_PREPARE && unpreparedPoint != null) {
                Slog.e(TAG, "Was already unprepared at ", unpreparedPoint);
            }
            return;
        }
        prepared = false;
        if (DEBUG_PREPARE) {
            unpreparedPoint = new Throwable().fillInStackTrace();
        }
        if (uriPerms != null) {
            uriPerms.revoke(am);
            uriPerms = null;