Merge "VCN: Explicitly handle IAE from updating underlying network"
diff --git a/Android.bp b/Android.bp
index b4e02c0..94bcb3e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -505,7 +505,6 @@
"--hide RequiresPermission " +
"--hide SdkConstant " +
"--hide Todo " +
- "--hide Typo " +
"--hide UnavailableSymbol " +
"--manifest $(location :frameworks-base-core-AndroidManifest.xml) "
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp
index ed5a8f2..7c8dd92 100644
--- a/api/StubLibraries.bp
+++ b/api/StubLibraries.bp
@@ -217,13 +217,17 @@
}
java_defaults {
- name: "android-non-updatable_defaults_stubs_current",
- libs: ["stub-annotations"],
- static_libs: ["framework-res-package-jar"], // Export package of framework-res
+ name: "android-non-updatable_defaults",
sdk_version: "none",
system_modules: "none",
java_version: "1.8",
compile_dex: true,
+}
+
+java_defaults {
+ name: "android-non-updatable_from_source_defaults",
+ libs: ["stub-annotations"],
+ static_libs: ["framework-res-package-jar"], // Export package of framework-res
dist: {
targets: ["sdk"],
tag: ".jar",
@@ -233,7 +237,82 @@
java_library {
name: "android-non-updatable.stubs",
- defaults: ["android-non-updatable_defaults_stubs_current"],
+ defaults: ["android-non-updatable_defaults"],
+ static_libs: [
+ "android-non-updatable.stubs.from-source",
+ ],
+ product_variables: {
+ build_from_text_stub: {
+ static_libs: [
+ "android-non-updatable.stubs.from-text",
+ ],
+ exclude_static_libs: [
+ "android-non-updatable.stubs.from-source",
+ ],
+ },
+ },
+}
+
+java_library {
+ name: "android-non-updatable.stubs.system",
+ defaults: ["android-non-updatable_defaults"],
+ static_libs: [
+ "android-non-updatable.stubs.system.from-source",
+ ],
+ product_variables: {
+ build_from_text_stub: {
+ static_libs: [
+ "android-non-updatable.stubs.system.from-text",
+ ],
+ exclude_static_libs: [
+ "android-non-updatable.stubs.system.from-source",
+ ],
+ },
+ },
+}
+
+java_library {
+ name: "android-non-updatable.stubs.module_lib",
+ defaults: ["android-non-updatable_defaults"],
+ static_libs: [
+ "android-non-updatable.stubs.module_lib.from-source",
+ ],
+ product_variables: {
+ build_from_text_stub: {
+ static_libs: [
+ "android-non-updatable.stubs.module_lib.from-text",
+ ],
+ exclude_static_libs: [
+ "android-non-updatable.stubs.module_lib.from-source",
+ ],
+ },
+ },
+}
+
+java_library {
+ name: "android-non-updatable.stubs.test",
+ defaults: ["android-non-updatable_defaults"],
+ static_libs: [
+ "android-non-updatable.stubs.test.from-source",
+ ],
+ product_variables: {
+ build_from_text_stub: {
+ static_libs: [
+ "android-non-updatable.stubs.test.from-text",
+ ],
+ exclude_static_libs: [
+ "android-non-updatable.stubs.test.from-source",
+ ],
+ },
+ },
+}
+
+java_library {
+ name: "android-non-updatable.stubs.from-source",
+ defaults: [
+ "android-non-updatable_defaults",
+ "android-non-updatable_from_source_defaults",
+ ],
srcs: [":api-stubs-docs-non-updatable"],
libs: ["all-modules-public-stubs"],
dist: {
@@ -242,8 +321,11 @@
}
java_library {
- name: "android-non-updatable.stubs.system",
- defaults: ["android-non-updatable_defaults_stubs_current"],
+ name: "android-non-updatable.stubs.system.from-source",
+ defaults: [
+ "android-non-updatable_defaults",
+ "android-non-updatable_from_source_defaults",
+ ],
srcs: [":system-api-stubs-docs-non-updatable"],
libs: ["all-modules-system-stubs"],
dist: {
@@ -252,8 +334,11 @@
}
java_library {
- name: "android-non-updatable.stubs.module_lib",
- defaults: ["android-non-updatable_defaults_stubs_current"],
+ name: "android-non-updatable.stubs.module_lib.from-source",
+ defaults: [
+ "android-non-updatable_defaults",
+ "android-non-updatable_from_source_defaults",
+ ],
srcs: [":module-lib-api-stubs-docs-non-updatable"],
libs: [
"sdk_module-lib_current_framework-tethering",
@@ -270,8 +355,11 @@
}
java_library {
- name: "android-non-updatable.stubs.test",
- defaults: ["android-non-updatable_defaults_stubs_current"],
+ name: "android-non-updatable.stubs.test.from-source",
+ defaults: [
+ "android-non-updatable_defaults",
+ "android-non-updatable_from_source_defaults",
+ ],
srcs: [":test-api-stubs-docs-non-updatable"],
libs: ["all-modules-system-stubs"],
dist: {
@@ -280,7 +368,7 @@
}
java_defaults {
- name: "non_updatable_api_library_defaults",
+ name: "android-non-updatable_from_text_defaults",
static_libs: ["framework-res-package-jar"],
libs: ["stub-annotations"],
}
@@ -291,7 +379,7 @@
api_files: [
":non-updatable-current.txt",
],
- defaults: ["non_updatable_api_library_defaults"],
+ defaults: ["android-non-updatable_from_text_defaults"],
dep_api_srcs: "android_stubs_current.from-text",
}
@@ -302,7 +390,7 @@
":non-updatable-current.txt",
":non-updatable-system-current.txt",
],
- defaults: ["non_updatable_api_library_defaults"],
+ defaults: ["android-non-updatable_from_text_defaults"],
dep_api_srcs: "android_system_stubs_current.from-text",
}
@@ -314,7 +402,7 @@
":non-updatable-system-current.txt",
":non-updatable-test-current.txt",
],
- defaults: ["non_updatable_api_library_defaults"],
+ defaults: ["android-non-updatable_from_text_defaults"],
dep_api_srcs: "android_test_stubs_current.from-text",
}
@@ -326,7 +414,7 @@
":non-updatable-system-current.txt",
":non-updatable-module-lib-current.txt",
],
- defaults: ["non_updatable_api_library_defaults"],
+ defaults: ["android-non-updatable_from_text_defaults"],
dep_api_srcs: "android_module_lib_stubs_current_full.from-text",
}
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index 556058b..2fa3a7e 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -91,7 +91,7 @@
private static final String TAG = "Instrumentation";
- private static final long CONNECT_TIMEOUT_MILLIS = 5000;
+ private static final long CONNECT_TIMEOUT_MILLIS = 60000;
/**
* @hide
diff --git a/core/java/android/app/UiAutomation.java b/core/java/android/app/UiAutomation.java
index ac67593..9568f68 100644
--- a/core/java/android/app/UiAutomation.java
+++ b/core/java/android/app/UiAutomation.java
@@ -113,7 +113,7 @@
private static final int CONNECTION_ID_UNDEFINED = -1;
- private static final long CONNECT_TIMEOUT_MILLIS = 5000;
+ private static final long CONNECT_TIMEOUT_MILLIS = 60000;
/** Rotation constant: Unfreeze rotation (rotating the device changes its rotation state). */
public static final int ROTATION_UNFREEZE = -2;
diff --git a/core/java/android/companion/OWNERS b/core/java/android/companion/OWNERS
index 0348fe2..54d9c24 100644
--- a/core/java/android/companion/OWNERS
+++ b/core/java/android/companion/OWNERS
@@ -1,3 +1,5 @@
evanxinchen@google.com
guojing@google.com
-raphk@google.com
\ No newline at end of file
+jeremyns@google.com
+raphk@google.com
+yukl@google.com
\ No newline at end of file
diff --git a/core/java/android/content/pm/AppSearchShortcutInfo.java b/core/java/android/content/pm/AppSearchShortcutInfo.java
index fb41b89..225b3d3 100644
--- a/core/java/android/content/pm/AppSearchShortcutInfo.java
+++ b/core/java/android/content/pm/AppSearchShortcutInfo.java
@@ -445,7 +445,7 @@
@VisibleForTesting
public static class Builder extends GenericDocument.Builder<Builder> {
- private List<String> mFlags = new ArrayList<>(1);
+ private final List<String> mFlags = new ArrayList<>(1);
public Builder(String packageName, String id) {
super(/*namespace=*/ packageName, id, SCHEMA_TYPE);
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index bc3e25b..5c1780c 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -66,7 +66,7 @@
* <application> tag.
*/
public class ApplicationInfo extends PackageItemInfo implements Parcelable {
- private static ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class);
+ private static final ForBoolean sForBoolean = Parcelling.Cache.getOrCreate(ForBoolean.class);
private static final Parcelling.BuiltIn.ForStringSet sForStringSet =
Parcelling.Cache.getOrCreate(Parcelling.BuiltIn.ForStringSet.class);
@@ -1862,7 +1862,7 @@
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
private final Collator sCollator = Collator.getInstance();
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
- private PackageManager mPM;
+ private final PackageManager mPM;
}
public ApplicationInfo() {
diff --git a/core/java/android/content/pm/Attribution.java b/core/java/android/content/pm/Attribution.java
index 989a5b9..3649249 100644
--- a/core/java/android/content/pm/Attribution.java
+++ b/core/java/android/content/pm/Attribution.java
@@ -33,7 +33,7 @@
/**
* The tag of this attribution. From the <manifest> tag's "tag" attribute
*/
- private @NonNull String mTag;
+ private final @NonNull String mTag;
/**
* The resource ID of the label of the attribution From the <manifest> tag's "label"
@@ -43,7 +43,7 @@
- // Code below generated by codegen v1.0.22.
+ // Code below generated by codegen v1.0.23.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -146,10 +146,10 @@
};
@DataClass.Generated(
- time = 1608139558081L,
- codegenVersion = "1.0.22",
+ time = 1683311736586L,
+ codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/content/pm/Attribution.java",
- inputSignatures = "private @android.annotation.NonNull java.lang.String mTag\nprivate final @android.annotation.IdRes int mLabel\nclass Attribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true)")
+ inputSignatures = "private final @android.annotation.NonNull java.lang.String mTag\nprivate final @android.annotation.IdRes int mLabel\nclass Attribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genHiddenConstructor=true)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/content/pm/BaseParceledListSlice.java b/core/java/android/content/pm/BaseParceledListSlice.java
index 1e0deff..03950fa 100644
--- a/core/java/android/content/pm/BaseParceledListSlice.java
+++ b/core/java/android/content/pm/BaseParceledListSlice.java
@@ -41,8 +41,8 @@
* @hide
*/
abstract class BaseParceledListSlice<T> implements Parcelable {
- private static String TAG = "ParceledListSlice";
- private static boolean DEBUG = false;
+ private static final String TAG = "ParceledListSlice";
+ private static final boolean DEBUG = false;
/*
* TODO get this number from somewhere else. For now set it to a quarter of
diff --git a/core/java/android/content/pm/CapabilityParams.java b/core/java/android/content/pm/CapabilityParams.java
index 7239bac..60e8123 100644
--- a/core/java/android/content/pm/CapabilityParams.java
+++ b/core/java/android/content/pm/CapabilityParams.java
@@ -172,7 +172,7 @@
@NonNull
private final String mKey;
@NonNull
- private String mPrimaryValue;
+ private final String mPrimaryValue;
@NonNull
private Set<String> mAliases;
diff --git a/core/java/android/content/pm/IncrementalStatesInfo.java b/core/java/android/content/pm/IncrementalStatesInfo.java
index 0393d34b..684e672 100644
--- a/core/java/android/content/pm/IncrementalStatesInfo.java
+++ b/core/java/android/content/pm/IncrementalStatesInfo.java
@@ -24,8 +24,8 @@
* @hide
*/
public class IncrementalStatesInfo implements Parcelable {
- private boolean mIsLoading;
- private float mProgress;
+ private final boolean mIsLoading;
+ private final float mProgress;
public IncrementalStatesInfo(boolean isLoading, float progress) {
mIsLoading = isLoading;
diff --git a/core/java/android/content/pm/KeySet.java b/core/java/android/content/pm/KeySet.java
index fd459e6..3da5bff 100644
--- a/core/java/android/content/pm/KeySet.java
+++ b/core/java/android/content/pm/KeySet.java
@@ -29,7 +29,7 @@
*/
public class KeySet implements Parcelable {
- private IBinder token;
+ private final IBinder token;
/** @hide */
public KeySet(IBinder token) {
diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java
index 364aa90..7f169d4 100644
--- a/core/java/android/content/pm/LauncherApps.java
+++ b/core/java/android/content/pm/LauncherApps.java
@@ -1680,7 +1680,8 @@
mCallbacks.add(toAdd);
}
- private IOnAppsChangedListener.Stub mAppsChangedListener = new IOnAppsChangedListener.Stub() {
+ private final IOnAppsChangedListener.Stub mAppsChangedListener =
+ new IOnAppsChangedListener.Stub() {
@Override
public void onPackageRemoved(UserHandle user, String packageName)
@@ -1815,7 +1816,7 @@
private static final int MSG_SHORTCUT_CHANGED = 8;
private static final int MSG_LOADING_PROGRESS_CHANGED = 9;
- private LauncherApps.Callback mCallback;
+ private final LauncherApps.Callback mCallback;
private static class CallbackInfo {
String[] packageNames;
diff --git a/core/java/android/content/pm/PackageItemInfo.java b/core/java/android/content/pm/PackageItemInfo.java
index 2bac066..bb978e0 100644
--- a/core/java/android/content/pm/PackageItemInfo.java
+++ b/core/java/android/content/pm/PackageItemInfo.java
@@ -502,6 +502,6 @@
}
private final Collator sCollator = Collator.getInstance();
- private PackageManager mPM;
+ private final PackageManager mPM;
}
}
diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java
index bb88486..7c5cca5 100644
--- a/core/java/android/content/pm/PermissionInfo.java
+++ b/core/java/android/content/pm/PermissionInfo.java
@@ -477,7 +477,8 @@
*/
public @Nullable CharSequence nonLocalizedDescription;
- private static ForStringSet sForStringSet = Parcelling.Cache.getOrCreate(ForStringSet.class);
+ private static final ForStringSet sForStringSet =
+ Parcelling.Cache.getOrCreate(ForStringSet.class);
/**
* A {@link Set} of trusted signing certificate digests. If this permission has the {@link
diff --git a/core/java/android/content/pm/ResolveInfo.java b/core/java/android/content/pm/ResolveInfo.java
index 6f07dd7..a7db030 100644
--- a/core/java/android/content/pm/ResolveInfo.java
+++ b/core/java/android/content/pm/ResolveInfo.java
@@ -558,6 +558,6 @@
}
private final Collator mCollator = Collator.getInstance();
- private PackageManager mPM;
+ private final PackageManager mPM;
}
}
diff --git a/core/java/android/content/pm/parsing/result/ParseTypeImpl.java b/core/java/android/content/pm/parsing/result/ParseTypeImpl.java
index c323704..8343c92 100644
--- a/core/java/android/content/pm/parsing/result/ParseTypeImpl.java
+++ b/core/java/android/content/pm/parsing/result/ParseTypeImpl.java
@@ -41,7 +41,7 @@
public static final boolean DEBUG_THROW_ALL_ERRORS = false;
@NonNull
- private Callback mCallback;
+ private final Callback mCallback;
private Object mResult;
diff --git a/core/java/android/permission/PermissionControllerManager.java b/core/java/android/permission/PermissionControllerManager.java
index b494c7f..46276c0 100644
--- a/core/java/android/permission/PermissionControllerManager.java
+++ b/core/java/android/permission/PermissionControllerManager.java
@@ -40,6 +40,7 @@
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Binder;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Process;
@@ -81,8 +82,8 @@
public final class PermissionControllerManager {
private static final String TAG = PermissionControllerManager.class.getSimpleName();
- private static final long REQUEST_TIMEOUT_MILLIS = 60000;
- private static final long UNBIND_TIMEOUT_MILLIS = 10000;
+ private static final long REQUEST_TIMEOUT_MILLIS = 60000L * Build.HW_TIMEOUT_MULTIPLIER;
+ private static final long UNBIND_TIMEOUT_MILLIS = 10000L * Build.HW_TIMEOUT_MULTIPLIER;
private static final int CHUNK_SIZE = 4 * 1024;
private static final Object sLock = new Object();
diff --git a/core/java/android/util/apk/SourceStampVerifier.java b/core/java/android/util/apk/SourceStampVerifier.java
index f9e3121..11d7a00 100644
--- a/core/java/android/util/apk/SourceStampVerifier.java
+++ b/core/java/android/util/apk/SourceStampVerifier.java
@@ -142,16 +142,21 @@
private static SourceStampVerificationResult verify(
RandomAccessFile apk, byte[] sourceStampCertificateDigest, byte[] manifestBytes) {
+ SignatureInfo signatureInfo;
try {
- SignatureInfo signatureInfo =
+ signatureInfo =
ApkSigningBlockUtils.findSignature(apk, SOURCE_STAMP_BLOCK_ID);
+ } catch (IOException | SignatureNotFoundException | RuntimeException e) {
+ return SourceStampVerificationResult.notPresent();
+ }
+ try {
Map<Integer, Map<Integer, byte[]>> signatureSchemeApkContentDigests =
getSignatureSchemeApkContentDigests(apk, manifestBytes);
return verify(
signatureInfo,
getSignatureSchemeDigests(signatureSchemeApkContentDigests),
sourceStampCertificateDigest);
- } catch (IOException | SignatureNotFoundException | RuntimeException e) {
+ } catch (IOException | RuntimeException e) {
return SourceStampVerificationResult.notVerified();
}
}
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 0d49772..11fcc9c 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -240,6 +240,7 @@
/**
* Action that selects the node.
+ * @see AccessibilityAction#ACTION_SELECT
*/
public static final int ACTION_SELECT = 0x00000004;
@@ -396,19 +397,8 @@
/**
* Action to set the selection. Performing this action with no arguments
* clears the selection.
- * <p>
- * <strong>Arguments:</strong>
- * {@link #ACTION_ARGUMENT_SELECTION_START_INT},
- * {@link #ACTION_ARGUMENT_SELECTION_END_INT}<br>
- * <strong>Example:</strong>
- * <code><pre><p>
- * Bundle arguments = new Bundle();
- * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 1);
- * arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 2);
- * info.performAction(AccessibilityNodeInfo.ACTION_SET_SELECTION, arguments);
- * </code></pre></p>
- * </p>
*
+ * @see AccessibilityAction#ACTION_SET_SELECTION
* @see #ACTION_ARGUMENT_SELECTION_START_INT
* @see #ACTION_ARGUMENT_SELECTION_END_INT
*/
@@ -433,16 +423,7 @@
* Action that sets the text of the node. Performing the action without argument, using <code>
* null</code> or empty {@link CharSequence} will clear the text. This action will also put the
* cursor at the end of text.
- * <p>
- * <strong>Arguments:</strong>
- * {@link #ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE}<br>
- * <strong>Example:</strong>
- * <code><pre><p>
- * Bundle arguments = new Bundle();
- * arguments.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE,
- * "android");
- * info.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments);
- * </code></pre></p>
+ * @see AccessibilityAction#ACTION_SET_TEXT
*/
public static final int ACTION_SET_TEXT = 0x00200000;
@@ -4718,12 +4699,16 @@
/**
* Action that selects the node.
+ * The view the implements this should send a
+ * {@link AccessibilityEvent#TYPE_VIEW_SELECTED} event.
+ * @see AccessibilityAction#ACTION_CLEAR_SELECTION
*/
public static final AccessibilityAction ACTION_SELECT =
new AccessibilityAction(AccessibilityNodeInfo.ACTION_SELECT);
/**
* Action that deselects the node.
+ * @see AccessibilityAction#ACTION_SELECT
*/
public static final AccessibilityAction ACTION_CLEAR_SELECTION =
new AccessibilityAction(AccessibilityNodeInfo.ACTION_CLEAR_SELECTION);
@@ -4945,7 +4930,10 @@
* info.performAction(AccessibilityAction.ACTION_SET_SELECTION.getId(), arguments);
* </code></pre></p>
* </p>
- *
+ * <p> If this is a text selection, the UI element that implements this should send a
+ * {@link AccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED} event if its selection is
+ * updated. This element should also return {@code true} for
+ * {@link AccessibilityNodeInfo#isTextSelectable()}.
* @see AccessibilityNodeInfo#ACTION_ARGUMENT_SELECTION_START_INT
* AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT
* @see AccessibilityNodeInfo#ACTION_ARGUMENT_SELECTION_END_INT
@@ -4987,6 +4975,10 @@
* "android");
* info.performAction(AccessibilityAction.ACTION_SET_TEXT.getId(), arguments);
* </code></pre></p>
+ * <p> The UI element that implements this should send a
+ * {@link AccessibilityEvent#TYPE_VIEW_TEXT_CHANGED} event if its text is updated.
+ * This element should also return {@code true} for
+ * {@link AccessibilityNodeInfo#isEditable()}.
*/
public static final AccessibilityAction ACTION_SET_TEXT =
new AccessibilityAction(AccessibilityNodeInfo.ACTION_SET_TEXT);
diff --git a/core/res/OWNERS b/core/res/OWNERS
index bce500c..b46902e 100644
--- a/core/res/OWNERS
+++ b/core/res/OWNERS
@@ -33,6 +33,9 @@
# Multiuser
per-file res/xml/config_user_types.xml = file:/MULTIUSER_OWNERS
+# Battery Saver
+per-file res/values/config_battery_saver.xml = file:/services/core/java/com/android/server/power/batterysaver/OWNERS
+
# Car
per-file res/values/dimens_car.xml = file:/platform/packages/services/Car:/OWNERS
diff --git a/core/res/res/xml/sms_short_codes.xml b/core/res/res/xml/sms_short_codes.xml
index df3ae0e..f28da1f 100644
--- a/core/res/res/xml/sms_short_codes.xml
+++ b/core/res/res/xml/sms_short_codes.xml
@@ -162,7 +162,7 @@
<shortcode country="jp" pattern="\\d{1,5}" free="8083" />
<!-- Kenya: 5 digits, known premium codes listed -->
- <shortcode country="ke" pattern="\\d{5}" free="21725|21562|40520" />
+ <shortcode country="ke" pattern="\\d{5}" free="21725|21562|40520|23342" />
<!-- Kyrgyzstan: 4 digits, known premium codes listed -->
<shortcode country="kg" pattern="\\d{4}" premium="415[2367]|444[69]" />
@@ -235,6 +235,9 @@
<!-- Russia: 4 digits, known premium codes listed: http://smscoin.net/info/pricing-russia/ -->
<shortcode country="ru" pattern="\\d{4}" premium="1(?:1[56]1|899)|2(?:09[57]|322|47[46]|880|990)|3[589]33|4161|44(?:4[3-9]|81)|77(?:33|81)|8424" free="6954|8501" standard="2037|2044"/>
+ <!-- Rwanda: 4 digits -->
+ <shortcode country="rw" pattern="\\d{4}" free="5060" />
+
<!-- Saudi Arabia -->
<shortcode country="sa" pattern="\\d{1,5}" free="8145" />
diff --git a/core/tests/coretests/src/android/util/apk/SourceStampVerifierTest.java b/core/tests/coretests/src/android/util/apk/SourceStampVerifierTest.java
index bc0bddb..e0c583d 100644
--- a/core/tests/coretests/src/android/util/apk/SourceStampVerifierTest.java
+++ b/core/tests/coretests/src/android/util/apk/SourceStampVerifierTest.java
@@ -100,7 +100,7 @@
SourceStampVerificationResult result =
SourceStampVerifier.verify(mPrimaryApk.getAbsolutePath());
- assertTrue(result.isPresent());
+ assertFalse(result.isPresent());
assertFalse(result.isVerified());
assertNull(result.getCertificate());
}
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index f86b9af..23f87ab 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -1566,7 +1566,7 @@
FileInputStream in = null;
try {
in = new FileInputStream(fileDescriptor);
- loadAttributes(in, fileDescriptor);
+ loadAttributes(in);
} finally {
closeQuietly(in);
if (isFdDuped) {
@@ -1637,7 +1637,7 @@
mSeekableFileDescriptor = null;
}
}
- loadAttributes(inputStream, null);
+ loadAttributes(inputStream);
}
/**
@@ -1963,7 +1963,7 @@
* This function decides which parser to read the image data according to the given input stream
* type and the content of the input stream.
*/
- private void loadAttributes(@NonNull InputStream in, @Nullable FileDescriptor fd) {
+ private void loadAttributes(@NonNull InputStream in) {
if (in == null) {
throw new NullPointerException("inputstream shouldn't be null");
}
@@ -1993,7 +1993,7 @@
break;
}
case IMAGE_TYPE_HEIF: {
- getHeifAttributes(inputStream, fd);
+ getHeifAttributes(inputStream);
break;
}
case IMAGE_TYPE_ORF: {
@@ -2580,7 +2580,7 @@
} else if (isSeekableFD(in.getFD())) {
mSeekableFileDescriptor = in.getFD();
}
- loadAttributes(in, null);
+ loadAttributes(in);
} finally {
closeQuietly(in);
if (modernFd != null) {
@@ -3068,66 +3068,59 @@
}
}
- private void getHeifAttributes(ByteOrderedDataInputStream in, @Nullable FileDescriptor fd)
- throws IOException {
+ private void getHeifAttributes(ByteOrderedDataInputStream in) throws IOException {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
- if (fd != null) {
- retriever.setDataSource(fd);
- } else {
- retriever.setDataSource(new MediaDataSource() {
- long mPosition;
+ retriever.setDataSource(new MediaDataSource() {
+ long mPosition;
- @Override
- public void close() throws IOException {}
+ @Override
+ public void close() throws IOException {}
- @Override
- public int readAt(long position, byte[] buffer, int offset, int size)
- throws IOException {
- if (size == 0) {
- return 0;
- }
- if (position < 0) {
- return -1;
- }
- try {
- if (mPosition != position) {
- // We don't allow seek to positions after the available bytes,
- // the input stream won't be able to seek back then.
- // However, if we hit an exception before (mPosition set to -1),
- // let it try the seek in hope it might recover.
- if (mPosition >= 0 && position >= mPosition + in.available()) {
- return -1;
- }
- in.seek(position);
- mPosition = position;
- }
-
- // If the read will cause us to go over the available bytes,
- // reduce the size so that we stay in the available range.
- // Otherwise the input stream may not be able to seek back.
- if (size > in.available()) {
- size = in.available();
- }
-
- int bytesRead = in.read(buffer, offset, size);
- if (bytesRead >= 0) {
- mPosition += bytesRead;
- return bytesRead;
- }
- } catch (IOException e) {
- // absorb the exception and fall through to the 'failed read' path below
- }
- mPosition = -1; // need to seek on next read
+ @Override
+ public int readAt(long position, byte[] buffer, int offset, int size)
+ throws IOException {
+ if (size == 0) {
+ return 0;
+ }
+ if (position < 0) {
return -1;
}
+ try {
+ if (mPosition != position) {
+ // We don't allow seek to positions after the available bytes,
+ // the input stream won't be able to seek back then.
+ // However, if we hit an exception before (mPosition set to -1),
+ // let it try the seek in hope it might recover.
+ if (mPosition >= 0 && position >= mPosition + in.available()) {
+ return -1;
+ }
+ in.seek(position);
+ mPosition = position;
+ }
- @Override
- public long getSize() throws IOException {
- return -1;
- }
- });
- }
+ // If the read will cause us to go over the available bytes,
+ // reduce the size so that we stay in the available range.
+ // Otherwise the input stream may not be able to seek back.
+ if (size > in.available()) {
+ size = in.available();
+ }
+
+ int bytesRead = in.read(buffer, offset, size);
+ if (bytesRead >= 0) {
+ mPosition += bytesRead;
+ return bytesRead;
+ }
+ } catch (IOException e) {}
+ mPosition = -1; // need to seek on next read
+ return -1;
+ }
+
+ @Override
+ public long getSize() throws IOException {
+ return -1;
+ }
+ });
String exifOffsetStr = retriever.extractMetadata(
MediaMetadataRetriever.METADATA_KEY_EXIF_OFFSET);
diff --git a/media/java/android/media/ThumbnailUtils.java b/media/java/android/media/ThumbnailUtils.java
index cf3ba87..e6d95eb6 100644
--- a/media/java/android/media/ThumbnailUtils.java
+++ b/media/java/android/media/ThumbnailUtils.java
@@ -49,7 +49,6 @@
import libcore.io.IoUtils;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
@@ -256,19 +255,17 @@
// get orientation
if (MediaFile.isExifMimeType(mimeType)) {
- try (FileInputStream is = new FileInputStream(file)) {
- exif = new ExifInterface(is.getFD());
- switch (exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 0)) {
- case ExifInterface.ORIENTATION_ROTATE_90:
- orientation = 90;
- break;
- case ExifInterface.ORIENTATION_ROTATE_180:
- orientation = 180;
- break;
- case ExifInterface.ORIENTATION_ROTATE_270:
- orientation = 270;
- break;
- }
+ exif = new ExifInterface(file);
+ switch (exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 0)) {
+ case ExifInterface.ORIENTATION_ROTATE_90:
+ orientation = 90;
+ break;
+ case ExifInterface.ORIENTATION_ROTATE_180:
+ orientation = 180;
+ break;
+ case ExifInterface.ORIENTATION_ROTATE_270:
+ orientation = 270;
+ break;
}
}
diff --git a/media/java/android/mtp/OWNERS b/media/java/android/mtp/OWNERS
index 1928ba8..6b5336e 100644
--- a/media/java/android/mtp/OWNERS
+++ b/media/java/android/mtp/OWNERS
@@ -1,6 +1,9 @@
set noparent
-marcone@google.com
+aprasath@google.com
+anothermark@google.com
+kumarashishg@google.com
+sarup@google.com
jsharkey@android.com
jameswei@google.com
rmojumder@google.com
diff --git a/media/jni/OWNERS b/media/jni/OWNERS
index 445672b..96894d1 100644
--- a/media/jni/OWNERS
+++ b/media/jni/OWNERS
@@ -1,5 +1,5 @@
# extra for MTP related files
-per-file android_mtp_*.cpp=marcone@google.com,jsharkey@android.com,jameswei@google.com,rmojumder@google.com
+per-file android_mtp_*.cpp=aprasath@google.com,anothermark@google.com,kumarashishg@google.com,sarup@google.com,jsharkey@android.com,jameswei@google.com,rmojumder@google.com
# extra for TV related files
per-file android_media_tv_*=hgchen@google.com,quxiangfang@google.com
diff --git a/media/tests/MtpTests/OWNERS b/media/tests/MtpTests/OWNERS
index 1928ba8..6b5336e 100644
--- a/media/tests/MtpTests/OWNERS
+++ b/media/tests/MtpTests/OWNERS
@@ -1,6 +1,9 @@
set noparent
-marcone@google.com
+aprasath@google.com
+anothermark@google.com
+kumarashishg@google.com
+sarup@google.com
jsharkey@android.com
jameswei@google.com
rmojumder@google.com
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 84a5593..9d569630 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -5001,14 +5001,15 @@
Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY);
final boolean supportMagnificationArea = getContext().getResources().getBoolean(
com.android.internal.R.bool.config_magnification_area);
- final int capability = supportMagnificationArea
- ? R.integer.def_accessibility_magnification_capabilities
- : Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN;
final String supportShowPrompt = supportMagnificationArea ? "1" : "0";
if (magnificationCapabilities.isNull()) {
+ final int capability = supportMagnificationArea
+ ? getContext().getResources().getInteger(
+ R.integer.def_accessibility_magnification_capabilities)
+ : Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN;
secureSettings.insertSettingLocked(
Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY,
- String.valueOf(getContext().getResources().getInteger(capability)),
+ String.valueOf(capability),
null, true, SettingsState.SYSTEM_PACKAGE_NAME);
if (isMagnificationSettingsOn(secureSettings)) {
diff --git a/services/companion/OWNERS b/services/companion/OWNERS
index cb4cc56..734d8b6 100644
--- a/services/companion/OWNERS
+++ b/services/companion/OWNERS
@@ -1,4 +1 @@
-evanxinchen@google.com
-ewol@google.com
-guojing@google.com
-svetoslavganov@google.com
\ No newline at end of file
+include /core/java/android/companion/OWNERS
\ No newline at end of file
diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java
index d3b7606..257d698 100644
--- a/services/core/java/com/android/server/audio/BtHelper.java
+++ b/services/core/java/com/android/server/audio/BtHelper.java
@@ -266,8 +266,8 @@
if (AudioService.DEBUG_VOL) {
AudioService.sVolumeLogger.log(new AudioEventLogger.StringEvent(
"setAvrcpAbsoluteVolumeIndex: bailing due to null mA2dp").printLog(TAG));
- return;
}
+ return;
}
if (!mAvrcpAbsVolSupported) {
AudioService.sVolumeLogger.log(new AudioEventLogger.StringEvent(
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index e85eee81..6b69e1c 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -1389,7 +1389,7 @@
}
// Check that the caller is authorized.
- enforceControlPermission();
+ enforceControlPermissionOrInternalCaller();
// Stop an existing always-on VPN from being dethroned by other apps.
if (mAlwaysOn && !isCurrentPreparedPackage(newPackage)) {
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
index 91f14de..6c8ba16 100644
--- a/services/core/java/com/android/server/lights/LightsService.java
+++ b/services/core/java/com/android/server/lights/LightsService.java
@@ -465,9 +465,10 @@
}
for (int i = mLightsById.size() - 1; i >= 0; i--) {
- final int type = mLightsById.keyAt(i);
+ LightImpl light = mLightsById.valueAt(i);
+ final int type = light.mHwLight.type;
if (0 <= type && type < mLightsByType.length) {
- mLightsByType[type] = mLightsById.valueAt(i);
+ mLightsByType[type] = light;
}
}
}
diff --git a/services/core/java/com/android/server/pm/Installer.java b/services/core/java/com/android/server/pm/Installer.java
index a078b5d..e826bf1 100644
--- a/services/core/java/com/android/server/pm/Installer.java
+++ b/services/core/java/com/android/server/pm/Installer.java
@@ -390,7 +390,7 @@
args[j] = mArgs.get(i + j);
}
final CreateAppDataResult[] results = installer.createAppDataBatched(args);
- for (int j = 0; j < args.length; j++) {
+ for (int j = 0; j < results.length; j++) {
final CreateAppDataResult result = results[j];
final CompletableFuture<Long> future = mFutures.get(i + j);
if (result.exceptionCode == 0) {
diff --git a/services/core/java/com/android/server/power/batterysaver/OWNERS b/services/core/java/com/android/server/power/batterysaver/OWNERS
index 09136dc..cf23bea 100644
--- a/services/core/java/com/android/server/power/batterysaver/OWNERS
+++ b/services/core/java/com/android/server/power/batterysaver/OWNERS
@@ -1 +1,3 @@
+kwekua@google.com
omakoto@google.com
+yamasani@google.com
\ No newline at end of file
diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
index 3d8b293..62c203b 100644
--- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
+++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
@@ -4513,7 +4513,7 @@
List<Integer> disabledSurroundEncodingsList = new ArrayList<>();
List<Integer> enabledSurroundEncodingsList = new ArrayList<>();
for (int surroundEncoding : surroundEncodingsMap.keySet()) {
- if (!surroundEncodingsMap.get(surroundEncoding)) {
+ if (!audioManager.isSurroundFormatEnabled(surroundEncoding)) {
disabledSurroundEncodingsList.add(surroundEncoding);
} else {
enabledSurroundEncodingsList.add(surroundEncoding);
diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java
index 1d21b9d..283e12a 100644
--- a/services/core/java/com/android/server/wm/KeyguardController.java
+++ b/services/core/java/com/android/server/wm/KeyguardController.java
@@ -661,8 +661,7 @@
display.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
}
- if (mTopTurnScreenOnActivity != lastTurnScreenOnActivity
- && mTopTurnScreenOnActivity != null
+ if (mTopTurnScreenOnActivity != null
&& !mService.mWindowManager.mPowerManager.isInteractive()
&& (mRequestDismissKeyguard || occludedByActivity)) {
controller.mTaskSupervisor.wakeUp("handleTurnScreenOn");
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 25bacfc..5fb4716 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -2004,14 +2004,17 @@
t.traceEnd();
}
- t.traceBegin("StartPacProxyService");
- try {
- pacProxyService = new PacProxyService(context);
- ServiceManager.addService(Context.PAC_PROXY_SERVICE, pacProxyService);
- } catch (Throwable e) {
- reportWtf("starting PacProxyService", e);
+ // Devices without WebView/JavaScript cannot support PAC proxies.
+ if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WEBVIEW)) {
+ t.traceBegin("StartPacProxyService");
+ try {
+ pacProxyService = new PacProxyService(context);
+ ServiceManager.addService(Context.PAC_PROXY_SERVICE, pacProxyService);
+ } catch (Throwable e) {
+ reportWtf("starting PacProxyService", e);
+ }
+ t.traceEnd();
}
- t.traceEnd();
t.traceBegin("StartConnectivityService");
// This has to be called after NetworkManagementService, NetworkStatsService
diff --git a/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetAidl.java b/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetAidl.java
index bdfe60a..f38ee5c 100644
--- a/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetAidl.java
+++ b/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetAidl.java
@@ -66,10 +66,6 @@
return GADGET_HAL_V2_0;
}
- @Override
- public void systemReady() {
- }
-
public void serviceDied() {
logAndPrint(Log.ERROR, mPw, "Usb Gadget AIDL hal service died");
synchronized (mGadgetProxyLock) {
diff --git a/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHal.java b/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHal.java
index 267247b..116eb43 100644
--- a/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHal.java
+++ b/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHal.java
@@ -29,69 +29,6 @@
*/
public interface UsbGadgetHal {
/**
- * Power role: This USB port can act as a source (provide power).
- * @hide
- */
- public static final int HAL_POWER_ROLE_SOURCE = 1;
-
- /**
- * Power role: This USB port can act as a sink (receive power).
- * @hide
- */
- public static final int HAL_POWER_ROLE_SINK = 2;
-
- @IntDef(prefix = { "HAL_POWER_ROLE_" }, value = {
- HAL_POWER_ROLE_SOURCE,
- HAL_POWER_ROLE_SINK
- })
- @Retention(RetentionPolicy.SOURCE)
- @interface HalUsbPowerRole{}
-
- /**
- * Data role: This USB port can act as a host (access data services).
- * @hide
- */
- public static final int HAL_DATA_ROLE_HOST = 1;
-
- /**
- * Data role: This USB port can act as a device (offer data services).
- * @hide
- */
- public static final int HAL_DATA_ROLE_DEVICE = 2;
-
- @IntDef(prefix = { "HAL_DATA_ROLE_" }, value = {
- HAL_DATA_ROLE_HOST,
- HAL_DATA_ROLE_DEVICE
- })
- @Retention(RetentionPolicy.SOURCE)
- @interface HalUsbDataRole{}
-
- /**
- * This USB port can act as a downstream facing port (host).
- *
- * @hide
- */
- public static final int HAL_MODE_DFP = 1;
-
- /**
- * This USB port can act as an upstream facing port (device).
- *
- * @hide
- */
- public static final int HAL_MODE_UFP = 2;
- @IntDef(prefix = { "HAL_MODE_" }, value = {
- HAL_MODE_DFP,
- HAL_MODE_UFP,
- })
- @Retention(RetentionPolicy.SOURCE)
- @interface HalUsbPortMode{}
-
- /**
- * UsbPortManager would call this when the system is done booting.
- */
- public void systemReady();
-
- /**
* This function is used to query the USB functions included in the
* current USB configuration.
*
diff --git a/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHidl.java b/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHidl.java
index 3e5ecc5..13a1670 100644
--- a/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHidl.java
+++ b/services/usb/java/com/android/server/usb/hal/gadget/UsbGadgetHidl.java
@@ -123,10 +123,6 @@
}
}
- @Override
- public void systemReady() {
- }
-
static boolean isServicePresent(IndentingPrintWriter pw) {
try {
IUsbGadget.getService(true);
diff --git a/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java b/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java
index f98c598..45de058 100644
--- a/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java
+++ b/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java
@@ -70,17 +70,17 @@
*
* @hide
*/
- public static final int HAL_MODE_DFP = 1;
+ public static final int HAL_MODE_UFP = 1;
/**
* This USB port can act as an upstream facing port (device).
*
* @hide
*/
- public static final int HAL_MODE_UFP = 2;
+ public static final int HAL_MODE_DFP = 2;
@IntDef(prefix = { "HAL_MODE_" }, value = {
- HAL_MODE_DFP,
HAL_MODE_UFP,
+ HAL_MODE_DFP,
})
@Retention(RetentionPolicy.SOURCE)
@interface HalUsbPortMode{}
diff --git a/tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml b/tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml
index 0ab3dfe..f8a1ec9 100644
--- a/tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml
+++ b/tests/DynamicCodeLoggerIntegrationTests/AndroidTest.xml
@@ -22,9 +22,6 @@
<option name="test-suite-tag" value="apct"/>
<option name="test-tag" value="DynamicCodeLoggerIntegrationTests"/>
- <!-- This test make uses of the event log, make sure we capture it. -->
- <option name="logcat-options" value="-b all" />
-
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
<option name="package" value="com.android.frameworks.dynamiccodeloggertest"/>
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner"/>