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

Commit 317f4f59 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11426397 from 8e3ca63b to 24Q2-release

Change-Id: I12ee8131be535f96094d356057ce0ba7f55cde1e
parents 4e49cb4b 8e3ca63b
Loading
Loading
Loading
Loading
+47 −53
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_VPN;
import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED;
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.text.format.DateUtils.HOUR_IN_MILLIS;
import static android.util.TimeUtils.formatDuration;

import android.annotation.BytesLong;
@@ -50,9 +49,7 @@ import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.PersistableBundle;
import android.os.Process;
import android.os.Trace;
import android.os.UserHandle;
import android.util.ArraySet;
import android.util.Log;

@@ -206,6 +203,8 @@ public class JobInfo implements Parcelable {
    /* Minimum flex for a periodic job, in milliseconds. */
    private static final long MIN_FLEX_MILLIS = 5 * 60 * 1000L; // 5 minutes

    private static final long MIN_ALLOWED_TIME_WINDOW_MILLIS = MIN_PERIOD_MILLIS;

    /**
     * Minimum backoff interval for a job, in milliseconds
     * @hide
@@ -1881,11 +1880,12 @@ public class JobInfo implements Parcelable {
        }

        /**
         * Set deadline which is the maximum scheduling latency. The job will be run by this
         * deadline even if other requirements (including a delay set through
         * {@link #setMinimumLatency(long)}) are not met.
         * Set a deadline after which all other functional requested constraints will be ignored.
         * After the deadline has passed, the job can run even if other requirements (including
         * a delay set through {@link #setMinimumLatency(long)}) are not met.
         * {@link JobParameters#isOverrideDeadlineExpired()} will return {@code true} if the job's
         * deadline has passed.
         * deadline has passed. The job's execution may be delayed beyond the set deadline by
         * other factors such as Doze mode and system health signals.
         *
         * <p>
         * Because it doesn't make sense setting this property on a periodic job, doing so will
@@ -1894,30 +1894,23 @@ public class JobInfo implements Parcelable {
         *
         * <p class="note">
         * Since a job will run once the deadline has passed regardless of the status of other
         * constraints, setting a deadline of 0 with other constraints makes those constraints
         * meaningless when it comes to execution decisions. Avoid doing this.
         * </p>
         *
         * <p>
         * Short deadlines hinder the system's ability to optimize scheduling behavior and may
         * result in running jobs at inopportune times. Therefore, starting in Android version
         * {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}, minimum time windows will be
         * enforced to help make it easier to better optimize job execution. Time windows are
         * constraints, setting a deadline of 0 (or a {@link #setMinimumLatency(long) delay} equal
         * to the deadline) with other constraints makes those constraints
         * meaningless when it comes to execution decisions. Since doing so is indicative of an
         * error in the logic, starting in Android version
         * {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}, jobs with extremely short
         * time windows will fail to build. Time windows are
         * defined as the time between a job's {@link #setMinimumLatency(long) minimum latency}
         * and its deadline. If the minimum latency is not set, it is assumed to be 0.
         * The following minimums will be enforced:
         * <ul>
         *     <li>
         *         Jobs with {@link #PRIORITY_DEFAULT} or higher priorities have a minimum time
         *         window of one hour.
         *     </li>
         *     <li>Jobs with {@link #PRIORITY_LOW} have a minimum time window of 6 hours.</li>
         *     <li>Jobs with {@link #PRIORITY_MIN} have a minimum time window of 12 hours.</li>
         * </ul>
         *
         * Work that must happen immediately should use {@link #setExpedited(boolean)} or
         * {@link #setUserInitiated(boolean)} in the appropriate manner.
         *
         * <p>
         * This API aimed to guarantee execution of the job by the deadline only on Android version
         * {@link android.os.Build.VERSION_CODES#LOLLIPOP}. That aim and guarantee has not existed
         * since {@link android.os.Build.VERSION_CODES#M}.
         *
         * @see JobInfo#getMaxExecutionDelayMillis()
         */
        public Builder setOverrideDeadline(long maxExecutionDelayMillis) {
@@ -2347,35 +2340,36 @@ public class JobInfo implements Parcelable {
                throw new IllegalArgumentException("Invalid priority level provided: " + mPriority);
        }

        if (enforceMinimumTimeWindows
                && Flags.enforceMinimumTimeWindows()
                // TODO(312197030): remove exemption for the system
                && !UserHandle.isCore(Process.myUid())
                && hasLateConstraint && !isPeriodic) {
        final boolean hasFunctionalConstraint = networkRequest != null
                || constraintFlags != 0
                || (triggerContentUris != null && triggerContentUris.length > 0);
        if (hasLateConstraint && !isPeriodic) {
            if (!hasFunctionalConstraint) {
                Log.w(TAG, "Job '" + service.flattenToShortString() + "#" + jobId + "'"
                        + " has a deadline with no functional constraints."
                        + " The deadline won't improve job execution latency."
                        + " Consider removing the deadline.");
            } else {
                final long windowStart = hasEarlyConstraint ? minLatencyMillis : 0;
            if (mPriority >= PRIORITY_DEFAULT) {
                if (maxExecutionDelayMillis - windowStart < HOUR_IN_MILLIS) {
                    throw new IllegalArgumentException(
                            getPriorityString(mPriority)
                                    + " cannot have a time window less than 1 hour."
                                    + " Delay=" + windowStart
                                    + ", deadline=" + maxExecutionDelayMillis);
                }
            } else if (mPriority >= PRIORITY_LOW) {
                if (maxExecutionDelayMillis - windowStart < 6 * HOUR_IN_MILLIS) {
                    throw new IllegalArgumentException(
                            getPriorityString(mPriority)
                                    + " cannot have a time window less than 6 hours."
                                    + " Delay=" + windowStart
                if (maxExecutionDelayMillis - windowStart < MIN_ALLOWED_TIME_WINDOW_MILLIS) {
                    if (enforceMinimumTimeWindows
                            && Flags.enforceMinimumTimeWindows()) {
                        throw new IllegalArgumentException("Jobs with a deadline and"
                                + " functional constraints cannot have a time window less than "
                                + MIN_ALLOWED_TIME_WINDOW_MILLIS + " ms."
                                + " Job '" + service.flattenToShortString() + "#" + jobId + "'"
                                + " has delay=" + windowStart
                                + ", deadline=" + maxExecutionDelayMillis);
                }
                    } else {
                if (maxExecutionDelayMillis - windowStart < 12 * HOUR_IN_MILLIS) {
                    throw new IllegalArgumentException(
                            getPriorityString(mPriority)
                                    + " cannot have a time window less than 12 hours."
                                    + " Delay=" + windowStart
                                    + ", deadline=" + maxExecutionDelayMillis);
                        Log.w(TAG, "Job '" + service.flattenToShortString() + "#" + jobId + "'"
                                + " has a deadline with functional constraints and an extremely"
                                + " short time window of "
                                + (maxExecutionDelayMillis - windowStart) + " ms"
                                + " (delay=" + windowStart
                                + ", deadline=" + maxExecutionDelayMillis + ")."
                                + " The functional constraints are not likely to be satisfied when"
                                + " the job runs.");
                    }
                }
            }
        }
+4 −1
Original line number Diff line number Diff line
@@ -361,7 +361,10 @@ stubs_defaults {
    previous_api: ":android.api.public.latest",
    merge_annotations_dirs: ["metalava-manual"],
    defaults_visibility: ["//frameworks/base/api"],
    visibility: ["//frameworks/base/api"],
    visibility: [
        "//frameworks/base/api",
        "//frameworks/base/core/api",
    ],
}

// We resolve dependencies on APIs in modules by depending on a prebuilt of the whole
+23 −20
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ type MergedTxtDefinition struct {
	Scope string
}

func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) {
func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition, stubsTypeSuffix string, doDist bool) {
	metalavaCmd := "$(location metalava)"
	// Silence reflection warnings. See b/168689341
	metalavaCmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED "
@@ -140,7 +140,7 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) {
	if txt.Scope != "public" {
		filename = txt.Scope + "-" + filename
	}
	moduleName := ctx.ModuleName() + "-" + filename
	moduleName := ctx.ModuleName() + stubsTypeSuffix + filename

	props := genruleProps{}
	props.Name = proptools.StringPtr(moduleName)
@@ -148,6 +148,7 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) {
	props.Out = []string{filename}
	props.Cmd = proptools.StringPtr(metalavaCmd + "$(in) --out $(out)")
	props.Srcs = append([]string{txt.BaseTxt}, createSrcs(txt.Modules, txt.ModuleTag)...)
	if doDist {
		props.Dists = []android.Dist{
			{
				Targets: []string{"droidcore"},
@@ -160,6 +161,7 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) {
				Dest:    proptools.StringPtr(txt.DistFilename),
			},
		}
	}
	props.Visibility = []string{"//visibility:public"}
	ctx.CreateModule(genrule.GenRuleFactory, &props)
}
@@ -343,7 +345,7 @@ func createPublicStubsSourceFilegroup(ctx android.LoadHookContext, modules []str
	ctx.CreateModule(android.FileGroupFactory, &props)
}

func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_classpath []string) {
func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_classpath []string, baseTxtModulePrefix, stubsTypeSuffix string, doDist bool) {
	var textFiles []MergedTxtDefinition

	tagSuffix := []string{".api.txt}", ".removed-api.txt}"}
@@ -352,7 +354,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_
		textFiles = append(textFiles, MergedTxtDefinition{
			TxtFilename:  f,
			DistFilename: distFilename[i],
			BaseTxt:      ":non-updatable-" + f,
			BaseTxt:      ":" + baseTxtModulePrefix + f,
			Modules:      bootclasspath,
			ModuleTag:    "{.public" + tagSuffix[i],
			Scope:        "public",
@@ -360,7 +362,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_
		textFiles = append(textFiles, MergedTxtDefinition{
			TxtFilename:  f,
			DistFilename: distFilename[i],
			BaseTxt:      ":non-updatable-system-" + f,
			BaseTxt:      ":" + baseTxtModulePrefix + "system-" + f,
			Modules:      bootclasspath,
			ModuleTag:    "{.system" + tagSuffix[i],
			Scope:        "system",
@@ -368,7 +370,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_
		textFiles = append(textFiles, MergedTxtDefinition{
			TxtFilename:  f,
			DistFilename: distFilename[i],
			BaseTxt:      ":non-updatable-module-lib-" + f,
			BaseTxt:      ":" + baseTxtModulePrefix + "module-lib-" + f,
			Modules:      bootclasspath,
			ModuleTag:    "{.module-lib" + tagSuffix[i],
			Scope:        "module-lib",
@@ -376,14 +378,14 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_
		textFiles = append(textFiles, MergedTxtDefinition{
			TxtFilename:  f,
			DistFilename: distFilename[i],
			BaseTxt:      ":non-updatable-system-server-" + f,
			BaseTxt:      ":" + baseTxtModulePrefix + "system-server-" + f,
			Modules:      system_server_classpath,
			ModuleTag:    "{.system-server" + tagSuffix[i],
			Scope:        "system-server",
		})
	}
	for _, txt := range textFiles {
		createMergedTxt(ctx, txt)
		createMergedTxt(ctx, txt, stubsTypeSuffix, doDist)
	}
}

@@ -465,7 +467,8 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) {
		bootclasspath = append(bootclasspath, a.properties.Conditional_bootclasspath...)
		sort.Strings(bootclasspath)
	}
	createMergedTxts(ctx, bootclasspath, system_server_classpath)
	createMergedTxts(ctx, bootclasspath, system_server_classpath, "non-updatable-", "-", false)
	createMergedTxts(ctx, bootclasspath, system_server_classpath, "non-updatable-exportable-", "-exportable-", true)

	createMergedPublicStubs(ctx, bootclasspath)
	createMergedSystemStubs(ctx, bootclasspath)
+51 −0
Original line number Diff line number Diff line
@@ -96,3 +96,54 @@ filegroup {
    name: "non-updatable-test-lint-baseline.txt",
    srcs: ["test-lint-baseline.txt"],
}

// Exportable stub artifacts
filegroup {
    name: "non-updatable-exportable-current.txt",
    srcs: [":api-stubs-docs-non-updatable{.exportable.api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-removed.txt",
    srcs: [":api-stubs-docs-non-updatable{.exportable.removed-api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-system-current.txt",
    srcs: [":system-api-stubs-docs-non-updatable{.exportable.api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-system-removed.txt",
    srcs: [":system-api-stubs-docs-non-updatable{.exportable.removed-api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-module-lib-current.txt",
    srcs: [":module-lib-api-stubs-docs-non-updatable{.exportable.api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-module-lib-removed.txt",
    srcs: [":module-lib-api-stubs-docs-non-updatable{.exportable.removed-api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-test-current.txt",
    srcs: [":test-api-stubs-docs-non-updatable{.exportable.api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-test-removed.txt",
    srcs: [":test-api-stubs-docs-non-updatable{.exportable.removed-api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-system-server-current.txt",
    srcs: [":services-non-updatable-stubs{.exportable.api.txt}"],
}

filegroup {
    name: "non-updatable-exportable-system-server-removed.txt",
    srcs: [":services-non-updatable-stubs{.exportable.removed-api.txt}"],
}
+13 −2
Original line number Diff line number Diff line
@@ -1375,6 +1375,7 @@ package android {
    field public static final int reqTouchScreen = 16843303; // 0x1010227
    field public static final int requestLegacyExternalStorage = 16844291; // 0x1010603
    field public static final int requestRawExternalStorageAccess = 16844357; // 0x1010645
    field @FlaggedApi("android.security.content_uri_permission_apis") public static final int requireContentUriPermissionFromCaller;
    field public static final int requireDeviceScreenOn = 16844317; // 0x101061d
    field public static final int requireDeviceUnlock = 16843756; // 0x10103ec
    field public static final int required = 16843406; // 0x101028e
@@ -8070,8 +8071,8 @@ package android.app.admin {
    method public boolean isUsbDataSignalingEnabled();
    method public boolean isUsingUnifiedPassword(@NonNull android.content.ComponentName);
    method @NonNull public java.util.List<android.os.UserHandle> listForegroundAffiliatedUsers();
    method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_LOCK, conditional=true) public void lockNow();
    method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_LOCK, conditional=true) public void lockNow(int);
    method @RequiresPermission(value="android.permission.LOCK_DEVICE", conditional=true) public void lockNow();
    method @RequiresPermission(value="android.permission.LOCK_DEVICE", conditional=true) public void lockNow(int);
    method public int logoutUser(@NonNull android.content.ComponentName);
    method public void reboot(@NonNull android.content.ComponentName);
    method public void removeActiveAdmin(@NonNull android.content.ComponentName);
@@ -40960,6 +40961,14 @@ package android.service.notification {
}
package android.service.persistentdata {
  @FlaggedApi("android.security.frp_enforcement") public class PersistentDataBlockManager {
    method @FlaggedApi("android.security.frp_enforcement") public boolean isFactoryResetProtectionActive();
  }
}
package android.service.quickaccesswallet {
  public interface GetWalletCardsCallback {
@@ -46304,6 +46313,7 @@ package android.telephony.euicc {
    method @NonNull public android.telephony.euicc.EuiccManager createForCardId(int);
    method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void deleteSubscription(int, android.app.PendingIntent);
    method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void downloadSubscription(android.telephony.euicc.DownloadableSubscription, boolean, android.app.PendingIntent);
    method @FlaggedApi("com.android.internal.telephony.flags.esim_available_memory") @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE", "carrier privileges"}) public long getAvailableMemoryInBytes();
    method @Nullable public String getEid();
    method @Nullable public android.telephony.euicc.EuiccInfo getEuiccInfo();
    method public boolean isEnabled();
@@ -46336,6 +46346,7 @@ package android.telephony.euicc {
    field public static final int ERROR_SIM_MISSING = 10008; // 0x2718
    field public static final int ERROR_TIME_OUT = 10005; // 0x2715
    field public static final int ERROR_UNSUPPORTED_VERSION = 10007; // 0x2717
    field @FlaggedApi("com.android.internal.telephony.flags.esim_available_memory") public static final long EUICC_MEMORY_FIELD_UNAVAILABLE = -1L; // 0xffffffffffffffffL
    field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE";
    field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION";
    field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_ERROR_CODE";
Loading