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

Commit 2e8b3e21 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove redundant/deprecated method."

parents 4a43fdc8 13289704
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -77,11 +77,11 @@ public class JobParameters implements Parcelable {

    /**
     * @hide
     * @deprecated use {@link #getReasonCodeDescription(int)}
     */
    @Deprecated
    public static String getReasonName(int reason) {
        switch (reason) {
    // TODO(142420609): make it @SystemApi for mainline
    @NonNull
    public static String getReasonCodeDescription(int reasonCode) {
        switch (reasonCode) {
            case REASON_CANCELED: return "canceled";
            case REASON_CONSTRAINTS_NOT_SATISFIED: return "constraints";
            case REASON_PREEMPT: return "preempt";
@@ -89,7 +89,7 @@ public class JobParameters implements Parcelable {
            case REASON_DEVICE_IDLE: return "device_idle";
            case REASON_DEVICE_THERMAL: return "thermal";
            case REASON_RESTRAINED: return "restrained";
            default: return "unknown:" + reason;
            default: return "unknown:" + reasonCode;
        }
    }

@@ -100,13 +100,6 @@ public class JobParameters implements Parcelable {
        return JOB_STOP_REASON_CODES;
    }

    /** @hide */
    // @SystemApi TODO make it a system api for mainline
    @NonNull
    public static String getReasonCodeDescription(int reasonCode) {
        return getReasonName(reasonCode);
    }

    @UnsupportedAppUsage
    private final int jobId;
    private final PersistableBundle extras;
+5 −3
Original line number Diff line number Diff line
@@ -359,7 +359,8 @@ public final class JobPackageTracker {
                            }
                            pw.print(pe.stopReasons.valueAt(k));
                            pw.print("x ");
                            pw.print(JobParameters.getReasonName(pe.stopReasons.keyAt(k)));
                            pw.print(JobParameters
                                    .getReasonCodeDescription(pe.stopReasons.keyAt(k)));
                        }
                        pw.println();
                    }
@@ -606,7 +607,8 @@ public final class JobPackageTracker {
                if (reason != null) {
                    pw.print(mEventReasons[index]);
                } else {
                    pw.print(JobParameters.getReasonName((mEventCmds[index] & EVENT_STOP_REASON_MASK)
                    pw.print(JobParameters.getReasonCodeDescription(
                            (mEventCmds[index] & EVENT_STOP_REASON_MASK)
                                    >> EVENT_STOP_REASON_SHIFT));
                }
            }
+2 −2
Original line number Diff line number Diff line
@@ -1963,7 +1963,7 @@ public class JobSchedulerService extends com.android.server.SystemService
                if (restriction != null) {
                    final int reason = restriction.getReason();
                    serviceContext.cancelExecutingJobLocked(reason,
                            "restricted due to " + JobParameters.getReasonName(reason));
                            "restricted due to " + JobParameters.getReasonCodeDescription(reason));
                }
            }
        }
@@ -3110,7 +3110,7 @@ public class JobSchedulerService extends com.android.server.SystemService
                            final JobRestriction restriction = mJobRestrictions.get(i);
                            if (restriction.isJobRestricted(job)) {
                                final int reason = restriction.getReason();
                                pw.write(" " + JobParameters.getReasonName(reason) + "[" + reason + "]");
                                pw.print(" " + JobParameters.getReasonCodeDescription(reason));
                            }
                        }
                    } else {