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

Commit f0d16342 authored by Kweku Adams's avatar Kweku Adams Committed by Android (Google) Code Review
Browse files

Merge "Throw the SecurityException only on V+ builds." into main

parents 4aa3999f 0028af98
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -6,3 +6,10 @@ flag {
    description: "Only relax a prefetch job's connectivity constraint when the device is charging and battery is not low"
    bug: "299329948"
}

flag {
    name: "throw_on_unsupported_bias_usage"
    namespace: "backstage_power"
    description: "Throw an exception if an unsupported app uses JobInfo.setBias"
    bug: "300477393"
}
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -4358,7 +4358,8 @@ public class JobSchedulerService extends com.android.server.SystemService
        private JobInfo enforceBuilderApiPermissions(int uid, int pid, JobInfo job) {
            if (job.getBias() != JobInfo.BIAS_DEFAULT
                        && !hasPermission(uid, pid, Manifest.permission.UPDATE_DEVICE_STATS)) {
                if (CompatChanges.isChangeEnabled(THROW_ON_UNSUPPORTED_BIAS_USAGE, uid)) {
                if (CompatChanges.isChangeEnabled(THROW_ON_UNSUPPORTED_BIAS_USAGE, uid)
                        && Flags.throwOnUnsupportedBiasUsage()) {
                    throw new SecurityException("Apps may not call setBias()");
                } else {
                    // We can't throw the exception. Log the issue and modify the job to remove