Merge "Add listener once for volume row animation"
diff --git a/INTENT_OWNERS b/INTENT_OWNERS
new file mode 100644
index 0000000..58b5f2a
--- /dev/null
+++ b/INTENT_OWNERS
@@ -0,0 +1,3 @@
+include /PACKAGE_MANAGER_OWNERS
+include /services/core/java/com/android/server/wm/OWNERS
+include /services/core/java/com/android/server/am/OWNERS
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/OWNERS b/apct-tests/perftests/core/OWNERS
index 6abab6e..f8fe51c 100644
--- a/apct-tests/perftests/core/OWNERS
+++ b/apct-tests/perftests/core/OWNERS
@@ -12,3 +12,5 @@
per-file /apct-tests/perftests/core/src/android/content/om/* = felkachang@google.com
per-file /apct-tests/perftests/core/src/android/content/om/* = file:/core/java/android/content/om/OWNERS
+# Bug component: 44215
+per-file **Accessibility* = file:/core/java/android/view/accessibility/OWNERS
\ No newline at end of file
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp
index f08745b..93d20dd 100644
--- a/api/StubLibraries.bp
+++ b/api/StubLibraries.bp
@@ -213,7 +213,6 @@
system_modules: "none",
java_version: "1.8",
compile_dex: true,
- defaults_visibility: ["//visibility:private"],
visibility: ["//visibility:public"],
}
@@ -230,8 +229,6 @@
tag: ".jar",
dest: "android-non-updatable.jar",
},
- defaults_visibility: ["//visibility:private"],
- visibility: ["//visibility:private"],
}
java_library {
@@ -283,6 +280,57 @@
}
java_defaults {
+ name: "non_updatable_api_library_defaults",
+ static_libs: ["framework-res-package-jar"],
+ libs: ["stub-annotations"],
+}
+
+java_api_library {
+ name: "android-non-updatable.stubs.from-text",
+ api_surface: "public",
+ api_files: [
+ ":non-updatable-current.txt",
+ ],
+ defaults: ["non_updatable_api_library_defaults"],
+ dep_api_srcs: "android_stubs_current.from-text",
+}
+
+java_api_library {
+ name: "android-non-updatable.stubs.system.from-text",
+ api_surface: "system",
+ api_files: [
+ ":non-updatable-current.txt",
+ ":non-updatable-system-current.txt",
+ ],
+ defaults: ["non_updatable_api_library_defaults"],
+ dep_api_srcs: "android_system_stubs_current.from-text",
+}
+
+java_api_library {
+ name: "android-non-updatable.stubs.test.from-text",
+ api_surface: "test",
+ api_files: [
+ ":non-updatable-current.txt",
+ ":non-updatable-system-current.txt",
+ ":non-updatable-test-current.txt",
+ ],
+ defaults: ["non_updatable_api_library_defaults"],
+ dep_api_srcs: "android_test_stubs_current.from-text",
+}
+
+java_api_library {
+ name: "android-non-updatable.stubs.module_lib.from-text",
+ api_surface: "module_lib",
+ api_files: [
+ ":non-updatable-current.txt",
+ ":non-updatable-system-current.txt",
+ ":non-updatable-module-lib-current.txt",
+ ],
+ defaults: ["non_updatable_api_library_defaults"],
+ dep_api_srcs: "android_module_lib_stubs_current_full.from-text",
+}
+
+java_defaults {
name: "android_stubs_dists_default",
dist: {
targets: ["sdk"],
@@ -402,7 +450,6 @@
java_genrule {
name: "android_stubs_private_hjar",
- visibility: ["//visibility:private"],
srcs: [":android_stubs_private_jar{.hjar}"],
out: ["android_stubs_private.jar"],
cmd: "cp $(in) $(out)",
@@ -411,7 +458,6 @@
java_library {
name: "android_stubs_private",
defaults: ["android_stubs_dists_default"],
- visibility: ["//visibility:private"],
sdk_version: "none",
system_modules: "none",
static_libs: ["android_stubs_private_hjar"],
@@ -422,7 +468,6 @@
java_genrule {
name: "android_stubs_private_framework_aidl",
- visibility: ["//visibility:private"],
tools: ["sdkparcelables"],
srcs: [":android_stubs_private"],
out: ["framework.aidl"],
@@ -586,7 +631,6 @@
"metalava-manual",
],
args: priv_apps,
- visibility: ["//visibility:private"],
}
java_library {
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/cmds/incidentd/Android.bp b/cmds/incidentd/Android.bp
index b0b23f5..bd30404 100644
--- a/cmds/incidentd/Android.bp
+++ b/cmds/incidentd/Android.bp
@@ -82,17 +82,11 @@
},
},
-
init_rc: ["incidentd.rc"],
}
-// ==============
-// incidentd_test
-// ==============
-
-cc_test {
- name: "incidentd_test",
- test_suites: ["device-tests"],
+cc_defaults {
+ name: "incidentd_test_defaults",
cflags: [
"-Werror",
@@ -110,8 +104,6 @@
generated_headers: ["framework-cppstream-protos"],
srcs: [
- "tests/**/*.cpp",
- "tests/**/*.proto",
"src/FdBuffer.cpp",
"src/Privacy.cpp",
"src/PrivacyFilter.cpp",
@@ -125,13 +117,11 @@
"src/**/*.proto",
],
- data: ["testdata/**/*"],
-
static_libs: [
- "libgmock",
"libincidentcompanion",
"libplatformprotos-test",
],
+
shared_libs: [
"libbase",
"libbinder",
@@ -144,6 +134,30 @@
"libservices",
"libutils",
],
+}
+
+// ==============
+// incidentd_test
+// ==============
+cc_test {
+ name: "incidentd_test",
+
+ defaults: [
+ "incidentd_test_defaults",
+ ],
+
+ test_suites: ["device-tests"],
+
+ srcs: [
+ "tests/**/*.cpp",
+ "tests/**/*.proto",
+ ],
+
+ data: ["testdata/**/*"],
+
+ static_libs: [
+ "libgmock",
+ ],
target: {
android: {
@@ -160,3 +174,27 @@
out: ["section_list.cpp"],
cmd: "$(location incident-section-gen) incidentd > $(out)",
}
+
+cc_fuzz {
+ name: "incidentd_service_fuzzer",
+ defaults: [
+ "service_fuzzer_defaults",
+ "fuzzer_disable_leaks",
+ "incidentd_test_defaults",
+ ],
+
+ fuzz_config: {
+ cc: [
+ "yaochen@google.com",
+ "yanmin@google.com",
+ ],
+ triage_assignee: "waghpawan@google.com",
+ },
+
+ srcs: [
+ "fuzzers/IncidentServiceFuzzer.cpp",
+ "src/IncidentService.cpp",
+ "src/Broadcaster.cpp",
+ ":incidentd_section_list",
+ ],
+}
diff --git a/cmds/incidentd/fuzzers/IncidentServiceFuzzer.cpp b/cmds/incidentd/fuzzers/IncidentServiceFuzzer.cpp
new file mode 100644
index 0000000..14c969b
--- /dev/null
+++ b/cmds/incidentd/fuzzers/IncidentServiceFuzzer.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <fuzzbinder/libbinder_driver.h>
+#include <utils/Looper.h>
+
+#include "IncidentService.h"
+
+using ::android::fuzzService;
+using ::android::os::incidentd::IncidentService;
+using ::android::Looper;
+using ::android::sp;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ sp<Looper> looper(Looper::prepare(0));
+ sp<IncidentService> service = sp<IncidentService>::make(looper);
+ fuzzService(service, FuzzedDataProvider(data, size));
+ return 0;
+}
diff --git a/cmds/incidentd/src/IncidentService.cpp b/cmds/incidentd/src/IncidentService.cpp
index 5af02f4..05a43ad 100644
--- a/cmds/incidentd/src/IncidentService.cpp
+++ b/cmds/incidentd/src/IncidentService.cpp
@@ -513,6 +513,9 @@
sp<IShellCallback> shellCallback = IShellCallback::asInterface(data.readStrongBinder());
sp<IResultReceiver> resultReceiver =
IResultReceiver::asInterface(data.readStrongBinder());
+ if (resultReceiver == nullptr) {
+ return BAD_VALUE;
+ }
FILE* fin = fdopen(in, "r");
FILE* fout = fdopen(out, "w");
@@ -533,7 +536,7 @@
fflush(fout);
fclose(fout);
}
- if (fout != NULL) {
+ if (ferr != NULL) {
fflush(ferr);
fclose(ferr);
}
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index dc01662..6e61569 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -1697,6 +1697,10 @@
package android.os {
+ public class BatteryManager {
+ field public static final int BATTERY_PLUGGED_ANY = 15; // 0xf
+ }
+
public final class BatteryStatsManager {
method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void resetBattery(boolean);
method @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public void setBatteryLevel(int, boolean);
diff --git a/core/java/Android.bp b/core/java/Android.bp
index 8ceea92..5d7d7ba 100644
--- a/core/java/Android.bp
+++ b/core/java/Android.bp
@@ -31,9 +31,14 @@
srcs: ["android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl"],
}
-filegroup {
- name: "IDropBoxManagerService.aidl",
- srcs: ["com/android/internal/os/IDropBoxManagerService.aidl"],
+aidl_library {
+ name: "IDropBoxManagerService_aidl",
+ srcs: [
+ "com/android/internal/os/IDropBoxManagerService.aidl",
+ ],
+ hdrs: [
+ "android/os/DropBoxManager.aidl",
+ ],
}
filegroup {
@@ -146,7 +151,7 @@
],
}
-filegroup {
+aidl_library {
name: "ILogcatManagerService_aidl",
srcs: ["android/os/logcat/ILogcatManagerService.aidl"],
}
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/content/OWNERS b/core/java/android/content/OWNERS
index 2cde539..d984633 100644
--- a/core/java/android/content/OWNERS
+++ b/core/java/android/content/OWNERS
@@ -5,9 +5,7 @@
per-file *Sync* = file:/services/core/java/com/android/server/am/OWNERS
per-file IntentFilter.java = file:/PACKAGE_MANAGER_OWNERS
per-file IntentFilter.java = file:/services/core/java/com/android/server/am/OWNERS
-per-file Intent.java = file:/PACKAGE_MANAGER_OWNERS
-per-file Intent.java = file:/services/core/java/com/android/server/wm/OWNERS
-per-file Intent.java = file:/services/core/java/com/android/server/am/OWNERS
+per-file Intent.java = file:/INTENT_OWNERS
per-file AutofillOptions* = file:/core/java/android/service/autofill/OWNERS
per-file ContentCaptureOptions* = file:/core/java/android/service/contentcapture/OWNERS
per-file LocusId* = file:/core/java/android/service/contentcapture/OWNERS
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/hardware/SensorAdditionalInfo.java b/core/java/android/hardware/SensorAdditionalInfo.java
index 12edc5e..59def9f 100644
--- a/core/java/android/hardware/SensorAdditionalInfo.java
+++ b/core/java/android/hardware/SensorAdditionalInfo.java
@@ -63,7 +63,7 @@
public final int[] intValues;
/**
- * Typical values of additional infomation type. The set of values is subject to extension in
+ * Typical values of additional information type. The set of values is subject to extension in
* newer versions and vendors have the freedom of define their own custom values.
*
* @hide
diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java
index 6d8c4a9..f053976 100644
--- a/core/java/android/hardware/SensorManager.java
+++ b/core/java/android/hardware/SensorManager.java
@@ -872,9 +872,9 @@
/**
* Flushes the FIFO of all the sensors registered for this listener. If there are events
- * in the FIFO of the sensor, they are returned as if the maxReportLantecy of the FIFO has
+ * in the FIFO of the sensor, they are returned as if the maxReportLatency of the FIFO has
* expired. Events are returned in the usual way through the SensorEventListener.
- * This call doesn't affect the maxReportLantecy for this sensor. This call is asynchronous and
+ * This call doesn't affect the maxReportLatency for this sensor. This call is asynchronous and
* returns immediately.
* {@link android.hardware.SensorEventListener2#onFlushCompleted onFlushCompleted} is called
* after all the events in the batch at the time of calling this method have been delivered
@@ -902,7 +902,7 @@
* Create a sensor direct channel backed by shared memory wrapped in MemoryFile object.
*
* The resulting channel can be used for delivering sensor events to native code, other
- * processes, GPU/DSP or other co-processors without CPU intervention. This is the recommanded
+ * processes, GPU/DSP or other co-processors without CPU intervention. This is the recommended
* for high performance sensor applications that use high sensor rates (e.g. greater than 200Hz)
* and cares about sensor event latency.
*
@@ -924,7 +924,7 @@
* Create a sensor direct channel backed by shared memory wrapped in HardwareBuffer object.
*
* The resulting channel can be used for delivering sensor events to native code, other
- * processes, GPU/DSP or other co-processors without CPU intervention. This is the recommanded
+ * processes, GPU/DSP or other co-processors without CPU intervention. This is the recommended
* for high performance sensor applications that use high sensor rates (e.g. greater than 200Hz)
* and cares about sensor event latency.
*
@@ -1334,11 +1334,11 @@
* returned by {@link #getRotationMatrix}.
*
* @param X
- * defines the axis of the new cooridinate system that coincide with the X axis of the
+ * defines the axis of the new coordinate system that coincide with the X axis of the
* original coordinate system.
*
* @param Y
- * defines the axis of the new cooridinate system that coincide with the Y axis of the
+ * defines the axis of the new coordinate system that coincide with the Y axis of the
* original coordinate system.
*
* @param outR
@@ -1826,7 +1826,7 @@
* This method is used to inject raw sensor data into the HAL. Call {@link
* initDataInjection(boolean)} before this method to set the HAL in data injection mode. This
* method should be called only if a previous call to initDataInjection has been successful and
- * the HAL and SensorService are already opreating in data injection mode.
+ * the HAL and SensorService are already operating in data injection mode.
*
* @param sensor The sensor to inject.
* @param values Sensor values to inject. The length of this
diff --git a/core/java/android/hardware/SystemSensorManager.java b/core/java/android/hardware/SystemSensorManager.java
index 1c4898a..3d87fa3 100644
--- a/core/java/android/hardware/SystemSensorManager.java
+++ b/core/java/android/hardware/SystemSensorManager.java
@@ -453,7 +453,7 @@
public void onReceive(Context context, Intent intent) {
if (intent.getAction() == Intent.ACTION_DYNAMIC_SENSOR_CHANGED) {
if (DEBUG_DYNAMIC_SENSOR) {
- Log.i(TAG, "DYNS received DYNAMIC_SENSOR_CHANED broadcast");
+ Log.i(TAG, "DYNS received DYNAMIC_SENSOR_CHANGED broadcast");
}
// Dynamic sensors probably changed
mDynamicSensorListDirty = true;
@@ -498,7 +498,7 @@
protected void unregisterDynamicSensorCallbackImpl(
DynamicSensorCallback callback) {
if (DEBUG_DYNAMIC_SENSOR) {
- Log.i(TAG, "Removing dynamic sensor listerner");
+ Log.i(TAG, "Removing dynamic sensor listener");
}
mDynamicSensorCallbacks.remove(callback);
}
@@ -624,7 +624,7 @@
}
if (hardwareBuffer.getWidth() < MIN_DIRECT_CHANNEL_BUFFER_SIZE) {
throw new IllegalArgumentException(
- "Width if HaradwareBuffer must be greater than "
+ "Width if HardwareBuffer must be greater than "
+ MIN_DIRECT_CHANNEL_BUFFER_SIZE);
}
if ((hardwareBuffer.getUsage() & HardwareBuffer.USAGE_SENSOR_DIRECT_DATA) == 0) {
@@ -655,7 +655,7 @@
/*
* BaseEventQueue is the communication channel with the sensor service,
- * SensorEventQueue, TriggerEventQueue are subclases and there is one-to-one mapping between
+ * SensorEventQueue, TriggerEventQueue are subclasses and there is one-to-one mapping between
* the queues and the listeners. InjectEventQueue is also a sub-class which is a special case
* where data is being injected into the sensor HAL through the sensor service. It is not
* associated with any listener and there is one InjectEventQueue associated with a
diff --git a/core/java/android/hardware/usb/OWNERS b/core/java/android/hardware/usb/OWNERS
index 8f5c2a0..a753f96 100644
--- a/core/java/android/hardware/usb/OWNERS
+++ b/core/java/android/hardware/usb/OWNERS
@@ -1,3 +1,7 @@
# Bug component: 175220
+aprasath@google.com
+kumarashishg@google.com
+sarup@google.com
+anothermark@google.com
badhri@google.com
diff --git a/core/java/android/net/VpnManager.java b/core/java/android/net/VpnManager.java
index 2e64a74..ff47f3f 100644
--- a/core/java/android/net/VpnManager.java
+++ b/core/java/android/net/VpnManager.java
@@ -444,7 +444,7 @@
* Retrieve the VpnProfileState for the profile provisioned by the calling package.
*
* @return the VpnProfileState with current information, or null if there was no profile
- * provisioned by the calling package.
+ * provisioned and started by the calling package.
*/
@Nullable
public VpnProfileState getProvisionedVpnProfileState() {
diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java
index 6bc0f6e..092923e 100644
--- a/core/java/android/os/BatteryManager.java
+++ b/core/java/android/os/BatteryManager.java
@@ -20,6 +20,7 @@
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
+import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.Intent;
@@ -232,6 +233,7 @@
OsProtoEnums.CHARGING_POLICY_ADAPTIVE_LONGLIFE; // = 4
/** @hide */
+ @TestApi
public static final int BATTERY_PLUGGED_ANY =
BATTERY_PLUGGED_AC | BATTERY_PLUGGED_USB | BATTERY_PLUGGED_WIRELESS
| BATTERY_PLUGGED_DOCK;
diff --git a/core/java/android/os/BatteryStatsManager.java b/core/java/android/os/BatteryStatsManager.java
index 071bdea..955fad3 100644
--- a/core/java/android/os/BatteryStatsManager.java
+++ b/core/java/android/os/BatteryStatsManager.java
@@ -520,14 +520,10 @@
* @param uid calling package uid
* @param reason why Bluetooth has been turned on
* @param packageName package responsible for this change
+ * @Deprecated Bluetooth self report its state and no longer call this
*/
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public void reportBluetoothOn(int uid, int reason, @NonNull String packageName) {
- try {
- mBatteryStats.noteBluetoothOn(uid, reason, packageName);
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
}
/**
@@ -536,14 +532,10 @@
* @param uid calling package uid
* @param reason why Bluetooth has been turned on
* @param packageName package responsible for this change
+ * @Deprecated Bluetooth self report its state and no longer call this
*/
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
public void reportBluetoothOff(int uid, int reason, @NonNull String packageName) {
- try {
- mBatteryStats.noteBluetoothOff(uid, reason, packageName);
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
}
/**
diff --git a/core/java/android/os/image/DynamicSystemClient.java b/core/java/android/os/image/DynamicSystemClient.java
index 7cdaecd..d5364df 100644
--- a/core/java/android/os/image/DynamicSystemClient.java
+++ b/core/java/android/os/image/DynamicSystemClient.java
@@ -209,6 +209,13 @@
public static final String ACTION_HIDE_NOTIFICATION =
"android.os.image.action.HIDE_NOTIFICATION";
+ /**
+ * Intent action: notify the service to post a status update when keyguard is dismissed.
+ * @hide
+ */
+ public static final String ACTION_NOTIFY_KEYGUARD_DISMISSED =
+ "android.os.image.action.NOTIFY_KEYGUARD_DISMISSED";
+
/*
* Intent Keys
*/
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index fe0c1dd..038beab 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -14615,18 +14615,6 @@
public static final String ANGLE_EGL_FEATURES = "angle_egl_features";
/**
- * Comma-separated list of package names that ANGLE may have issues with
- * @hide
- */
- public static final String ANGLE_DEFERLIST = "angle_deferlist";
-
- /**
- * Integer mode of the logic for applying `angle_deferlist`
- * @hide
- */
- public static final String ANGLE_DEFERLIST_MODE = "angle_deferlist_mode";
-
- /**
* Show the "ANGLE In Use" dialog box to the user when ANGLE is the OpenGL driver.
* The value is a boolean (1 or 0).
* @hide
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java
index 7ac6ae1..c4ae963 100644
--- a/core/java/android/text/TextUtils.java
+++ b/core/java/android/text/TextUtils.java
@@ -871,126 +871,128 @@
if (kind == 0)
break;
+ final Object span;
switch (kind) {
case ALIGNMENT_SPAN:
- readSpan(p, sp, new AlignmentSpan.Standard(p));
+ span = new AlignmentSpan.Standard(p);
break;
case FOREGROUND_COLOR_SPAN:
- readSpan(p, sp, new ForegroundColorSpan(p));
+ span = new ForegroundColorSpan(p);
break;
case RELATIVE_SIZE_SPAN:
- readSpan(p, sp, new RelativeSizeSpan(p));
+ span = new RelativeSizeSpan(p);
break;
case SCALE_X_SPAN:
- readSpan(p, sp, new ScaleXSpan(p));
+ span = new ScaleXSpan(p);
break;
case STRIKETHROUGH_SPAN:
- readSpan(p, sp, new StrikethroughSpan(p));
+ span = new StrikethroughSpan(p);
break;
case UNDERLINE_SPAN:
- readSpan(p, sp, new UnderlineSpan(p));
+ span = new UnderlineSpan(p);
break;
case STYLE_SPAN:
- readSpan(p, sp, new StyleSpan(p));
+ span = new StyleSpan(p);
break;
case BULLET_SPAN:
- readSpan(p, sp, new BulletSpan(p));
+ span = new BulletSpan(p);
break;
case QUOTE_SPAN:
- readSpan(p, sp, new QuoteSpan(p));
+ span = new QuoteSpan(p);
break;
case LEADING_MARGIN_SPAN:
- readSpan(p, sp, new LeadingMarginSpan.Standard(p));
+ span = new LeadingMarginSpan.Standard(p);
break;
case URL_SPAN:
- readSpan(p, sp, new URLSpan(p));
+ span = new URLSpan(p);
break;
case BACKGROUND_COLOR_SPAN:
- readSpan(p, sp, new BackgroundColorSpan(p));
+ span = new BackgroundColorSpan(p);
break;
case TYPEFACE_SPAN:
- readSpan(p, sp, new TypefaceSpan(p));
+ span = new TypefaceSpan(p);
break;
case SUPERSCRIPT_SPAN:
- readSpan(p, sp, new SuperscriptSpan(p));
+ span = new SuperscriptSpan(p);
break;
case SUBSCRIPT_SPAN:
- readSpan(p, sp, new SubscriptSpan(p));
+ span = new SubscriptSpan(p);
break;
case ABSOLUTE_SIZE_SPAN:
- readSpan(p, sp, new AbsoluteSizeSpan(p));
+ span = new AbsoluteSizeSpan(p);
break;
case TEXT_APPEARANCE_SPAN:
- readSpan(p, sp, new TextAppearanceSpan(p));
+ span = new TextAppearanceSpan(p);
break;
case ANNOTATION:
- readSpan(p, sp, new Annotation(p));
+ span = new Annotation(p);
break;
case SUGGESTION_SPAN:
- readSpan(p, sp, new SuggestionSpan(p));
+ span = new SuggestionSpan(p);
break;
case SPELL_CHECK_SPAN:
- readSpan(p, sp, new SpellCheckSpan(p));
+ span = new SpellCheckSpan(p);
break;
case SUGGESTION_RANGE_SPAN:
- readSpan(p, sp, new SuggestionRangeSpan(p));
+ span = new SuggestionRangeSpan(p);
break;
case EASY_EDIT_SPAN:
- readSpan(p, sp, new EasyEditSpan(p));
+ span = new EasyEditSpan(p);
break;
case LOCALE_SPAN:
- readSpan(p, sp, new LocaleSpan(p));
+ span = new LocaleSpan(p);
break;
case TTS_SPAN:
- readSpan(p, sp, new TtsSpan(p));
+ span = new TtsSpan(p);
break;
case ACCESSIBILITY_CLICKABLE_SPAN:
- readSpan(p, sp, new AccessibilityClickableSpan(p));
+ span = new AccessibilityClickableSpan(p);
break;
case ACCESSIBILITY_URL_SPAN:
- readSpan(p, sp, new AccessibilityURLSpan(p));
+ span = new AccessibilityURLSpan(p);
break;
case LINE_BACKGROUND_SPAN:
- readSpan(p, sp, new LineBackgroundSpan.Standard(p));
+ span = new LineBackgroundSpan.Standard(p);
break;
case LINE_HEIGHT_SPAN:
- readSpan(p, sp, new LineHeightSpan.Standard(p));
+ span = new LineHeightSpan.Standard(p);
break;
case ACCESSIBILITY_REPLACEMENT_SPAN:
- readSpan(p, sp, new AccessibilityReplacementSpan(p));
+ span = new AccessibilityReplacementSpan(p);
break;
default:
throw new RuntimeException("bogus span encoding " + kind);
}
+ readSpan(p, sp, span);
}
return sp;
diff --git a/core/java/android/text/util/Linkify.java b/core/java/android/text/util/Linkify.java
index 946fc30..fb6de56 100644
--- a/core/java/android/text/util/Linkify.java
+++ b/core/java/android/text/util/Linkify.java
@@ -31,6 +31,7 @@
import android.text.method.LinkMovementMethod;
import android.text.method.MovementMethod;
import android.text.style.URLSpan;
+import android.text.TextUtils;
import android.util.Log;
import android.util.Patterns;
import android.webkit.WebView;
@@ -672,8 +673,15 @@
@Nullable Context context) {
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
final Context ctx = (context != null) ? context : ActivityThread.currentApplication();
- final String regionCode = (ctx != null) ? ctx.getSystemService(TelephonyManager.class).
- getSimCountryIso().toUpperCase(Locale.US) : Locale.getDefault().getCountry();
+ String regionCode = Locale.getDefault().getCountry();
+ if (ctx != null) {
+ String simCountryIso = ctx.getSystemService(TelephonyManager.class).getSimCountryIso();
+ if (!TextUtils.isEmpty(simCountryIso)) {
+ // Assign simCountryIso if it is available
+ regionCode = simCountryIso.toUpperCase(Locale.US);
+ }
+ }
+
Iterable<PhoneNumberMatch> matches = phoneUtil.findNumbers(s.toString(),
regionCode, Leniency.POSSIBLE, Long.MAX_VALUE);
for (PhoneNumberMatch match : matches) {
diff --git a/core/java/android/view/GestureDetector.java b/core/java/android/view/GestureDetector.java
index 57ba7e9..0b21e3d 100644
--- a/core/java/android/view/GestureDetector.java
+++ b/core/java/android/view/GestureDetector.java
@@ -839,8 +839,10 @@
mHandler.removeMessages(SHOW_PRESS);
mHandler.removeMessages(LONG_PRESS);
mHandler.removeMessages(TAP);
- mVelocityTracker.recycle();
- mVelocityTracker = null;
+ if (mVelocityTracker != null) {
+ mVelocityTracker.recycle();
+ mVelocityTracker = null;
+ }
mIsDoubleTapping = false;
mStillDown = false;
mAlwaysInTapRegion = false;
diff --git a/core/java/android/view/contentcapture/OWNERS b/core/java/android/view/contentcapture/OWNERS
index 43be4f6..e4b0952 100644
--- a/core/java/android/view/contentcapture/OWNERS
+++ b/core/java/android/view/contentcapture/OWNERS
@@ -1,4 +1,5 @@
# Bug component: 544200
hackz@google.com
-volnov@google.com
\ No newline at end of file
+shivanker@google.com
+volnov@google.com
diff --git a/core/java/android/view/contentprotection/OWNERS b/core/java/android/view/contentprotection/OWNERS
new file mode 100644
index 0000000..b3583a7
--- /dev/null
+++ b/core/java/android/view/contentprotection/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 544200
+
+include /core/java/android/view/contentcapture/OWNERS
+
diff --git a/core/java/android/webkit/OWNERS b/core/java/android/webkit/OWNERS
index b33da57..e7fd7a5 100644
--- a/core/java/android/webkit/OWNERS
+++ b/core/java/android/webkit/OWNERS
@@ -1,4 +1,3 @@
-changwan@google.com
+# Bug component: 76427
ntfschr@google.com
-tobiasjs@google.com
torne@google.com
diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java
index fceee4e..f00ac1d 100644
--- a/core/java/android/widget/Toast.java
+++ b/core/java/android/widget/Toast.java
@@ -154,8 +154,7 @@
* Construct an empty Toast object. You must call {@link #setView} before you
* can call {@link #show}.
*
- * @param context The context to use. Usually your {@link android.app.Application}
- * or {@link android.app.Activity} object.
+ * @param context The context to use. Usually your {@link android.app.Activity} object.
*/
public Toast(Context context) {
this(context, null);
@@ -479,8 +478,7 @@
/**
* Make a standard toast that just contains text.
*
- * @param context The context to use. Usually your {@link android.app.Application}
- * or {@link android.app.Activity} object.
+ * @param context The context to use. Usually your {@link android.app.Activity} object.
* @param text The text to show. Can be formatted text.
* @param duration How long to display the message. Either {@link #LENGTH_SHORT} or
* {@link #LENGTH_LONG}
@@ -536,8 +534,7 @@
/**
* Make a standard toast that just contains text from a resource.
*
- * @param context The context to use. Usually your {@link android.app.Application}
- * or {@link android.app.Activity} object.
+ * @param context The context to use. Usually your {@link android.app.Activity} object.
* @param resId The resource id of the string resource to use. Can be formatted text.
* @param duration How long to display the message. Either {@link #LENGTH_SHORT} or
* {@link #LENGTH_LONG}
diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl
index 629a1b3..ee20847 100644
--- a/core/java/com/android/internal/app/IBatteryStats.aidl
+++ b/core/java/com/android/internal/app/IBatteryStats.aidl
@@ -145,8 +145,6 @@
long getAwakeTimeBattery();
long getAwakeTimePlugged();
- void noteBluetoothOn(int uid, int reason, String packageName);
- void noteBluetoothOff(int uid, int reason, String packageName);
void noteBleScanStarted(in WorkSource ws, boolean isUnoptimized);
void noteBleScanStopped(in WorkSource ws, boolean isUnoptimized);
void noteBleScanReset();
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/jni/android_media_AudioProductStrategies.cpp b/core/jni/android_media_AudioProductStrategies.cpp
index 34be2a5..4b563d7 100644
--- a/core/jni/android_media_AudioProductStrategies.cpp
+++ b/core/jni/android_media_AudioProductStrategies.cpp
@@ -86,8 +86,8 @@
// Audio Attributes Group array
int attrGroupIndex = 0;
- std::map<int /**attributesGroupIndex*/, std::vector<AudioAttributes> > groups;
- for (const auto &attr : strategy.getAudioAttributes()) {
+ std::map<int /**attributesGroupIndex*/, std::vector<VolumeGroupAttributes> > groups;
+ for (const auto &attr : strategy.getVolumeGroupAttributes()) {
int groupId = attr.getGroupId();
int streamType = attr.getStreamType();
const auto &iter = std::find_if(begin(groups), end(groups),
@@ -108,17 +108,17 @@
jAudioAttributesGroups = env->NewObjectArray(numAttributesGroups, gAudioAttributesGroupClass, NULL);
for (const auto &iter : groups) {
- std::vector<AudioAttributes> audioAttributesGroups = iter.second;
- jint numAttributes = audioAttributesGroups.size();
- jint jGroupId = audioAttributesGroups.front().getGroupId();
- jint jLegacyStreamType = audioAttributesGroups.front().getStreamType();
+ std::vector<VolumeGroupAttributes> volumeGroupAttributes = iter.second;
+ jint numAttributes = volumeGroupAttributes.size();
+ jint jGroupId = volumeGroupAttributes.front().getGroupId();
+ jint jLegacyStreamType = volumeGroupAttributes.front().getStreamType();
jStatus = JNIAudioAttributeHelper::getJavaArray(env, &jAudioAttributes, numAttributes);
if (jStatus != (jint)AUDIO_JAVA_SUCCESS) {
goto exit;
}
for (size_t j = 0; j < static_cast<size_t>(numAttributes); j++) {
- auto attributes = audioAttributesGroups[j].getAttributes();
+ auto attributes = volumeGroupAttributes[j].getAttributes();
jStatus = JNIAudioAttributeHelper::nativeToJava(env, &jAudioAttribute, attributes);
if (jStatus != AUDIO_JAVA_SUCCESS) {
diff --git a/core/jni/android_media_AudioVolumeGroups.cpp b/core/jni/android_media_AudioVolumeGroups.cpp
index 7098451..1252e89 100644
--- a/core/jni/android_media_AudioVolumeGroups.cpp
+++ b/core/jni/android_media_AudioVolumeGroups.cpp
@@ -94,6 +94,11 @@
for (size_t j = 0; j < static_cast<size_t>(numAttributes); j++) {
auto attributes = group.getAudioAttributes()[j];
+ // Native & Java audio attributes default initializers are not aligned for the source.
+ // Given the volume group class concerns only playback, this field must be equal to the
+ // default java initializer.
+ attributes.source = AUDIO_SOURCE_INVALID;
+
jStatus = JNIAudioAttributeHelper::nativeToJava(env, &jAudioAttribute, attributes);
if (jStatus != AUDIO_JAVA_SUCCESS) {
goto exit;
diff --git a/core/jni/com_android_internal_security_VerityUtils.cpp b/core/jni/com_android_internal_security_VerityUtils.cpp
index 5553d28..6eab12b 100644
--- a/core/jni/com_android_internal_security_VerityUtils.cpp
+++ b/core/jni/com_android_internal_security_VerityUtils.cpp
@@ -79,7 +79,11 @@
int statxForFsverity(JNIEnv *env, jobject /* clazz */, jstring filePath) {
ScopedUtfChars path(env, filePath);
- // Call statx and check STATX_ATTR_VERITY.
+ // There are two ways to check whether a file has fs-verity enabled: statx() and FS_IOC_GETFLAGS
+ // (See https://www.kernel.org/doc/html/latest/filesystems/fsverity.html#statx and
+ // https://www.kernel.org/doc/html/latest/filesystems/fsverity.html#fs-ioc-getflags.)
+ // We try statx() first, since it doesn't require opening the file.
+
struct statx out = {};
if (statx(AT_FDCWD, path.c_str(), 0 /* flags */, STATX_ALL, &out) != 0) {
return -errno;
@@ -89,8 +93,12 @@
return (out.stx_attributes & STATX_ATTR_VERITY) != 0;
}
- // STATX_ATTR_VERITY is not supported for the file path.
- // In this case, call ioctl(FS_IOC_GETFLAGS) and check FS_VERITY_FL.
+ // The filesystem doesn't support STATX_ATTR_VERITY. This normally means that it doesn't
+ // support fs-verity, in which case we should simply return 0. Unfortunately, virtio-fs is an
+ // exception, since it doesn't support STATX_ATTR_VERITY but does support querying FS_VERITY_FL
+ // via FS_IOC_GETFLAGS. So we have to fall back to FS_IOC_GETFLAGS. Note: despite being an
+ // ioctl, FS_IOC_GETFLAGS doesn't require the "ioctl" SELinux permission but rather "getattr".
+
::android::base::unique_fd rfd(open(path.c_str(), O_RDONLY | O_CLOEXEC));
if (rfd.get() < 0) {
ALOGE("open failed at %s", path.c_str());
@@ -99,6 +107,11 @@
unsigned int flags;
if (ioctl(rfd.get(), FS_IOC_GETFLAGS, &flags) < 0) {
+ if (errno == ENOTTY) {
+ // If the filesystem supports neither STATX_ATTR_VERITY nor FS_IOC_GETFLAGS, then assume
+ // that it doesn't support fs-verity.
+ return 0;
+ }
ALOGE("ioctl(FS_IOC_GETFLAGS) failed at %s", path.c_str());
return -errno;
}
diff --git a/core/proto/android/input/OWNERS b/core/proto/android/input/OWNERS
new file mode 100644
index 0000000..4c20c4d
--- /dev/null
+++ b/core/proto/android/input/OWNERS
@@ -0,0 +1 @@
+include /INPUT_OWNERS
diff --git a/core/proto/android/os/system_properties.proto b/core/proto/android/os/system_properties.proto
index 84c82e0..3cedba0 100644
--- a/core/proto/android/os/system_properties.proto
+++ b/core/proto/android/os/system_properties.proto
@@ -434,9 +434,8 @@
optional string vibrator = 37;
optional string virtual_device = 38;
optional string vulkan = 39;
- optional string egl_legacy = 40;
- // Next Tag: 41
+ // Next Tag: 40
}
optional Hardware hardware = 27;
@@ -559,3 +558,4 @@
// Next Tag: 32
}
+
diff --git a/core/proto/android/providers/settings/global.proto b/core/proto/android/providers/settings/global.proto
index e165b07..3c2a48a 100644
--- a/core/proto/android/providers/settings/global.proto
+++ b/core/proto/android/providers/settings/global.proto
@@ -468,10 +468,6 @@
optional SettingProto updatable_driver_prerelease_opt_in_apps = 18;
optional SettingProto angle_egl_features = 19;
- // ANGLE - List of Apps that ANGLE may have issues with
- optional SettingProto angle_deferlist = 20;
- // ANGLE - Integer mode of the logic for applying `angle_deferlist`
- optional SettingProto angle_deferlist_mode = 21;
}
optional Gpu gpu = 59;
diff --git a/core/tests/coretests/OWNERS b/core/tests/coretests/OWNERS
index e8c9fe7..b7e008b 100644
--- a/core/tests/coretests/OWNERS
+++ b/core/tests/coretests/OWNERS
@@ -2,3 +2,4 @@
per-file BinderTest.java = file:platform/frameworks/native:/libs/binder/OWNERS
per-file ParcelTest.java = file:platform/frameworks/native:/libs/binder/OWNERS
+per-file SurfaceControlRegistryTests.java = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/core/tests/coretests/src/android/content/OWNERS b/core/tests/coretests/src/android/content/OWNERS
index a69c6ff..6f38b84 100644
--- a/core/tests/coretests/src/android/content/OWNERS
+++ b/core/tests/coretests/src/android/content/OWNERS
@@ -5,3 +5,5 @@
per-file *Shortcut* = file:/core/java/android/content/pm/SHORTCUT_OWNERS
per-file *ComponentCallbacks* = file:/services/core/java/com/android/server/wm/OWNERS
per-file *ComponentCallbacks* = charlesccchen@google.com
+per-file ContentCaptureOptions* = file:/core/java/android/view/contentcapture/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/core/tests/coretests/src/android/view/contentprotection/OWNERS b/core/tests/coretests/src/android/view/contentprotection/OWNERS
new file mode 100644
index 0000000..b3583a7
--- /dev/null
+++ b/core/tests/coretests/src/android/view/contentprotection/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 544200
+
+include /core/java/android/view/contentcapture/OWNERS
+
diff --git a/data/etc/com.android.networkstack.xml b/data/etc/com.android.networkstack.xml
index 06fec1c..003ca53 100644
--- a/data/etc/com.android.networkstack.xml
+++ b/data/etc/com.android.networkstack.xml
@@ -25,6 +25,7 @@
<permission name="android.permission.LOCAL_MAC_ADDRESS"/>
<permission name="android.permission.MANAGE_SUBSCRIPTION_PLANS"/>
<permission name="android.permission.MANAGE_USB"/>
+ <permission name="android.permission.MANAGE_USERS"/>
<permission name="android.permission.NETWORK_BYPASS_PRIVATE_DNS"/>
<permission name="android.permission.PACKET_KEEPALIVE_OFFLOAD"/>
<permission name="android.permission.READ_NETWORK_USAGE_HISTORY"/>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
index 83bc7c0..8896529 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
@@ -597,6 +597,13 @@
return true;
}
+ // Ignore the motion event When the entry animation is waiting to be started
+ if (!mTouchState.isUserInteracting() && mPipTaskOrganizer.isEntryScheduled()) {
+ ProtoLog.wtf(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
+ "%s: Waiting to start the entry animation, skip the motion event.", TAG);
+ return true;
+ }
+
// Update the touch state
mTouchState.onTouchEvent(ev);
diff --git a/libs/incident/src/IncidentReportArgs.cpp b/libs/incident/src/IncidentReportArgs.cpp
index db495cf..d344a981 100644
--- a/libs/incident/src/IncidentReportArgs.cpp
+++ b/libs/incident/src/IncidentReportArgs.cpp
@@ -133,13 +133,12 @@
mSections.insert(section);
}
- int32_t headerCount;
- err = in->readInt32(&headerCount);
+ err = in->resizeOutVector<vector<uint8_t>>(&mHeaders);
if (err != NO_ERROR) {
return err;
}
- mHeaders.resize(headerCount);
- for (int i=0; i<headerCount; i++) {
+
+ for (int i=0; i<mHeaders.size(); i++) {
err = in->readByteVector(&mHeaders[i]);
if (err != NO_ERROR) {
return err;
diff --git a/libs/services/Android.bp b/libs/services/Android.bp
index f656ebf..0b7e7d3 100644
--- a/libs/services/Android.bp
+++ b/libs/services/Android.bp
@@ -26,8 +26,6 @@
cc_library_shared {
name: "libservices",
srcs: [
- ":IDropBoxManagerService.aidl",
- ":ILogcatManagerService_aidl",
"src/content/ComponentName.cpp",
"src/os/DropBoxManager.cpp",
],
@@ -42,7 +40,10 @@
"libbase_headers",
],
aidl: {
- include_dirs: ["frameworks/base/core/java/"],
+ libs: [
+ "ILogcatManagerService_aidl",
+ "IDropBoxManagerService_aidl",
+ ],
},
export_include_dirs: ["include"],
diff --git a/media/java/android/media/AudioAttributes.java b/media/java/android/media/AudioAttributes.java
index 546f0c6..dea6097 100644
--- a/media/java/android/media/AudioAttributes.java
+++ b/media/java/android/media/AudioAttributes.java
@@ -1433,6 +1433,8 @@
return new String("AudioAttributes:"
+ " usage=" + usageToString()
+ " content=" + contentTypeToString()
+ + (mSource != MediaRecorder.AudioSource.AUDIO_SOURCE_INVALID
+ ? " source=" + MediaRecorder.toLogFriendlyAudioSource(mSource) : "")
+ " flags=0x" + Integer.toHexString(mFlags).toUpperCase()
+ " tags=" + mFormattedTags
+ " bundle=" + (mBundle == null ? "null" : mBundle.toString()));
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index 8e8ed6c..5c3aa96 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -3089,7 +3089,10 @@
mValid = false;
mNativeContext = 0;
}
- sPool.offer(this);
+
+ if (!mInternal) {
+ sPool.offer(this);
+ }
}
private native void native_recycle();
@@ -3153,6 +3156,7 @@
mNativeContext = context;
mMappable = isMappable;
mValid = (context != 0);
+ mInternal = true;
}
private static final BlockingQueue<LinearBlock> sPool =
@@ -3163,6 +3167,7 @@
private boolean mMappable = false;
private ByteBuffer mMapped = null;
private long mNativeContext = 0;
+ private boolean mInternal = false;
}
/**
diff --git a/media/java/android/media/audiopolicy/AudioProductStrategy.java b/media/java/android/media/audiopolicy/AudioProductStrategy.java
index f957498..98819a3 100644
--- a/media/java/android/media/audiopolicy/AudioProductStrategy.java
+++ b/media/java/android/media/audiopolicy/AudioProductStrategy.java
@@ -22,7 +22,6 @@
import android.annotation.TestApi;
import android.media.AudioAttributes;
import android.media.AudioSystem;
-import android.media.MediaRecorder;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
@@ -130,9 +129,7 @@
return aa;
}
}
- return new AudioAttributes.Builder()
- .setContentType(AudioAttributes.CONTENT_TYPE_UNKNOWN)
- .setUsage(AudioAttributes.USAGE_UNKNOWN).build();
+ return DEFAULT_ATTRIBUTES;
}
/**
@@ -217,7 +214,7 @@
@SystemApi
public @NonNull AudioAttributes getAudioAttributes() {
// We need a choice, so take the first one
- return mAudioAttributesGroups.length == 0 ? (new AudioAttributes.Builder().build())
+ return mAudioAttributesGroups.length == 0 ? DEFAULT_ATTRIBUTES
: mAudioAttributesGroups[0].getAudioAttributes();
}
@@ -358,8 +355,7 @@
* Default attributes, with default source to be aligned with native.
*/
private static final @NonNull AudioAttributes DEFAULT_ATTRIBUTES =
- new AudioAttributes.Builder().setCapturePreset(MediaRecorder.AudioSource.DEFAULT)
- .build();
+ new AudioAttributes.Builder().build();
/**
* @hide
@@ -429,8 +425,7 @@
public @NonNull AudioAttributes getAudioAttributes() {
// We need a choice, so take the first one
- return mAudioAttributes.length == 0 ? (new AudioAttributes.Builder().build())
- : mAudioAttributes[0];
+ return mAudioAttributes.length == 0 ? DEFAULT_ATTRIBUTES : mAudioAttributes[0];
}
/**
diff --git a/native/webview/OWNERS b/native/webview/OWNERS
index 580bb0f..7e27dc8 100644
--- a/native/webview/OWNERS
+++ b/native/webview/OWNERS
@@ -1,4 +1,4 @@
+# Bug component: 76427
boliu@google.com
-changwan@google.com
-tobiasjs@google.com
+ntfschr@google.com
torne@google.com
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
index e78de49..3b56016 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
@@ -16,11 +16,10 @@
package com.android.dynsystem;
-import static android.os.AsyncTask.Status.FINISHED;
-import static android.os.AsyncTask.Status.PENDING;
import static android.os.AsyncTask.Status.RUNNING;
import static android.os.image.DynamicSystemClient.ACTION_HIDE_NOTIFICATION;
import static android.os.image.DynamicSystemClient.ACTION_NOTIFY_IF_IN_USE;
+import static android.os.image.DynamicSystemClient.ACTION_NOTIFY_KEYGUARD_DISMISSED;
import static android.os.image.DynamicSystemClient.ACTION_START_INSTALL;
import static android.os.image.DynamicSystemClient.CAUSE_ERROR_EXCEPTION;
import static android.os.image.DynamicSystemClient.CAUSE_ERROR_INVALID_URL;
@@ -234,6 +233,8 @@
executeNotifyIfInUseCommand();
} else if (ACTION_HIDE_NOTIFICATION.equals(action)) {
executeHideNotificationCommand();
+ } else if (ACTION_NOTIFY_KEYGUARD_DISMISSED.equals(action)) {
+ executeNotifyKeyguardDismissed();
}
return Service.START_NOT_STICKY;
@@ -477,6 +478,10 @@
}
}
+ private void executeNotifyKeyguardDismissed() {
+ postStatus(STATUS_NOT_STARTED, CAUSE_INSTALL_CANCELLED, null);
+ }
+
private void resetTaskAndStop() {
resetTaskAndStop(/* removeNotification= */ false);
}
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java
index b522729..7401691 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java
@@ -16,6 +16,7 @@
package com.android.dynsystem;
+import static android.os.image.DynamicSystemClient.ACTION_NOTIFY_KEYGUARD_DISMISSED;
import static android.os.image.DynamicSystemClient.KEY_KEYGUARD_USE_DEFAULT_STRINGS;
import android.app.Activity;
@@ -83,11 +84,19 @@
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
startInstallationService();
+ } else {
+ notifyKeyguardDismissed();
}
finish();
}
+ private void notifyKeyguardDismissed() {
+ Intent intent = new Intent(this, DynamicSystemInstallationService.class);
+ intent.setAction(ACTION_NOTIFY_KEYGUARD_DISMISSED);
+ startServiceAsUser(intent, UserHandle.SYSTEM);
+ }
+
private void startInstallationService() {
// retrieve data from calling intent
Intent callingIntent = getIntent();
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/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index 17078c4..a78faaf 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -771,12 +771,6 @@
Settings.Global.ANGLE_EGL_FEATURES,
GlobalSettingsProto.Gpu.ANGLE_EGL_FEATURES);
dumpSetting(s, p,
- Settings.Global.ANGLE_DEFERLIST,
- GlobalSettingsProto.Gpu.ANGLE_DEFERLIST);
- dumpSetting(s, p,
- Settings.Global.ANGLE_DEFERLIST_MODE,
- GlobalSettingsProto.Gpu.ANGLE_DEFERLIST_MODE);
- dumpSetting(s, p,
Settings.Global.SHOW_ANGLE_IN_USE_DIALOG_BOX,
GlobalSettingsProto.Gpu.SHOW_ANGLE_IN_USE_DIALOG);
dumpSetting(s, p,
diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
index 22d6294..3c2aefd 100644
--- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
+++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
@@ -515,8 +515,6 @@
Settings.Global.ANGLE_GL_DRIVER_SELECTION_PKGS,
Settings.Global.ANGLE_GL_DRIVER_SELECTION_VALUES,
Settings.Global.ANGLE_EGL_FEATURES,
- Settings.Global.ANGLE_DEFERLIST,
- Settings.Global.ANGLE_DEFERLIST_MODE,
Settings.Global.UPDATABLE_DRIVER_ALL_APPS,
Settings.Global.UPDATABLE_DRIVER_PRODUCTION_OPT_IN_APPS,
Settings.Global.UPDATABLE_DRIVER_PRERELEASE_OPT_IN_APPS,
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/Android.bp b/services/Android.bp
index 1750b67..eb56c25 100644
--- a/services/Android.bp
+++ b/services/Android.bp
@@ -59,7 +59,12 @@
optimize: false,
shrink: true,
ignore_warnings: false,
- proguard_flags_files: ["proguard.flags"],
+ proguard_flags_files: [
+ "proguard.flags",
+ // Ensure classes referenced in the framework-res manifest
+ // and implemented in system_server are kept.
+ ":framework-res{.aapt.proguardOptionsFile}",
+ ],
},
// Note: Optimizations are disabled by default if unspecified in
// the java_library rule.
diff --git a/services/core/Android.bp b/services/core/Android.bp
index d885cd1..81f600e 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -164,6 +164,7 @@
"android.hardware.biometrics.fingerprint-V2.3-java",
"android.hardware.biometrics.fingerprint-V2-java",
"android.hardware.oemlock-V1.0-java",
+ "android.hardware.oemlock-V1-java",
"android.hardware.configstore-V1.1-java",
"android.hardware.ir-V1-java",
"android.hardware.rebootescrow-V1-java",
diff --git a/services/core/java/com/android/server/OWNERS b/services/core/java/com/android/server/OWNERS
index 123cd328..55130e4 100644
--- a/services/core/java/com/android/server/OWNERS
+++ b/services/core/java/com/android/server/OWNERS
@@ -1,3 +1,6 @@
+# BootReceiver
+per-file BootReceiver.java = gaillard@google.com
+
# Connectivity / Networking
per-file ConnectivityService.java,ConnectivityServiceInitializer.java,NetworkManagementService.java,NsdService.java,VpnManagerService.java = file:/services/core/java/com/android/server/net/OWNERS
diff --git a/services/core/java/com/android/server/TEST_MAPPING b/services/core/java/com/android/server/TEST_MAPPING
index d9da1c7..a317d23 100644
--- a/services/core/java/com/android/server/TEST_MAPPING
+++ b/services/core/java/com/android/server/TEST_MAPPING
@@ -48,6 +48,11 @@
}
],
"file_patterns": ["BinaryTransparencyService\\.java"]
+ },
+ {
+ // GWP-ASan's CTS test ensures that recoverable tombstones work,
+ // which is emitted by the NativeTombstoneManager.
+ "name": "CtsGwpAsanTestCases"
}
],
"presubmit-large": [
diff --git a/services/core/java/com/android/server/VpnManagerService.java b/services/core/java/com/android/server/VpnManagerService.java
index 2b43ef4..9b4f968 100644
--- a/services/core/java/com/android/server/VpnManagerService.java
+++ b/services/core/java/com/android/server/VpnManagerService.java
@@ -406,7 +406,7 @@
* Retrieve the VpnProfileState for the profile provisioned by the given package.
*
* @return the VpnProfileState with current information, or null if there was no profile
- * provisioned by the given package.
+ * provisioned and started by the given package.
* @hide
*/
@Override
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index c36e070..7aef894 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -2928,7 +2928,9 @@
final ProcessServiceRecord clientPsr = b.client.mServices;
clientPsr.addConnection(c);
c.startAssociationIfNeeded();
- if ((c.flags&Context.BIND_ABOVE_CLIENT) != 0) {
+ // Don't set hasAboveClient if binding to self to prevent modifyRawOomAdj() from
+ // dropping the process' adjustment level.
+ if (b.client != s.app && (c.flags & Context.BIND_ABOVE_CLIENT) != 0) {
clientPsr.setHasAboveClient(true);
}
if ((c.flags&Context.BIND_ALLOW_WHITELIST_MANAGEMENT) != 0) {
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 8439a7d..5ae06c0 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -1982,32 +1982,6 @@
}
}
- /**
- * Bluetooth on stat logging
- */
- public void noteBluetoothOn(int uid, int reason, String packageName) {
- if (Binder.getCallingPid() != Process.myPid()) {
- mContext.enforcePermission(android.Manifest.permission.BLUETOOTH_CONNECT,
- Binder.getCallingPid(), uid, null);
- }
- FrameworkStatsLog.write_non_chained(FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED,
- uid, null, FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__ENABLED,
- reason, packageName);
- }
-
- /**
- * Bluetooth off stat logging
- */
- public void noteBluetoothOff(int uid, int reason, String packageName) {
- if (Binder.getCallingPid() != Process.myPid()) {
- mContext.enforcePermission(android.Manifest.permission.BLUETOOTH_CONNECT,
- Binder.getCallingPid(), uid, null);
- }
- FrameworkStatsLog.write_non_chained(FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED,
- uid, null, FrameworkStatsLog.BLUETOOTH_ENABLED_STATE_CHANGED__STATE__DISABLED,
- reason, packageName);
- }
-
@Override
public void noteBleScanStarted(final WorkSource ws, final boolean isUnoptimized) {
enforceCallingPermission();
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 54718c9..7caac2f 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -2900,7 +2900,11 @@
// {@link ProcessList.SCHED_GROUP_TOP_APP}. We don't check render thread because it
// is not ready when attaching.
app.getWindowProcessController().onTopProcChanged();
- setThreadPriority(app.getPid(), THREAD_PRIORITY_TOP_APP_BOOST);
+ if (mService.mUseFifoUiScheduling) {
+ mService.scheduleAsFifoPriority(app.getPid(), true);
+ } else {
+ setThreadPriority(app.getPid(), THREAD_PRIORITY_TOP_APP_BOOST);
+ }
initialSchedGroup = ProcessList.SCHED_GROUP_TOP_APP;
} catch (Exception e) {
Slog.w(TAG, "Failed to pre-set top priority to " + app + " " + e);
diff --git a/services/core/java/com/android/server/am/ProcessServiceRecord.java b/services/core/java/com/android/server/am/ProcessServiceRecord.java
index 67eb675..31830c5 100644
--- a/services/core/java/com/android/server/am/ProcessServiceRecord.java
+++ b/services/core/java/com/android/server/am/ProcessServiceRecord.java
@@ -258,7 +258,8 @@
mHasAboveClient = false;
for (int i = mConnections.size() - 1; i >= 0; i--) {
ConnectionRecord cr = mConnections.valueAt(i);
- if ((cr.flags & Context.BIND_ABOVE_CLIENT) != 0) {
+ if (cr.binding.service.app.mServices != this
+ && (cr.flags & Context.BIND_ABOVE_CLIENT) != 0) {
mHasAboveClient = true;
break;
}
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 66682cc..a54b59c 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -3409,16 +3409,15 @@
synchronized (mHdmiClientLock) {
if (mHdmiManager != null) {
// At most one of mHdmiPlaybackClient and mHdmiTvClient should be non-null
- HdmiClient fullVolumeHdmiClient = mHdmiPlaybackClient;
+ HdmiClient hdmiClient = mHdmiPlaybackClient;
if (mHdmiTvClient != null) {
- fullVolumeHdmiClient = mHdmiTvClient;
+ hdmiClient = mHdmiTvClient;
}
- if (fullVolumeHdmiClient != null
+ if (((mHdmiPlaybackClient != null && isFullVolumeDevice(device))
+ || (mHdmiTvClient != null && mHdmiSystemAudioSupported))
&& mHdmiCecVolumeControlEnabled
- && streamTypeAlias == AudioSystem.STREAM_MUSIC
- // vol change on a full volume device
- && isFullVolumeDevice(device)) {
+ && streamTypeAlias == AudioSystem.STREAM_MUSIC) {
int keyCode = KeyEvent.KEYCODE_UNKNOWN;
switch (direction) {
case AudioManager.ADJUST_RAISE:
@@ -3442,14 +3441,14 @@
try {
switch (keyEventMode) {
case AudioDeviceVolumeManager.ADJUST_MODE_NORMAL:
- fullVolumeHdmiClient.sendVolumeKeyEvent(keyCode, true);
- fullVolumeHdmiClient.sendVolumeKeyEvent(keyCode, false);
+ hdmiClient.sendVolumeKeyEvent(keyCode, true);
+ hdmiClient.sendVolumeKeyEvent(keyCode, false);
break;
case AudioDeviceVolumeManager.ADJUST_MODE_START:
- fullVolumeHdmiClient.sendVolumeKeyEvent(keyCode, true);
+ hdmiClient.sendVolumeKeyEvent(keyCode, true);
break;
case AudioDeviceVolumeManager.ADJUST_MODE_END:
- fullVolumeHdmiClient.sendVolumeKeyEvent(keyCode, false);
+ hdmiClient.sendVolumeKeyEvent(keyCode, false);
break;
default:
Log.e(TAG, "Invalid keyEventMode " + keyEventMode);
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index 4208a12..e85eee81 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -309,6 +309,8 @@
*/
@VisibleForTesting
static final int DEFAULT_LONG_LIVED_TCP_CONNS_EXPENSIVE_TIMEOUT_SEC = 60;
+
+ private static final int PREFERRED_IKE_PROTOCOL_UNKNOWN = -1;
/**
* Prefer using {@link IkeSessionParams.ESP_IP_VERSION_AUTO} and
* {@link IkeSessionParams.ESP_ENCAP_TYPE_AUTO} for ESP packets.
@@ -3643,11 +3645,11 @@
final int natKeepalive =
carrierConfig.getInt(KEY_MIN_UDP_PORT_4500_NAT_TIMEOUT_SEC_INT);
- final int preferredIpPortocol =
- carrierConfig.getInt(KEY_PREFERRED_IKE_PROTOCOL_INT);
+ final int preferredIpProtocol = carrierConfig.getInt(
+ KEY_PREFERRED_IKE_PROTOCOL_INT, PREFERRED_IKE_PROTOCOL_UNKNOWN);
final String mccMnc = perSubTm.getSimOperator(subId);
final CarrierConfigInfo info =
- buildCarrierConfigInfo(mccMnc, natKeepalive, preferredIpPortocol);
+ buildCarrierConfigInfo(mccMnc, natKeepalive, preferredIpProtocol);
synchronized (Vpn.this) {
mCachedCarrierConfigInfoPerSubId.put(subId, info);
}
@@ -3828,10 +3830,27 @@
}, retryDelayMs, TimeUnit.MILLISECONDS);
}
+ private boolean significantCapsChange(@Nullable final NetworkCapabilities left,
+ @Nullable final NetworkCapabilities right) {
+ if (left == right) return false;
+ return null == left
+ || null == right
+ || !Arrays.equals(left.getTransportTypes(), right.getTransportTypes())
+ || !Arrays.equals(left.getCapabilities(), right.getCapabilities())
+ || !Arrays.equals(left.getEnterpriseIds(), right.getEnterpriseIds())
+ || !Objects.equals(left.getTransportInfo(), right.getTransportInfo())
+ || !Objects.equals(left.getAllowedUids(), right.getAllowedUids())
+ || !Objects.equals(left.getUnderlyingNetworks(), right.getUnderlyingNetworks())
+ || !Objects.equals(left.getNetworkSpecifier(), right.getNetworkSpecifier());
+ }
+
/** Called when the NetworkCapabilities of underlying network is changed */
public void onDefaultNetworkCapabilitiesChanged(@NonNull NetworkCapabilities nc) {
- mEventChanges.log("[UnderlyingNW] Cap changed from "
- + mUnderlyingNetworkCapabilities + " to " + nc);
+ if (significantCapsChange(mUnderlyingNetworkCapabilities, nc)) {
+ // TODO : make this log terser
+ mEventChanges.log("[UnderlyingNW] Cap changed from "
+ + mUnderlyingNetworkCapabilities + " to " + nc);
+ }
final NetworkCapabilities oldNc = mUnderlyingNetworkCapabilities;
mUnderlyingNetworkCapabilities = nc;
if (oldNc == null || !nc.getSubscriptionIds().equals(oldNc.getSubscriptionIds())) {
@@ -4993,7 +5012,7 @@
* Retrieve the VpnProfileState for the profile provisioned by the given package.
*
* @return the VpnProfileState with current information, or null if there was no profile
- * provisioned by the given package.
+ * provisioned and started by the given package.
*/
@Nullable
public synchronized VpnProfileState getProvisionedVpnProfileState(
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
old mode 100755
new mode 100644
index fb2d2ee..84868f5
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -1125,6 +1125,16 @@
removeActionExcept(clazz, null);
}
+ // Remove all running actions.
+ @ServiceThreadOnly
+ void removeAllActions() {
+ assertRunOnServiceThread();
+ for (HdmiCecFeatureAction action : mActions) {
+ action.finish(false);
+ }
+ mActions.clear();
+ }
+
// Remove all actions matched with the given Class type besides |exception|.
@ServiceThreadOnly
<T extends HdmiCecFeatureAction> void removeActionExcept(
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
index 32ff5e22..a46dd04 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
@@ -229,6 +229,14 @@
super.disableDevice(initiatedByCec, callback);
assertRunOnServiceThread();
mService.unregisterTvInputCallback(mTvInputCallback);
+ // Removing actions and invoking the callback is similar to
+ // HdmiCecLocalDevicePlayback#disableDevice and HdmiCecLocalDeviceTv#disableDevice,
+ // with the difference that in those classes only specific actions are removed and
+ // here we remove all actions. We don't expect any issues with removing all actions
+ // at this time, but we have to pay attention in the future.
+ removeAllActions();
+ // Call the callback instantly or else it will be called 5 seconds later.
+ checkIfPendingActionsCleared();
}
@Override
diff --git a/services/core/java/com/android/server/oemlock/OemLockService.java b/services/core/java/com/android/server/oemlock/OemLockService.java
index f19d353..ef23a44 100644
--- a/services/core/java/com/android/server/oemlock/OemLockService.java
+++ b/services/core/java/com/android/server/oemlock/OemLockService.java
@@ -21,7 +21,6 @@
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageManager;
-import android.hardware.oemlock.V1_0.IOemLock;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
@@ -54,15 +53,18 @@
private OemLock mOemLock;
public static boolean isHalPresent() {
- return VendorLock.getOemLockHalService() != null;
+ return (VendorLockHidl.getOemLockHalService() != null)
+ || (VendorLockAidl.getOemLockHalService() != null);
}
/** Select the OEM lock implementation */
private static OemLock getOemLock(Context context) {
- final IOemLock oemLockHal = VendorLock.getOemLockHalService();
- if (oemLockHal != null) {
- Slog.i(TAG, "Using vendor lock via the HAL");
- return new VendorLock(context, oemLockHal);
+ if (VendorLockAidl.getOemLockHalService() != null) {
+ Slog.i(TAG, "Using vendor lock via the HAL(aidl)");
+ return new VendorLockAidl(context);
+ } else if (VendorLockHidl.getOemLockHalService() != null) {
+ Slog.i(TAG, "Using vendor lock via the HAL(hidl)");
+ return new VendorLockHidl(context);
} else {
Slog.i(TAG, "Using persistent data block based lock");
return new PersistentDataBlockLock(context);
diff --git a/services/core/java/com/android/server/oemlock/VendorLockAidl.java b/services/core/java/com/android/server/oemlock/VendorLockAidl.java
new file mode 100644
index 0000000..82d45ab
--- /dev/null
+++ b/services/core/java/com/android/server/oemlock/VendorLockAidl.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.oemlock;
+
+import android.annotation.Nullable;
+import android.content.Context;
+import android.hardware.oemlock.IOemLock;
+import android.hardware.oemlock.OemLockSecureStatus;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.util.Slog;
+
+/** Uses the OEM lock HAL. */
+class VendorLockAidl extends OemLock {
+ private static final String TAG = "OemLock";
+ private IOemLock mOemLock;
+
+ static IOemLock getOemLockHalService() {
+ return IOemLock.Stub.asInterface(
+ ServiceManager.waitForDeclaredService(IOemLock.DESCRIPTOR + "/default"));
+ }
+
+ VendorLockAidl(Context context) {
+ mOemLock = getOemLockHalService();
+ }
+
+ @Override
+ @Nullable
+ String getLockName() {
+ try {
+ return mOemLock.getName();
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to get name from HAL", e);
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ @Override
+ void setOemUnlockAllowedByCarrier(boolean allowed, @Nullable byte[] signature) {
+ try {
+ final int status;
+ if (signature == null) {
+ status = mOemLock.setOemUnlockAllowedByCarrier(allowed, new byte[0]);
+ } else {
+ status = mOemLock.setOemUnlockAllowedByCarrier(allowed, signature);
+ }
+ switch (status) {
+ case OemLockSecureStatus.OK:
+ Slog.i(TAG, "Updated carrier allows OEM lock state to: " + allowed);
+ return;
+
+ case OemLockSecureStatus.INVALID_SIGNATURE:
+ if (signature == null) {
+ throw new IllegalArgumentException("Signature required for carrier unlock");
+ }
+ throw new SecurityException(
+ "Invalid signature used in attempt to carrier unlock");
+
+ default:
+ Slog.e(TAG, "Unknown return value indicates code is out of sync with HAL");
+ // Fallthrough
+ case OemLockSecureStatus.FAILED:
+ throw new RuntimeException("Failed to set carrier OEM unlock state");
+ }
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to set carrier state with HAL", e);
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ @Override
+ boolean isOemUnlockAllowedByCarrier() {
+ try {
+ return mOemLock.isOemUnlockAllowedByCarrier();
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to get carrier state from HAL");
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ @Override
+ void setOemUnlockAllowedByDevice(boolean allowedByDevice) {
+ try {
+ mOemLock.setOemUnlockAllowedByDevice(allowedByDevice);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to set device state with HAL", e);
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ @Override
+ boolean isOemUnlockAllowedByDevice() {
+
+ try {
+ return mOemLock.isOemUnlockAllowedByDevice();
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Failed to get devie state from HAL");
+ throw e.rethrowFromSystemServer();
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/oemlock/VendorLock.java b/services/core/java/com/android/server/oemlock/VendorLockHidl.java
similarity index 87%
rename from services/core/java/com/android/server/oemlock/VendorLock.java
rename to services/core/java/com/android/server/oemlock/VendorLockHidl.java
index 9c876da..fe76787 100644
--- a/services/core/java/com/android/server/oemlock/VendorLock.java
+++ b/services/core/java/com/android/server/oemlock/VendorLockHidl.java
@@ -27,10 +27,8 @@
import java.util.ArrayList;
import java.util.NoSuchElementException;
-/**
- * Uses the OEM lock HAL.
- */
-class VendorLock extends OemLock {
+/** Uses the OEM lock HAL. */
+class VendorLockHidl extends OemLock {
private static final String TAG = "OemLock";
private Context mContext;
@@ -40,29 +38,30 @@
try {
return IOemLock.getService(/* retry */ true);
} catch (NoSuchElementException e) {
- Slog.i(TAG, "OemLock HAL not present on device");
+ Slog.i(TAG, "OemLock Hidl HAL not present on device");
return null;
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
- VendorLock(Context context, IOemLock oemLock) {
+ VendorLockHidl(Context context) {
mContext = context;
- mOemLock = oemLock;
+ mOemLock = getOemLockHalService();
}
@Override
@Nullable
String getLockName() {
- final Integer[] requestStatus = new Integer[1];
final String[] lockName = new String[1];
+ final Integer[] requestStatus = new Integer[1];
try {
- mOemLock.getName((status, name) -> {
- requestStatus[0] = status;
- lockName[0] = name;
- });
+ mOemLock.getName(
+ (status, name) -> {
+ requestStatus[0] = status;
+ lockName[0] = name;
+ });
} catch (RemoteException e) {
Slog.e(TAG, "Failed to get name from HAL", e);
throw e.rethrowFromSystemServer();
@@ -113,14 +112,14 @@
@Override
boolean isOemUnlockAllowedByCarrier() {
- final Integer[] requestStatus = new Integer[1];
final Boolean[] allowedByCarrier = new Boolean[1];
-
+ final Integer[] requestStatus = new Integer[1];
try {
- mOemLock.isOemUnlockAllowedByCarrier((status, allowed) -> {
- requestStatus[0] = status;
- allowedByCarrier[0] = allowed;
- });
+ mOemLock.isOemUnlockAllowedByCarrier(
+ (status, allowed) -> {
+ requestStatus[0] = status;
+ allowedByCarrier[0] = allowed;
+ });
} catch (RemoteException e) {
Slog.e(TAG, "Failed to get carrier state from HAL");
throw e.rethrowFromSystemServer();
@@ -161,14 +160,15 @@
@Override
boolean isOemUnlockAllowedByDevice() {
- final Integer[] requestStatus = new Integer[1];
final Boolean[] allowedByDevice = new Boolean[1];
+ final Integer[] requestStatus = new Integer[1];
try {
- mOemLock.isOemUnlockAllowedByDevice((status, allowed) -> {
- requestStatus[0] = status;
- allowedByDevice[0] = allowed;
- });
+ mOemLock.isOemUnlockAllowedByDevice(
+ (status, allowed) -> {
+ requestStatus[0] = status;
+ allowedByDevice[0] = allowed;
+ });
} catch (RemoteException e) {
Slog.e(TAG, "Failed to get devie state from HAL");
throw e.rethrowFromSystemServer();
diff --git a/services/core/java/com/android/server/os/OWNERS b/services/core/java/com/android/server/os/OWNERS
index 1957332..70be161 100644
--- a/services/core/java/com/android/server/os/OWNERS
+++ b/services/core/java/com/android/server/os/OWNERS
@@ -1,2 +1,5 @@
# Bugreporting
per-file Bugreport* = file:/platform/frameworks/native:/cmds/dumpstate/OWNERS
+
+# NativeTombstone
+per-file NativeTombstone* = gaillard@google.com
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index 5d03200..10e72f5 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -74,6 +74,8 @@
import com.android.server.pm.permission.LegacyPermissionManagerInternal.PackagesProvider;
import com.android.server.pm.permission.LegacyPermissionManagerInternal.SyncAdapterPackagesProvider;
+import libcore.util.HexEncoding;
+
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -126,6 +128,7 @@
private static final String ATTR_NAME = "name";
private static final String ATTR_FIXED = "fixed";
private static final String ATTR_WHITELISTED = "whitelisted";
+ private static final String ATTR_CERT = "cert";
private static final Set<String> PHONE_PERMISSIONS = new ArraySet<>();
@@ -1430,7 +1433,7 @@
final int exceptionCount = mGrantExceptions.size();
for (int i = 0; i < exceptionCount; i++) {
String packageName = mGrantExceptions.keyAt(i);
- PackageInfo pkg = pm.getSystemPackageInfo(packageName);
+ PackageInfo pkg = pm.getPackageInfo(packageName);
List<DefaultPermissionGrant> permissionGrants = mGrantExceptions.valueAt(i);
final int permissionGrantCount = permissionGrants.size();
for (int j = 0; j < permissionGrantCount; j++) {
@@ -1548,12 +1551,12 @@
}
if (TAG_EXCEPTION.equals(parser.getName())) {
String packageName = parser.getAttributeValue(null, ATTR_PACKAGE);
+ String cert = parser.getAttributeValue(null, ATTR_CERT);
List<DefaultPermissionGrant> packageExceptions =
outGrantExceptions.get(packageName);
if (packageExceptions == null) {
- // The package must be on the system image
- PackageInfo packageInfo = pm.getSystemPackageInfo(packageName);
+ PackageInfo packageInfo = pm.getPackageInfo(packageName);
if (packageInfo == null) {
Log.w(TAG, "No such package:" + packageName);
@@ -1561,8 +1564,8 @@
continue;
}
- if (!pm.isSystemPackage(packageInfo)) {
- Log.w(TAG, "Unknown system package:" + packageName);
+ if (!isSystemOrCertificateMatchingPackage(packageInfo, cert)) {
+ Log.w(TAG, "Not system or certificate-matching package: " + packageName);
XmlUtils.skipCurrentTag(parser);
continue;
}
@@ -1617,6 +1620,15 @@
}
}
+ private boolean isSystemOrCertificateMatchingPackage(PackageInfo pi, String cert) {
+ if (cert == null) {
+ return pi.applicationInfo.isSystemApp();
+ }
+
+ return mContext.getPackageManager().hasSigningCertificate(pi.packageName, HexEncoding.
+ decode(cert.replace(":", "")), PackageManager.CERT_INPUT_SHA256);
+ }
+
private static boolean doesPackageSupportRuntimePermissions(PackageInfo pkg) {
return pkg.applicationInfo != null
&& pkg.applicationInfo.targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1;
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
index 554e269..b92e73c 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
@@ -2868,9 +2868,7 @@
} else if (!permissionPolicyInitialized
|| (!hardRestricted || restrictionExempt)) {
if ((origPermState != null && origPermState.isGranted())) {
- if (!uidState.grantPermission(bp)) {
- wasChanged = true;
- }
+ uidState.grantPermission(bp);
}
}
if (mIsLeanback && NOTIFICATION_PERMISSIONS.contains(permName)) {
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index f9e2eae..36b9765 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -36,6 +36,7 @@
import android.app.ActivityManager;
import android.app.AppGlobals;
import android.app.AppOpsManager;
+import android.app.ApplicationExitInfo;
import android.app.ILocalWallpaperColorConsumer;
import android.app.IWallpaperManager;
import android.app.IWallpaperManagerCallback;
@@ -189,6 +190,10 @@
private final Object mLock = new Object();
+ private static final double LMK_LOW_THRESHOLD_MEMORY_PERCENTAGE = 10;
+ private static final int LMK_RECONNECT_REBIND_RETRIES = 3;
+ private static final long LMK_RECONNECT_DELAY_MS = 5000;
+
/**
* Minimum time between crashes of a wallpaper service for us to consider
* restarting it vs. just reverting to the static wallpaper.
@@ -1208,6 +1213,7 @@
/** Time in milliseconds until we expect the wallpaper to reconnect (unless we're in the
* middle of an update). If exceeded, the wallpaper gets reset to the system default. */
private static final long WALLPAPER_RECONNECT_TIMEOUT_MS = 10000;
+ private int mLmkLimitRebindRetries = LMK_RECONNECT_REBIND_RETRIES;
final WallpaperInfo mInfo;
IWallpaperService mService;
@@ -1448,20 +1454,51 @@
&& mWallpaper.userId == mCurrentUserId
&& !Objects.equals(mDefaultWallpaperComponent, wpService)
&& !Objects.equals(mImageWallpaper, wpService)) {
- // There is a race condition which causes
- // {@link #mWallpaper.wallpaperUpdating} to be false even if it is
- // currently updating since the broadcast notifying us is async.
- // This race is overcome by the general rule that we only reset the
- // wallpaper if its service was shut down twice
- // during {@link #MIN_WALLPAPER_CRASH_TIME} millis.
- if (mWallpaper.lastDiedTime != 0
- && mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME
- > SystemClock.uptimeMillis()) {
- Slog.w(TAG, "Reverting to built-in wallpaper!");
- clearWallpaperLocked(true, FLAG_SYSTEM, mWallpaper.userId, null);
+ List<ApplicationExitInfo> reasonList =
+ mActivityManager.getHistoricalProcessExitReasons(
+ wpService.getPackageName(), 0, 1);
+ int exitReason = ApplicationExitInfo.REASON_UNKNOWN;
+ if (reasonList != null && !reasonList.isEmpty()) {
+ ApplicationExitInfo info = reasonList.get(0);
+ exitReason = info.getReason();
+ }
+ Slog.d(TAG, "exitReason: " + exitReason);
+ // If exit reason is LOW_MEMORY_KILLER
+ // delay the mTryToRebindRunnable for 10s
+ if (exitReason == ApplicationExitInfo.REASON_LOW_MEMORY) {
+ if (isRunningOnLowMemory()) {
+ Slog.i(TAG, "Rebind is delayed due to lmk");
+ mContext.getMainThreadHandler().postDelayed(mTryToRebindRunnable,
+ LMK_RECONNECT_DELAY_MS);
+ mLmkLimitRebindRetries = LMK_RECONNECT_REBIND_RETRIES;
+ } else {
+ if (mLmkLimitRebindRetries <= 0) {
+ Slog.w(TAG, "Reverting to built-in wallpaper due to lmk!");
+ clearWallpaperLocked(true, FLAG_SYSTEM, mWallpaper.userId,
+ null);
+ mLmkLimitRebindRetries = LMK_RECONNECT_REBIND_RETRIES;
+ return;
+ }
+ mLmkLimitRebindRetries--;
+ mContext.getMainThreadHandler().postDelayed(mTryToRebindRunnable,
+ LMK_RECONNECT_DELAY_MS);
+ }
} else {
- mWallpaper.lastDiedTime = SystemClock.uptimeMillis();
- tryToRebind();
+ // There is a race condition which causes
+ // {@link #mWallpaper.wallpaperUpdating} to be false even if it is
+ // currently updating since the broadcast notifying us is async.
+ // This race is overcome by the general rule that we only reset the
+ // wallpaper if its service was shut down twice
+ // during {@link #MIN_WALLPAPER_CRASH_TIME} millis.
+ if (mWallpaper.lastDiedTime != 0
+ && mWallpaper.lastDiedTime + MIN_WALLPAPER_CRASH_TIME
+ > SystemClock.uptimeMillis()) {
+ Slog.w(TAG, "Reverting to built-in wallpaper!");
+ clearWallpaperLocked(true, FLAG_SYSTEM, mWallpaper.userId, null);
+ } else {
+ mWallpaper.lastDiedTime = SystemClock.uptimeMillis();
+ tryToRebind();
+ }
}
}
} else {
@@ -1472,6 +1509,14 @@
}
};
+ private boolean isRunningOnLowMemory() {
+ ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
+ mActivityManager.getMemoryInfo(memoryInfo);
+ double availableMBsInPercentage = memoryInfo.availMem / (double)memoryInfo.totalMem *
+ 100.0;
+ return availableMBsInPercentage < LMK_LOW_THRESHOLD_MEMORY_PERCENTAGE;
+ }
+
/**
* Called by a live wallpaper if its colors have changed.
* @param primaryColors representation of wallpaper primary colors
diff --git a/services/core/java/com/android/server/webkit/OWNERS b/services/core/java/com/android/server/webkit/OWNERS
index 00e540a..e7fd7a5 100644
--- a/services/core/java/com/android/server/webkit/OWNERS
+++ b/services/core/java/com/android/server/webkit/OWNERS
@@ -1,3 +1,3 @@
-changwan@google.com
-tobiasjs@google.com
+# Bug component: 76427
+ntfschr@google.com
torne@google.com
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index a31216b..c4a945c 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -12166,17 +12166,23 @@
"Caller is not managed profile owner or device owner;"
+ " only managed profile owner or device owner may control the preferential"
+ " network service");
- synchronized (getLockObject()) {
- final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
- caller.getUserId());
- if (!requiredAdmin.mPreferentialNetworkServiceConfigs.equals(
- preferentialNetworkServiceConfigs)) {
- requiredAdmin.mPreferentialNetworkServiceConfigs =
- new ArrayList<>(preferentialNetworkServiceConfigs);
- saveSettingsLocked(caller.getUserId());
+
+ try {
+ updateNetworkPreferenceForUser(caller.getUserId(), preferentialNetworkServiceConfigs);
+ synchronized (getLockObject()) {
+ final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked(
+ caller.getUserId());
+ if (!requiredAdmin.mPreferentialNetworkServiceConfigs.equals(
+ preferentialNetworkServiceConfigs)) {
+ requiredAdmin.mPreferentialNetworkServiceConfigs =
+ new ArrayList<>(preferentialNetworkServiceConfigs);
+ saveSettingsLocked(caller.getUserId());
+ }
}
+ } catch (Exception e) {
+ Slogf.e(LOG_TAG, "Failed to set preferential network service configs");
+ throw e;
}
- updateNetworkPreferenceForUser(caller.getUserId(), preferentialNetworkServiceConfigs);
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_PREFERENTIAL_NETWORK_SERVICE_ENABLED)
.setBoolean(preferentialNetworkServiceConfigs
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/proguard.flags b/services/proguard.flags
index 4c2830e..85d05af 100644
--- a/services/proguard.flags
+++ b/services/proguard.flags
@@ -42,19 +42,6 @@
-keep,allowoptimization,allowaccessmodification class * extends android.os.IInterface
-keep,allowoptimization,allowaccessmodification class * extends android.os.IHwInterface
-# Global entities normally kept through explicit Manifest entries
-# TODO(b/210510433): Revisit and consider generating from frameworks/base/core/res/AndroidManifest.xml,
-# by including that manifest with the library rule that triggers optimization.
--keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.Activity
--keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.Service
--keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.backup.BackupAgent
--keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.content.BroadcastReceiver
--keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.content.ContentProvider
--keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.preference.Preference
--keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.view.View {
- public <init>(...);
-}
-
# Various classes subclassed in or referenced via JNI in ethernet-service
-keep public class android.net.** { *; }
-keep,allowoptimization,allowaccessmodification class com.android.net.module.util.* { *; }
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
index 8d59dce..9397533 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
@@ -64,6 +64,7 @@
import static com.android.server.am.ProcessList.VISIBLE_APP_ADJ;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.AdditionalAnswers.answer;
@@ -2208,6 +2209,28 @@
assertProcStates(app2, false, PROCESS_STATE_SERVICE, SERVICE_ADJ, "started-services");
}
+ @SuppressWarnings("GuardedBy")
+ @Test
+ public void testUpdateOomAdj_DoOne_AboveClient_SameProcess() {
+ ProcessRecord app = spy(makeDefaultProcessRecord(MOCKAPP_PID, MOCKAPP_UID,
+ MOCKAPP_PROCESSNAME, MOCKAPP_PACKAGENAME, true));
+ doReturn(PROCESS_STATE_TOP).when(sService.mAtmInternal).getTopProcessState();
+ doReturn(app).when(sService).getTopApp();
+ sService.mWakefulness.set(PowerManagerInternal.WAKEFULNESS_AWAKE);
+ sService.mOomAdjuster.updateOomAdjLocked(app, OomAdjuster.OOM_ADJ_REASON_NONE);
+
+ assertEquals(FOREGROUND_APP_ADJ, app.mState.getSetAdj());
+
+ // Simulate binding to a service in the same process using BIND_ABOVE_CLIENT and
+ // verify that its OOM adjustment level is unaffected.
+ bindService(app, app, null, Context.BIND_ABOVE_CLIENT, mock(IBinder.class));
+ app.mServices.updateHasAboveClientLocked();
+ assertFalse(app.mServices.hasAboveClient());
+
+ sService.mOomAdjuster.updateOomAdjLocked(app, OomAdjuster.OOM_ADJ_REASON_NONE);
+ assertEquals(FOREGROUND_APP_ADJ, app.mState.getSetAdj());
+ }
+
private ProcessRecord makeDefaultProcessRecord(int pid, int uid, String processName,
String packageName, boolean hasShownUi) {
long now = SystemClock.uptimeMillis();
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/magnification/WindowMagnificationManagerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/magnification/WindowMagnificationManagerTest.java
index 25ad2be..edb4eca 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/magnification/WindowMagnificationManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/magnification/WindowMagnificationManagerTest.java
@@ -66,6 +66,7 @@
import com.android.server.statusbar.StatusBarManagerInternal;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
@@ -294,6 +295,7 @@
MagnificationScaleProvider.MAX_SCALE);
}
+ @Ignore("b/278816260: We could refer to b/182561174#comment4 for solution.")
@Test
public void logTrackingTypingFocus_processScroll_logDuration() {
WindowMagnificationManager spyWindowMagnificationManager = spy(mWindowMagnificationManager);
diff --git a/services/tests/servicestests/src/com/android/server/contentcapture/OWNERS b/services/tests/servicestests/src/com/android/server/contentcapture/OWNERS
new file mode 100644
index 0000000..b3583a7
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/contentcapture/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 544200
+
+include /core/java/android/view/contentcapture/OWNERS
+
diff --git a/services/tests/servicestests/src/com/android/server/contentprotection/OWNERS b/services/tests/servicestests/src/com/android/server/contentprotection/OWNERS
new file mode 100644
index 0000000..24561c5
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/contentprotection/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 544200
+
+include /core/java/android/view/contentcapture/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/webkit/OWNERS b/services/tests/servicestests/src/com/android/server/webkit/OWNERS
index 00e540a..e7fd7a5 100644
--- a/services/tests/servicestests/src/com/android/server/webkit/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/webkit/OWNERS
@@ -1,3 +1,3 @@
-changwan@google.com
-tobiasjs@google.com
+# Bug component: 76427
+ntfschr@google.com
torne@google.com
diff --git a/services/usb/OWNERS b/services/usb/OWNERS
index 60172a3..d35dbb56 100644
--- a/services/usb/OWNERS
+++ b/services/usb/OWNERS
@@ -1,3 +1,7 @@
+aprasath@google.com
+kumarashishg@google.com
+sarup@google.com
+anothermark@google.com
badhri@google.com
elaurent@google.com
albertccwang@google.com