Merge "Fuzz incident AIDL service"
diff --git a/OWNERS b/OWNERS
index dad8bfe..4860acc 100644
--- a/OWNERS
+++ b/OWNERS
@@ -38,3 +38,4 @@
per-file TestProtoLibraries.bp = file:platform/tools/tradefederation:/OWNERS
per-file ZYGOTE_OWNERS = file:/ZYGOTE_OWNERS
+per-file SQLITE_OWNERS = file:/SQLITE_OWNERS
diff --git a/SQLITE_OWNERS b/SQLITE_OWNERS
new file mode 100644
index 0000000..1ff72e7
--- /dev/null
+++ b/SQLITE_OWNERS
@@ -0,0 +1,2 @@
+shayba@google.com
+shombert@google.com
diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
index b995b06..3910a08 100644
--- a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
+++ b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java
@@ -52,7 +52,7 @@
}
}
- @Test
+ @Test(timeout = 900)
public void timeClonedDateFormatTimeInstance() {
DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
diff --git a/cmds/bootanimation/FORMAT.md b/cmds/bootanimation/FORMAT.md
index 64814c8..4abffd7 100644
--- a/cmds/bootanimation/FORMAT.md
+++ b/cmds/bootanimation/FORMAT.md
@@ -153,14 +153,14 @@
To enable it, add the following line as the second line of desc.txt:
- dynamic_colors PATH #RGBHEX0 #RGBHEX1 #RGBHEX2 #RGBHEX3
+ dynamic_colors PATH #RGBHEX1 #RGBHEX2 #RGBHEX3 #RGBHEX4
* **PATH:** file path of the part to apply dynamic color transition to.
Any part before this part will be rendered in the start colors.
Any part after will be rendered in the end colors.
* **RGBHEX1:** the first start color (masked by the R channel), specified as `#RRGGBB`.
* **RGBHEX2:** the second start color (masked by the G channel), specified as `#RRGGBB`.
- * **RGBHEX3:** the thrid start color (masked by the B channel), specified as `#RRGGBB`.
+ * **RGBHEX3:** the third start color (masked by the B channel), specified as `#RRGGBB`.
* **RGBHEX4:** the forth start color (masked by the A channel), specified as `#RRGGBB`.
The end colors will be read from the following system properties:
diff --git a/core/api/system-lint-baseline.txt b/core/api/system-lint-baseline.txt
index 025e862..0100f0e 100644
--- a/core/api/system-lint-baseline.txt
+++ b/core/api/system-lint-baseline.txt
@@ -143,12 +143,16 @@
SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioFocusRequest.Builder.setOnAudioFocusChangeListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioManager#requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, int, int):
SAM-compatible parameters (such as parameter 1, "l", in android.media.AudioManager.requestAudioFocus) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.media.AudioRecord#addOnRoutingChangedListener(android.media.AudioRecord.OnRoutingChangedListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioRecord.addOnRoutingChangedListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioRecord#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioRecord.addOnRoutingChangedListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioRouting#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioRouting.addOnRoutingChangedListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.AudioTrack#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioTrack.addOnRoutingChangedListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
+SamShouldBeLast: android.media.AudioTrack#addOnRoutingChangedListener(android.media.AudioTrack.OnRoutingChangedListener, android.os.Handler):
+ SAM-compatible parameters (such as parameter 1, "listener", in android.media.AudioTrack.addOnRoutingChangedListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.MediaCodec#setOnFrameRenderedListener(android.media.MediaCodec.OnFrameRenderedListener, android.os.Handler):
SAM-compatible parameters (such as parameter 1, "listener", in android.media.MediaCodec.setOnFrameRenderedListener) should be last to improve Kotlin interoperability; see https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions
SamShouldBeLast: android.media.MediaPlayer#addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler):
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index e85fa9d..1807fb6 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -5369,8 +5369,8 @@
* result callbacks including {@link #onRequestPermissionsResult(int, String[], int[])}.
* </p>
* <p>
- * The <a href="https://github.com/android/permissions-samples">
- * RuntimePermissions</a> sample apps demonstrate how to use this method to
+ * The <a href="https://github.com/android/platform-samples/tree/main/samples/privacy/permissions">
+ * permissions samples</a> repo demonstrates how to use this method to
* request permissions at run time.
* </p>
*
diff --git a/core/java/android/app/assist/OWNERS b/core/java/android/app/assist/OWNERS
index 80ecaa4..e4ffd7f 100644
--- a/core/java/android/app/assist/OWNERS
+++ b/core/java/android/app/assist/OWNERS
@@ -1,7 +1,2 @@
-augale@google.com
-joannechung@google.com
-markpun@google.com
-lpeter@google.com
-tymtsai@google.com
hackz@google.com
volnov@google.com
\ No newline at end of file
diff --git a/core/java/android/database/sqlite/OWNERS b/core/java/android/database/sqlite/OWNERS
new file mode 100644
index 0000000..3bebc7c
--- /dev/null
+++ b/core/java/android/database/sqlite/OWNERS
@@ -0,0 +1 @@
+include /SQLITE_OWNERS
diff --git a/core/java/android/os/image/DynamicSystemManager.java b/core/java/android/os/image/DynamicSystemManager.java
index 9610b16..536795b 100644
--- a/core/java/android/os/image/DynamicSystemManager.java
+++ b/core/java/android/os/image/DynamicSystemManager.java
@@ -285,4 +285,16 @@
throw new RuntimeException(e.toString());
}
}
+
+ /**
+ * Returns the active DSU slot
+ */
+ @RequiresPermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
+ public String getActiveDsuSlot() {
+ try {
+ return mService.getActiveDsuSlot();
+ } catch (RemoteException e) {
+ throw new RuntimeException(e.toString());
+ }
+ }
}
diff --git a/core/java/android/os/image/IDynamicSystemService.aidl b/core/java/android/os/image/IDynamicSystemService.aidl
index 755368a..0280ebb 100644
--- a/core/java/android/os/image/IDynamicSystemService.aidl
+++ b/core/java/android/os/image/IDynamicSystemService.aidl
@@ -145,4 +145,10 @@
*/
@EnforcePermission("MANAGE_DYNAMIC_SYSTEM")
long suggestScratchSize();
+
+ /**
+ * Get the active DSU slot
+ */
+ @EnforcePermission("MANAGE_DYNAMIC_SYSTEM")
+ String getActiveDsuSlot();
}
diff --git a/core/java/android/view/contentcapture/OWNERS b/core/java/android/view/contentcapture/OWNERS
index d1eda96..43be4f6 100644
--- a/core/java/android/view/contentcapture/OWNERS
+++ b/core/java/android/view/contentcapture/OWNERS
@@ -1,9 +1,4 @@
# Bug component: 544200
-augale@google.com
-joannechung@google.com
-markpun@google.com
-lpeter@google.com
-tymtsai@google.com
hackz@google.com
volnov@google.com
\ No newline at end of file
diff --git a/core/java/com/android/internal/jank/OWNERS b/core/java/com/android/internal/jank/OWNERS
index 352c132..2f3bbee 100644
--- a/core/java/com/android/internal/jank/OWNERS
+++ b/core/java/com/android/internal/jank/OWNERS
@@ -3,4 +3,5 @@
# Jank people
ahanwu@google.com
vadimt@google.com
-marcinoc@google.com
\ No newline at end of file
+marcinoc@google.com
+pmuetschard@google.com
\ No newline at end of file
diff --git a/core/jni/OWNERS b/core/jni/OWNERS
index 84b050c..a17048c 100644
--- a/core/jni/OWNERS
+++ b/core/jni/OWNERS
@@ -102,3 +102,6 @@
# PM
per-file com_android_internal_content_* = file:/PACKAGE_MANAGER_OWNERS
+
+# SQLite
+per-file android_database_SQLite* = file:/SQLITE_OWNERS
diff --git a/core/tests/coretests/src/android/database/sqlite/OWNERS b/core/tests/coretests/src/android/database/sqlite/OWNERS
new file mode 100644
index 0000000..3bebc7c
--- /dev/null
+++ b/core/tests/coretests/src/android/database/sqlite/OWNERS
@@ -0,0 +1 @@
+include /SQLITE_OWNERS
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
index 5e42f70..e78de49 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
@@ -423,7 +423,10 @@
Log.e(TAG, "It's already running in normal system.");
return;
}
-
+ if (mDynSystem.getActiveDsuSlot().endsWith(".lock")) {
+ Log.e(TAG, "Ignore the reboot intent for a locked DSU slot");
+ return;
+ }
if (!mDynSystem.setEnable(/* enable = */ false, /* oneShot = */ false)) {
Log.e(TAG, "Failed to disable DynamicSystem.");
diff --git a/packages/PackageInstaller/Android.bp b/packages/PackageInstaller/Android.bp
index 4757513..565a51f 100644
--- a/packages/PackageInstaller/Android.bp
+++ b/packages/PackageInstaller/Android.bp
@@ -46,6 +46,10 @@
"xz-java",
"androidx.leanback_leanback",
],
+
+ lint: {
+ error_checks: ["Recycle"],
+ },
}
android_app {
@@ -64,6 +68,10 @@
"androidx.leanback_leanback",
],
aaptflags: ["--product tablet"],
+
+ lint: {
+ error_checks: ["Recycle"],
+ },
}
android_app {
@@ -82,4 +90,8 @@
"androidx.leanback_leanback",
],
aaptflags: ["--product tv"],
+
+ lint: {
+ error_checks: ["Recycle"],
+ },
}
diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbContaminantActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbContaminantActivity.java
index d10e890..534049b 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/UsbContaminantActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/UsbContaminantActivity.java
@@ -75,7 +75,12 @@
mLearnMore.setVisibility(View.VISIBLE);
}
- mEnableUsb.setOnClickListener(this);
+ if (!mUsbPort.supportsEnableContaminantPresenceDetection()) {
+ mEnableUsb.setVisibility(View.GONE);
+ } else {
+ mEnableUsb.setOnClickListener(this);
+ }
+
mGotIt.setOnClickListener(this);
mLearnMore.setOnClickListener(this);
}
diff --git a/services/core/java/com/android/server/DynamicSystemService.java b/services/core/java/com/android/server/DynamicSystemService.java
index b0c1d05..cbacee6 100644
--- a/services/core/java/com/android/server/DynamicSystemService.java
+++ b/services/core/java/com/android/server/DynamicSystemService.java
@@ -226,9 +226,7 @@
IGsiService gsiService = getGsiService();
if (enable) {
try {
- if (mDsuSlot == null) {
- mDsuSlot = gsiService.getActiveDsuSlot();
- }
+ getActiveDsuSlot();
GsiServiceCallback callback = new GsiServiceCallback();
synchronized (callback) {
gsiService.enableGsiAsync(oneShot, mDsuSlot, callback);
@@ -287,4 +285,15 @@
return getGsiService().suggestScratchSize();
}
+
+ @Override
+ @EnforcePermission(android.Manifest.permission.MANAGE_DYNAMIC_SYSTEM)
+ public String getActiveDsuSlot() throws RemoteException {
+ super.getActiveDsuSlot_enforcePermission();
+
+ if (mDsuSlot == null) {
+ mDsuSlot = getGsiService().getActiveDsuSlot();
+ }
+ return mDsuSlot;
+ }
}
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 2aa9378..17cdfdb2 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -56,7 +56,6 @@
import android.net.NetworkStack;
import android.net.NetworkStats;
import android.net.RouteInfo;
-import android.net.UidRangeParcel;
import android.net.util.NetdService;
import android.os.BatteryStats;
import android.os.Binder;
@@ -97,7 +96,6 @@
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -1346,70 +1344,6 @@
}
}
- private void closeSocketsForFirewallChainLocked(int chain, String chainName) {
- // UID ranges to close sockets on.
- UidRangeParcel[] ranges;
- // UID ranges whose sockets we won't touch.
- int[] exemptUids;
-
- int numUids = 0;
- if (DBG) Slog.d(TAG, "Closing sockets after enabling chain " + chainName);
- if (getFirewallType(chain) == FIREWALL_ALLOWLIST) {
- // Close all sockets on all non-system UIDs...
- ranges = new UidRangeParcel[] {
- // TODO: is there a better way of finding all existing users? If so, we could
- // specify their ranges here.
- new UidRangeParcel(Process.FIRST_APPLICATION_UID, Integer.MAX_VALUE),
- };
- // ... except for the UIDs that have allow rules.
- synchronized (mRulesLock) {
- final SparseIntArray rules = getUidFirewallRulesLR(chain);
- exemptUids = new int[rules.size()];
- for (int i = 0; i < exemptUids.length; i++) {
- if (rules.valueAt(i) == FIREWALL_RULE_ALLOW) {
- exemptUids[numUids] = rules.keyAt(i);
- numUids++;
- }
- }
- }
- // Normally, allowlist chains only contain deny rules, so numUids == exemptUids.length.
- // But the code does not guarantee this in any way, and at least in one case - if we add
- // a UID rule to the firewall, and then disable the firewall - the chains can contain
- // the wrong type of rule. In this case, don't close connections that we shouldn't.
- //
- // TODO: tighten up this code by ensuring we never set the wrong type of rule, and
- // fix setFirewallEnabled to grab mQuotaLock and clear rules.
- if (numUids != exemptUids.length) {
- exemptUids = Arrays.copyOf(exemptUids, numUids);
- }
- } else {
- // Close sockets for every UID that has a deny rule...
- synchronized (mRulesLock) {
- final SparseIntArray rules = getUidFirewallRulesLR(chain);
- ranges = new UidRangeParcel[rules.size()];
- for (int i = 0; i < ranges.length; i++) {
- if (rules.valueAt(i) == FIREWALL_RULE_DENY) {
- int uid = rules.keyAt(i);
- ranges[numUids] = new UidRangeParcel(uid, uid);
- numUids++;
- }
- }
- }
- // As above; usually numUids == ranges.length, but not always.
- if (numUids != ranges.length) {
- ranges = Arrays.copyOf(ranges, numUids);
- }
- // ... with no exceptions.
- exemptUids = new int[0];
- }
-
- try {
- mNetdService.socketDestroy(ranges, exemptUids);
- } catch(RemoteException | ServiceSpecificException e) {
- Slog.e(TAG, "Error closing sockets after enabling chain " + chainName + ": " + e);
- }
- }
-
@Override
public void setFirewallChainEnabled(int chain, boolean enable) {
enforceSystemUid();
@@ -1434,14 +1368,6 @@
} catch (RuntimeException e) {
throw new IllegalStateException(e);
}
-
- // Close any sockets that were opened by the affected UIDs. This has to be done after
- // disabling network connectivity, in case they react to the socket close by reopening
- // the connection and race with the iptables commands that enable the firewall. All
- // allowlist and denylist chains allow RSTs through.
- if (enable) {
- closeSocketsForFirewallChainLocked(chain, chainName);
- }
}
}
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
index e1ae8d9..c161d8d4 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
@@ -1787,7 +1787,7 @@
try {
mCb.unlinkToDeath(this, 0);
} catch (NoSuchElementException e) {
- Log.w(TAG, "CommunicationRouteClient could not not unregistered to binder");
+ Log.w(TAG, "CommunicationRouteClient could not unlink to " + mCb + " binder death");
}
}
diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
index 8f23ae4..4007672 100644
--- a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
+++ b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
@@ -34,6 +34,8 @@
import android.os.UpdateEngine;
import android.os.UpdateEngineCallback;
import android.provider.DeviceConfig;
+import android.provider.Settings;
+import android.provider.Settings.SettingNotFoundException;
import android.util.Log;
import com.android.internal.R;
@@ -332,8 +334,17 @@
Context context = getContext();
BackgroundThread.get().getThreadHandler().post(() -> {
try {
+ int usageSetting = -1;
+ try {
+ // Get "Usage & diagnostics" checkbox status. 1 is for enabled, 0 is for
+ // disabled.
+ usageSetting = Settings.Global.getInt(context.getContentResolver(), "multi_cb");
+ } catch (SettingNotFoundException e) {
+ Log.i(LOG_TAG, "Usage setting not found: " + e.getMessage());
+ }
+
// Prepare profile report
- String reportName = mIProfcollect.report() + ".zip";
+ String reportName = mIProfcollect.report(usageSetting) + ".zip";
if (!context.getResources().getBoolean(
R.bool.config_profcollectReportUploaderEnabled)) {
diff --git a/services/tests/RemoteProvisioningServiceTests/Android.bp b/services/tests/RemoteProvisioningServiceTests/Android.bp
index 075680a..fc2c085 100644
--- a/services/tests/RemoteProvisioningServiceTests/Android.bp
+++ b/services/tests/RemoteProvisioningServiceTests/Android.bp
@@ -31,6 +31,7 @@
"service-rkp.impl",
"services.core",
"truth-prebuilt",
+ "truth-java8-extension-jar",
],
test_suites: [
"device-tests",
diff --git a/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java b/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java
index 77c3396..2d93120 100644
--- a/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java
+++ b/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java
@@ -17,6 +17,7 @@
package com.android.server.security.rkp;
import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth8.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
@@ -42,7 +43,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.util.Arrays;
import java.util.Base64;
import java.util.Map;
@@ -119,6 +119,7 @@
assertThat(res.getErr()).isEmpty();
assertThat(res.getCode()).isEqualTo(0);
assertThat(res.getOut()).isEmpty();
+ assertThat(res.getOut().lines()).isEmpty();
}
@Test
@@ -128,7 +129,7 @@
CommandResult res = exec(cmd, new String[] {"list"});
assertThat(res.getErr()).isEmpty();
assertThat(res.getCode()).isEqualTo(0);
- assertThat(Arrays.asList(res.getOut().split("\n"))).containsExactly("default");
+ assertThat(res.getOut().lines()).containsExactly("default");
}
@Test
@@ -140,7 +141,7 @@
CommandResult res = exec(cmd, new String[] {"list"});
assertThat(res.getErr()).isEmpty();
assertThat(res.getCode()).isEqualTo(0);
- assertThat(Arrays.asList(res.getOut().split("\n"))).containsExactly("default", "strongbox");
+ assertThat(res.getOut().lines()).containsExactly("default", "strongbox");
}
@Test
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java
index 094bcfb..a4a35dc 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/RecoverableKeyStoreManagerTest.java
@@ -858,6 +858,7 @@
}
}
+ @Ignore("Causing breakages so ignoring to resolve, b/281583079")
@Test
public void startRecoverySessionWithCertPath_throwsIfBadNumberOfSecrets() throws Exception {
try {
@@ -875,6 +876,7 @@
}
}
+ @Ignore("Causing breakages so ignoring to resolve, b/281583079")
@Test
public void startRecoverySessionWithCertPath_throwsIfPublicKeysMismatch() throws Exception {
byte[] vaultParams = TEST_VAULT_PARAMS.clone();