Merge "Create TEST_MAPPING for com.android.internal.net" into main
diff --git a/Android.bp b/Android.bp
index 1aa297f..f5c0b6d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -136,6 +136,9 @@
// For the generated R.java and Manifest.java
":framework-res{.aapt.srcjar}",
+ // Java/AIDL sources to be moved out to CrashRecovery module
+ ":framework-crashrecovery-sources",
+
// etc.
":framework-javastream-protos",
":statslog-framework-java-gen", // FrameworkStatsLog.java
@@ -410,13 +413,25 @@
],
}
+// Collection of non updatable unbundled jars. The list here should match
+// |non_updatable_modules| variable in frameworks/base/api/api.go.
+java_library {
+ name: "framework-non-updatable-unbundled-impl-libs",
+ static_libs: [
+ "framework-location.impl",
+ "framework-nfc.impl",
+ ],
+ sdk_version: "core_platform",
+ installable: false,
+}
+
// Separated so framework-minus-apex-defaults can be used without the libs dependency
java_defaults {
name: "framework-minus-apex-with-libs-defaults",
defaults: ["framework-minus-apex-defaults"],
libs: [
"framework-virtualization.stubs.module_lib",
- "framework-location.impl",
+ "framework-non-updatable-unbundled-impl-libs",
],
}
@@ -447,7 +462,7 @@
stem: "framework",
apex_available: ["//apex_available:platform"],
visibility: [
- "//frameworks/base/location",
+ "//frameworks/base:__subpackages__",
],
compile_dex: false,
headers_only: true,
@@ -510,8 +525,8 @@
installable: false, // this lib is a build-only library
static_libs: [
"app-compat-annotations",
- "framework-location.impl",
"framework-minus-apex",
+ "framework-non-updatable-unbundled-impl-libs",
"framework-updatable-stubs-module_libs_api",
],
sdk_version: "core_platform",
diff --git a/apct-tests/perftests/core/Android.bp b/apct-tests/perftests/core/Android.bp
index 9366ff2d..e1b3241 100644
--- a/apct-tests/perftests/core/Android.bp
+++ b/apct-tests/perftests/core/Android.bp
@@ -66,6 +66,7 @@
errorprone: {
javacflags: [
"-Xep:ReturnValueIgnored:WARN",
+ "-Xep:UnnecessaryStringBuilder:OFF",
],
},
}
diff --git a/apex/jobscheduler/service/java/com/android/server/alarm/Alarm.java b/apex/jobscheduler/service/java/com/android/server/alarm/Alarm.java
index 4d646de..1076465 100644
--- a/apex/jobscheduler/service/java/com/android/server/alarm/Alarm.java
+++ b/apex/jobscheduler/service/java/com/android/server/alarm/Alarm.java
@@ -21,7 +21,7 @@
import static android.app.AlarmManager.RTC;
import static android.app.AlarmManager.RTC_WAKEUP;
-import static com.android.server.alarm.AlarmManagerService.clampPositive;
+import static com.android.server.alarm.AlarmManagerService.addClampPositive;
import android.app.AlarmManager;
import android.app.IAlarmListener;
@@ -146,7 +146,7 @@
mPolicyWhenElapsed[REQUESTER_POLICY_INDEX] = requestedWhenElapsed;
mWhenElapsed = requestedWhenElapsed;
this.windowLength = windowLength;
- mMaxWhenElapsed = clampPositive(requestedWhenElapsed + windowLength);
+ mMaxWhenElapsed = addClampPositive(requestedWhenElapsed, windowLength);
repeatInterval = interval;
operation = op;
listener = rec;
@@ -241,8 +241,8 @@
final long oldMaxWhenElapsed = mMaxWhenElapsed;
// windowLength should always be >= 0 here.
- final long maxRequestedElapsed = clampPositive(
- mPolicyWhenElapsed[REQUESTER_POLICY_INDEX] + windowLength);
+ final long maxRequestedElapsed = addClampPositive(
+ mPolicyWhenElapsed[REQUESTER_POLICY_INDEX], windowLength);
mMaxWhenElapsed = Math.max(maxRequestedElapsed, mWhenElapsed);
return (oldWhenElapsed != mWhenElapsed) || (oldMaxWhenElapsed != mMaxWhenElapsed);
diff --git a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
index b96354c..8cc3134 100644
--- a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
+++ b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
@@ -1498,15 +1498,15 @@
if (futurity < MIN_FUZZABLE_INTERVAL) {
futurity = 0;
}
- long maxElapsed = triggerAtTime + (long) (0.75 * futurity);
+ long maxElapsed = addClampPositive(triggerAtTime, (long) (0.75 * futurity));
// For non-repeating alarms, window is capped at a maximum of one hour from the requested
// delivery time. This allows for inexact-while-idle alarms to be slightly more reliable.
// In practice, the delivery window should generally be much smaller than that
// when the device is not idling.
if (interval == 0) {
- maxElapsed = Math.min(maxElapsed, triggerAtTime + INTERVAL_HOUR);
+ maxElapsed = Math.min(maxElapsed, addClampPositive(triggerAtTime, INTERVAL_HOUR));
}
- return clampPositive(maxElapsed);
+ return maxElapsed;
}
// The RTC clock has moved arbitrarily, so we need to recalculate all the RTC alarm deliveries.
@@ -1593,6 +1593,18 @@
return (val >= 0) ? val : Long.MAX_VALUE;
}
+ static long addClampPositive(long val1, long val2) {
+ long val = val1 + val2;
+ if (val >= 0) {
+ return val;
+ } else if (val1 >= 0 && val2 >= 0) {
+ /* Both are +ve, so overflow happened. */
+ return Long.MAX_VALUE;
+ } else {
+ return 0;
+ }
+ }
+
/**
* Sends alarms that were blocked due to user applied background restrictions - either because
* the user lifted those or the uid came to foreground.
diff --git a/api/Android.bp b/api/Android.bp
index a89e1f2..68babc3 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -89,6 +89,7 @@
"framework-location",
"framework-media",
"framework-mediaprovider",
+ "framework-nfc",
"framework-ondevicepersonalization",
"framework-pdf",
"framework-permission",
@@ -398,7 +399,10 @@
stub_only_libs: ["framework-protos"],
impl_only_libs: ["framework-minus-apex-headers"], // the framework, including hidden API
impl_library_visibility: ["//frameworks/base"],
- defaults_visibility: ["//frameworks/base/location"],
+ defaults_visibility: [
+ "//frameworks/base/location",
+ "//frameworks/base/nfc",
+ ],
plugins: ["error_prone_android_framework"],
errorprone: {
javacflags: [
@@ -414,3 +418,49 @@
"ApiDocs.bp",
"StubLibraries.bp",
]
+
+genrule_defaults {
+ name: "flag-api-mapping-generation-defaults",
+ cmd: "$(location extract-flagged-apis) $(in) $(out)",
+ tools: ["extract-flagged-apis"],
+}
+
+genrule {
+ name: "flag-api-mapping-PublicApi",
+ defaults: ["flag-api-mapping-generation-defaults"],
+ srcs: [":frameworks-base-api-current.txt"],
+ out: ["flag_api_map.textproto"],
+ dist: {
+ targets: ["droid"],
+ },
+}
+
+genrule {
+ name: "flag-api-mapping-SystemApi",
+ defaults: ["flag-api-mapping-generation-defaults"],
+ srcs: [":frameworks-base-api-system-current.txt"],
+ out: ["system_flag_api_map.textproto"],
+ dist: {
+ targets: ["droid"],
+ },
+}
+
+genrule {
+ name: "flag-api-mapping-ModuleLibApi",
+ defaults: ["flag-api-mapping-generation-defaults"],
+ srcs: [":frameworks-base-api-module-lib-current.txt"],
+ out: ["module_lib_flag_api_map.textproto"],
+ dist: {
+ targets: ["droid"],
+ },
+}
+
+genrule {
+ name: "flag-api-mapping-SystemServerApi",
+ defaults: ["flag-api-mapping-generation-defaults"],
+ srcs: [":frameworks-base-api-system-server-current.txt"],
+ out: ["system_server_flag_api_map.textproto"],
+ dist: {
+ targets: ["droid"],
+ },
+}
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp
index f6f6929..28b2d4b 100644
--- a/api/StubLibraries.bp
+++ b/api/StubLibraries.bp
@@ -635,6 +635,7 @@
api_contributions: [
"framework-virtualization.stubs.source.test.api.contribution",
"framework-location.stubs.source.test.api.contribution",
+ "framework-nfc.stubs.source.test.api.contribution",
],
}
diff --git a/api/api.go b/api/api.go
index 8df6dab..71b1e10 100644
--- a/api/api.go
+++ b/api/api.go
@@ -32,6 +32,7 @@
const i18n = "i18n.module.public.api"
const virtualization = "framework-virtualization"
const location = "framework-location"
+const nfc = "framework-nfc"
var core_libraries_modules = []string{art, conscrypt, i18n}
@@ -43,7 +44,7 @@
// APIs.
// In addition, the modules in this list are allowed to contribute to test APIs
// stubs.
-var non_updatable_modules = []string{virtualization, location}
+var non_updatable_modules = []string{virtualization, location, nfc}
// The intention behind this soong plugin is to generate a number of "merged"
// API-related modules that would otherwise require a large amount of very
diff --git a/api/coverage/tools/ExtractFlaggedApis.kt b/api/coverage/tools/ExtractFlaggedApis.kt
index 948e64f..9ffb704 100644
--- a/api/coverage/tools/ExtractFlaggedApis.kt
+++ b/api/coverage/tools/ExtractFlaggedApis.kt
@@ -25,7 +25,7 @@
var cb = ApiFile.parseApi(listOf(File(args[0])))
val flagToApi = mutableMapOf<String, MutableList<String>>()
cb.getPackages()
- .allTopLevelClasses()
+ .allClasses()
.filter { it.methods().size > 0 }
.forEach {
for (method in it.methods()) {
diff --git a/core/api/current.txt b/core/api/current.txt
index 958b2f9..9bcbd72 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -33236,7 +33236,7 @@
method public static android.os.Message obtain(android.os.Handler, int, Object);
method public static android.os.Message obtain(android.os.Handler, int, int, int);
method public static android.os.Message obtain(android.os.Handler, int, int, int, Object);
- method public android.os.Bundle peekData();
+ method @Nullable public android.os.Bundle peekData();
method public void recycle();
method public void sendToTarget();
method public void setAsynchronous(boolean);
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 3d01011..95dc07f 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -298,7 +298,7 @@
field public static final String RECOVER_KEYSTORE = "android.permission.RECOVER_KEYSTORE";
field public static final String REGISTER_CALL_PROVIDER = "android.permission.REGISTER_CALL_PROVIDER";
field public static final String REGISTER_CONNECTION_MANAGER = "android.permission.REGISTER_CONNECTION_MANAGER";
- field public static final String REGISTER_NSD_OFFLOAD_ENGINE = "android.permission.REGISTER_NSD_OFFLOAD_ENGINE";
+ field @FlaggedApi("com.android.net.flags.register_nsd_offload_engine") public static final String REGISTER_NSD_OFFLOAD_ENGINE = "android.permission.REGISTER_NSD_OFFLOAD_ENGINE";
field public static final String REGISTER_SIM_SUBSCRIPTION = "android.permission.REGISTER_SIM_SUBSCRIPTION";
field public static final String REGISTER_STATS_PULL_ATOM = "android.permission.REGISTER_STATS_PULL_ATOM";
field public static final String REMOTE_DISPLAY_PROVIDER = "android.permission.REMOTE_DISPLAY_PROVIDER";
diff --git a/core/java/android/app/KeyguardManager.java b/core/java/android/app/KeyguardManager.java
index 2d55403..c072feb 100644
--- a/core/java/android/app/KeyguardManager.java
+++ b/core/java/android/app/KeyguardManager.java
@@ -679,10 +679,11 @@
* <p>
* Specifically, this returns {@code true} if at least one of the following is true:
* <ul>
- * <li>The {@link Context}'s user has a secure lock screen. A full user has a secure lock
- * screen if its lock screen is set to PIN, pattern, or password, as opposed to swipe or none.
- * A profile that uses a unified challenge is considered to have a secure lock screen if and
- * only if its parent user has a secure lock screen.</li>
+ * <li>The {@link Context}'s user has a secure lock screen. A full user or a profile that uses
+ * a separate challenge has a secure lock screen if its lock screen is set to PIN, pattern, or
+ * password, as opposed to swipe or none. A profile that uses a unified challenge is
+ * considered to have a secure lock screen if and only if its parent user has a secure lock
+ * screen.</li>
* <li>At least one SIM card is currently locked and requires a PIN.</li>
* </ul>
* <p>
@@ -729,8 +730,15 @@
* <p>
* For a user that is not the current user but can be switched to (usually this means "another
* full user"), and that has a PIN, pattern, or password, the device is always considered
- * locked. For a profile with a unified challenge, the device is considered locked if and only
- * if the device is locked for the parent user.
+ * locked.
+ * <p>
+ * For a profile with a unified challenge, the device locked state is the same as that of the
+ * parent user.
+ * <p>
+ * For a profile with a separate challenge, the device becomes unlocked when the profile's PIN,
+ * pattern, password, or biometric is verified. It becomes locked when the parent user becomes
+ * locked, the screen turns off, the device reboots, the device policy controller locks the
+ * profile, or the timeout set by the device policy controller expires.
*
* @return {@code true} if the device is currently locked for the user
* @see #isKeyguardLocked()
@@ -757,9 +765,10 @@
* Returns whether the user has a secure lock screen.
* <p>
* This returns {@code true} if the {@link Context}'s user has a secure lock screen. A full user
- * has a secure lock screen if its lock screen is set to PIN, pattern, or password, as opposed
- * to swipe or none. A profile that uses a unified challenge is considered to have a secure lock
- * screen if and only if its parent user has a secure lock screen.
+ * or a profile that uses a separate challenge has a secure lock screen if its lock screen is
+ * set to PIN, pattern, or password, as opposed to swipe or none. A profile that uses a unified
+ * challenge is considered to have a secure lock screen if and only if its parent user has a
+ * secure lock screen.
* <p>
* This method does not consider whether the lock screen is currently showing or not.
* <p>
diff --git a/core/java/android/os/Message.java b/core/java/android/os/Message.java
index 72fb4ae..cc18482 100644
--- a/core/java/android/os/Message.java
+++ b/core/java/android/os/Message.java
@@ -16,6 +16,7 @@
package android.os;
+import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.util.TimeUtils;
import android.util.proto.ProtoOutputStream;
@@ -436,6 +437,7 @@
* @see #getData()
* @see #setData(Bundle)
*/
+ @Nullable
public Bundle peekData() {
return data;
}
diff --git a/core/java/android/os/OWNERS b/core/java/android/os/OWNERS
index f2f1bd98..463be37 100644
--- a/core/java/android/os/OWNERS
+++ b/core/java/android/os/OWNERS
@@ -86,4 +86,5 @@
# IThermal interfaces
per-file IThermal* = file:/THERMAL_OWNERS
-
+per-file CoolingDevice.java = file:/THERMAL_OWNERS
+per-file Temperature.java = file:/THERMAL_OWNERS
diff --git a/core/java/android/os/TEST_MAPPING b/core/java/android/os/TEST_MAPPING
index cc54266..5c4aa4a 100644
--- a/core/java/android/os/TEST_MAPPING
+++ b/core/java/android/os/TEST_MAPPING
@@ -52,8 +52,20 @@
],
"name": "FrameworksServicesTests",
"options": [
- { "include-filter": "com.android.server.am.BatteryStatsServiceTest" },
- { "include-filter": "com.android.server.power.stats.BatteryStatsTests" }
+ { "include-filter": "com.android.server.am.BatteryStatsServiceTest" }
+ ]
+ },
+ {
+ "file_patterns": [
+ "BatteryStats[^/]*\\.java",
+ "BatteryUsageStats[^/]*\\.java",
+ "PowerComponents\\.java",
+ "[^/]*BatteryConsumer[^/]*\\.java"
+ ],
+ "name": "FrameworksServicesTests",
+ "options": [
+ { "include-filter": "com.android.server.power.stats" },
+ { "exclude-filter": "com.android.server.power.stats.BatteryStatsTests" }
]
},
{
diff --git a/core/java/android/os/storage/OWNERS b/core/java/android/os/storage/OWNERS
index e5b76f6..bf22dcc 100644
--- a/core/java/android/os/storage/OWNERS
+++ b/core/java/android/os/storage/OWNERS
@@ -4,14 +4,16 @@
# Android Storage Team
alukin@google.com
-corinac@google.com
+ankitavyas@google.com
dipankarb@google.com
+gargshivam@google.com
krishang@google.com
+riyaghai@google.com
sahanas@google.com
sergeynv@google.com
+shikhamalhotra@google.com
shubhisaxena@google.com
tylersaunders@google.com
maco@google.com
nandana@google.com
-narayan@google.com
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index 8e72e13..fa42fed 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -1729,23 +1729,6 @@
return RoSystemProperties.CRYPTO_FILE_ENCRYPTED;
}
- /** {@hide}
- * @deprecated Use {@link #isFileEncrypted} instead, since emulated FBE is no longer supported.
- */
- @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @Deprecated
- public static boolean isFileEncryptedNativeOnly() {
- return isFileEncrypted();
- }
-
- /** {@hide}
- * @deprecated Use {@link #isFileEncrypted} instead, since emulated FBE is no longer supported.
- */
- @Deprecated
- public static boolean isFileEncryptedNativeOrEmulated() {
- return isFileEncrypted();
- }
-
/** {@hide} */
public static boolean hasAdoptable() {
switch (SystemProperties.get(PROP_ADOPTABLE)) {
diff --git a/core/java/android/security/OWNERS b/core/java/android/security/OWNERS
index 33a67ae..533d459 100644
--- a/core/java/android/security/OWNERS
+++ b/core/java/android/security/OWNERS
@@ -8,4 +8,4 @@
per-file Confirmation*.java = file:/keystore/OWNERS
per-file FileIntegrityManager.java = file:platform/system/security:/fsverity/OWNERS
per-file IFileIntegrityService.aidl = file:platform/system/security:/fsverity/OWNERS
-per-file *.aconfig = victorhsieh@google.com
+per-file *.aconfig = victorhsieh@google.com,eranm@google.com
diff --git a/core/java/android/security/flags.aconfig b/core/java/android/security/flags.aconfig
index 5aa3097..e94f23a 100644
--- a/core/java/android/security/flags.aconfig
+++ b/core/java/android/security/flags.aconfig
@@ -8,7 +8,7 @@
}
flag {
- name: "fix_unlocked_device_required_keys"
+ name: "fix_unlocked_device_required_keys_v2"
namespace: "hardware_backed_security"
description: "Fix bugs in behavior of UnlockedDeviceRequired keystore keys"
bug: "296464083"
diff --git a/core/java/android/service/notification/OWNERS b/core/java/android/service/notification/OWNERS
index bb0e6ab..cb0b5fa 100644
--- a/core/java/android/service/notification/OWNERS
+++ b/core/java/android/service/notification/OWNERS
@@ -2,6 +2,7 @@
juliacr@google.com
yurilin@google.com
+matiashe@google.com
jeffdq@google.com
dsandler@android.com
dsandler@google.com
diff --git a/core/java/android/tracing/OWNERS b/core/java/android/tracing/OWNERS
index 079d4c5..2ebe2e9 100644
--- a/core/java/android/tracing/OWNERS
+++ b/core/java/android/tracing/OWNERS
@@ -1,3 +1,6 @@
carmenjackson@google.com
kevinjeon@google.com
+pablogamito@google.com
+natanieljr@google.com
+keanmariotti@google.com
include platform/external/perfetto:/OWNERS
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 03a6a00..73d18f9 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -22444,6 +22444,22 @@
}
/**
+ * Configure the {@link android.graphics.RenderEffect} to apply to the backdrop contents of this
+ * View. This will apply a visual effect to the result of the backdrop contents of this View
+ * before it is drawn. For example if
+ * {@link RenderEffect#createBlurEffect(float, float, RenderEffect, Shader.TileMode)}
+ * is provided, the previous content behind this View will be blurred before this View is drawn.
+ * @param renderEffect to be applied to the View. Passing null clears the previously configured
+ * {@link RenderEffect}
+ * @hide
+ */
+ public void setBackdropRenderEffect(@Nullable RenderEffect renderEffect) {
+ if (mRenderNode.setBackdropRenderEffect(renderEffect)) {
+ invalidateViewProperty(true, true);
+ }
+ }
+
+ /**
* Updates the {@link Paint} object used with the current layer (used only if the current
* layer type is not set to {@link #LAYER_TYPE_NONE}). Changed properties of the Paint
* provided to {@link #setLayerType(int, android.graphics.Paint)} will be used the next time
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 3160057..14c5348 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -1367,7 +1367,10 @@
* the system default value will be used.
*
* <p>If the user-agent is overridden in this way, the values of the User-Agent Client Hints
- * headers and {@code navigator.userAgentData} for this WebView will be empty.
+ * headers and {@code navigator.userAgentData} for this WebView could be changed.
+ * <p> See <a href="{@docRoot}reference/androidx/webkit/WebSettingsCompat
+ * #setUserAgentMetadata(WebSettings,UserAgentMetadata)">androidx.webkit.WebSettingsCompat
+ * #setUserAgentMetadata(WebSettings,UserAgentMetadata)</a> for details.
*
* <p>Note that starting from {@link android.os.Build.VERSION_CODES#KITKAT} Android
* version, changing the user-agent while loading a web page causes WebView
diff --git a/core/java/com/android/internal/pm/OWNERS b/core/java/com/android/internal/pm/OWNERS
new file mode 100644
index 0000000..6ef34e2
--- /dev/null
+++ b/core/java/com/android/internal/pm/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 36137
+
+file:/PACKAGE_MANAGER_OWNERS
+
diff --git a/core/java/com/android/server/pm/OWNERS b/core/java/com/android/server/pm/OWNERS
new file mode 100644
index 0000000..6ef34e2
--- /dev/null
+++ b/core/java/com/android/server/pm/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 36137
+
+file:/PACKAGE_MANAGER_OWNERS
+
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index cc2d2e2..05117ce 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -457,9 +457,4 @@
],
},
},
-
- // Workaround Clang LTO crash.
- lto: {
- never: true,
- },
}
diff --git a/core/jni/android_view_InputEventReceiver.cpp b/core/jni/android_view_InputEventReceiver.cpp
index 0f41229..efdfce9 100644
--- a/core/jni/android_view_InputEventReceiver.cpp
+++ b/core/jni/android_view_InputEventReceiver.cpp
@@ -184,11 +184,11 @@
void NativeInputEventReceiver::setFdEvents(int events) {
if (mFdEvents != events) {
mFdEvents = events;
- int fd = mInputConsumer.getChannel()->getFd();
+ auto&& fd = mInputConsumer.getChannel()->getFd();
if (events) {
- mMessageQueue->getLooper()->addFd(fd, 0, events, this, nullptr);
+ mMessageQueue->getLooper()->addFd(fd.get(), 0, events, this, nullptr);
} else {
- mMessageQueue->getLooper()->removeFd(fd);
+ mMessageQueue->getLooper()->removeFd(fd.get());
}
}
}
diff --git a/core/jni/android_view_InputEventSender.cpp b/core/jni/android_view_InputEventSender.cpp
index 8d39ddf..694b28b 100644
--- a/core/jni/android_view_InputEventSender.cpp
+++ b/core/jni/android_view_InputEventSender.cpp
@@ -101,8 +101,8 @@
}
status_t NativeInputEventSender::initialize() {
- int receiveFd = mInputPublisher.getChannel()->getFd();
- mMessageQueue->getLooper()->addFd(receiveFd, 0, ALOOPER_EVENT_INPUT, this, NULL);
+ auto&& receiveFd = mInputPublisher.getChannel()->getFd();
+ mMessageQueue->getLooper()->addFd(receiveFd.get(), 0, ALOOPER_EVENT_INPUT, this, NULL);
return OK;
}
@@ -111,7 +111,7 @@
ALOGD("channel '%s' ~ Disposing input event sender.", getInputChannelName().c_str());
}
- mMessageQueue->getLooper()->removeFd(mInputPublisher.getChannel()->getFd());
+ mMessageQueue->getLooper()->removeFd(mInputPublisher.getChannel()->getFd().get());
}
status_t NativeInputEventSender::sendKeyEvent(uint32_t seq, const KeyEvent* event) {
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 0e753e5..f7b6a7b 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2278,6 +2278,7 @@
<!-- Allows system apps to call methods to register itself as a mDNS offload engine.
<p>Not for use by third-party or privileged applications.
@SystemApi
+ @FlaggedApi("com.android.net.flags.register_nsd_offload_engine")
@hide This should only be used by system apps.
-->
<permission android:name="android.permission.REGISTER_NSD_OFFLOAD_ENGINE"
diff --git a/errorprone/java/com/google/errorprone/bugpatterns/android/HideInCommentsChecker.java b/errorprone/java/com/google/errorprone/bugpatterns/android/HideInCommentsChecker.java
index 07f1d4a..8dc9579 100644
--- a/errorprone/java/com/google/errorprone/bugpatterns/android/HideInCommentsChecker.java
+++ b/errorprone/java/com/google/errorprone/bugpatterns/android/HideInCommentsChecker.java
@@ -63,7 +63,7 @@
@Override
public Description matchCompilationUnit(CompilationUnitTree tree, VisitorState state) {
- final Map<Integer, Tree> javadocableTrees = findJavadocableTrees(tree);
+ final Map<Integer, Tree> javadocableTrees = findJavadocableTrees(tree, state);
final String sourceCode = state.getSourceCode().toString();
for (ErrorProneToken token : ErrorProneTokens.getTokens(sourceCode, state.context)) {
for (Tokens.Comment comment : token.comments()) {
@@ -112,9 +112,9 @@
}
- private Map<Integer, Tree> findJavadocableTrees(CompilationUnitTree tree) {
+ private Map<Integer, Tree> findJavadocableTrees(CompilationUnitTree tree, VisitorState state) {
Map<Integer, Tree> javadoccableTrees = new HashMap<>();
- new SuppressibleTreePathScanner<Void, Void>() {
+ new SuppressibleTreePathScanner<Void, Void>(state) {
@Override
public Void visitClass(ClassTree classTree, Void unused) {
javadoccableTrees.put(getStartPosition(classTree), classTree);
diff --git a/graphics/java/android/graphics/BaseRecordingCanvas.java b/graphics/java/android/graphics/BaseRecordingCanvas.java
index 2ec4524..d659ddd 100644
--- a/graphics/java/android/graphics/BaseRecordingCanvas.java
+++ b/graphics/java/android/graphics/BaseRecordingCanvas.java
@@ -402,8 +402,8 @@
}
@Override
- public final void drawDoubleRoundRect(@NonNull RectF outer, float[] outerRadii,
- @NonNull RectF inner, float[] innerRadii, @NonNull Paint paint) {
+ public final void drawDoubleRoundRect(@NonNull RectF outer, @NonNull float[] outerRadii,
+ @NonNull RectF inner, @NonNull float[] innerRadii, @NonNull Paint paint) {
nDrawDoubleRoundRect(mNativeCanvasWrapper,
outer.left, outer.top, outer.right, outer.bottom, outerRadii,
inner.left, inner.top, inner.right, inner.bottom, innerRadii,
diff --git a/graphics/java/android/graphics/RenderNode.java b/graphics/java/android/graphics/RenderNode.java
index 2e91c24..15d26eb 100644
--- a/graphics/java/android/graphics/RenderNode.java
+++ b/graphics/java/android/graphics/RenderNode.java
@@ -971,6 +971,23 @@
}
/**
+ * Configure the {@link android.graphics.RenderEffect} to apply to the backdrop contents of
+ * this RenderNode. This will apply a visual effect to the result of the backdrop contents
+ * of this RenderNode before the RenderNode is drawn into the destination. For example if
+ * {@link RenderEffect#createBlurEffect(float, float, RenderEffect, Shader.TileMode)}
+ * is provided, the previous content behind this RenderNode will be blurred before the
+ * RenderNode is drawn in to the destination.
+ * @param renderEffect to be applied to the backdrop contents of this RenderNode. Passing
+ * null clears all previously configured RenderEffects
+ * @return True if the value changed, false if the new value was the same as the previous value.
+ * @hide
+ */
+ public boolean setBackdropRenderEffect(@Nullable RenderEffect renderEffect) {
+ return nSetBackdropRenderEffect(mNativeRenderNode,
+ renderEffect != null ? renderEffect.getNativeInstance() : 0);
+ }
+
+ /**
* Returns the translucency level of this display list.
*
* @return A value between 0.0f and 1.0f
@@ -1797,6 +1814,9 @@
private static native boolean nSetRenderEffect(long renderNode, long renderEffect);
@CriticalNative
+ private static native boolean nSetBackdropRenderEffect(long renderNode, long renderEffect);
+
+ @CriticalNative
private static native boolean nSetHasOverlappingRendering(long renderNode,
boolean hasOverlappingRendering);
diff --git a/keystore/java/android/security/KeyStore2.java b/keystore/java/android/security/KeyStore2.java
index 5e16bce..dd703f5 100644
--- a/keystore/java/android/security/KeyStore2.java
+++ b/keystore/java/android/security/KeyStore2.java
@@ -33,7 +33,6 @@
import android.util.Log;
import java.util.Calendar;
-import java.util.Objects;
/**
* @hide This should not be made public in its present form because it
@@ -139,13 +138,25 @@
return new KeyStore2();
}
+ /**
+ * Gets the {@link IKeystoreService} that should be started in early_hal in Android.
+ *
+ * @throws IllegalStateException if the KeystoreService is not available or has not
+ * been initialized when called. This is a state that should not happen and indicates
+ * and error somewhere in the stack or with the calling processes access permissions.
+ */
@NonNull private synchronized IKeystoreService getService(boolean retryLookup) {
if (mBinder == null || retryLookup) {
mBinder = IKeystoreService.Stub.asInterface(ServiceManager
- .getService(KEYSTORE2_SERVICE_NAME));
- Binder.allowBlocking(mBinder.asBinder());
+ .getService(KEYSTORE2_SERVICE_NAME));
}
- return Objects.requireNonNull(mBinder);
+ if (mBinder == null) {
+ throw new IllegalStateException(
+ "Could not connect to Keystore service. Keystore may have crashed or not been"
+ + " initialized");
+ }
+ Binder.allowBlocking(mBinder.asBinder());
+ return mBinder;
}
void delete(KeyDescriptor descriptor) throws KeyStoreException {
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index db58147..b5e6f94 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -514,6 +514,7 @@
"canvas/CanvasOpRasterizer.cpp",
"effects/StretchEffect.cpp",
"effects/GainmapRenderer.cpp",
+ "pipeline/skia/BackdropFilterDrawable.cpp",
"pipeline/skia/HolePunch.cpp",
"pipeline/skia/SkiaDisplayList.cpp",
"pipeline/skia/SkiaRecordingCanvas.cpp",
diff --git a/libs/hwui/Mesh.cpp b/libs/hwui/Mesh.cpp
index e59bc95..37a7d74 100644
--- a/libs/hwui/Mesh.cpp
+++ b/libs/hwui/Mesh.cpp
@@ -90,8 +90,8 @@
FAIL_MESH_VALIDATE("%s mode requires at least %zu vertices but vertex count is %zu.",
modeToStr(meshMode), min_vcount_for_mode(meshMode), mVertexCount);
}
- SkASSERT(!fICount);
- SkASSERT(!fIOffset);
+ LOG_ALWAYS_FATAL_IF(mIndexCount != 0);
+ LOG_ALWAYS_FATAL_IF(mIndexOffset != 0);
}
if (!sm.ok()) {
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 1c39db3..1dd22cf 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -260,6 +260,12 @@
pushStagingDisplayListChanges(observer, info);
}
+ // always damageSelf when filtering backdrop content, or else the BackdropFilterDrawable will
+ // get a wrong snapshot of previous content.
+ if (mProperties.layerProperties().getBackdropImageFilter()) {
+ damageSelf(info);
+ }
+
if (mDisplayList) {
info.out.hasFunctors |= mDisplayList.hasFunctor();
mHasHolePunches = mDisplayList.hasHolePunches();
diff --git a/libs/hwui/RenderProperties.cpp b/libs/hwui/RenderProperties.cpp
index 0589f13..c537123 100644
--- a/libs/hwui/RenderProperties.cpp
+++ b/libs/hwui/RenderProperties.cpp
@@ -55,6 +55,12 @@
return true;
}
+bool LayerProperties::setBackdropImageFilter(SkImageFilter* imageFilter) {
+ if (mBackdropImageFilter.get() == imageFilter) return false;
+ mBackdropImageFilter = sk_ref_sp(imageFilter);
+ return true;
+}
+
bool LayerProperties::setFromPaint(const SkPaint* paint) {
bool changed = false;
changed |= setAlpha(static_cast<uint8_t>(PaintUtils::getAlphaDirect(paint)));
@@ -70,6 +76,7 @@
setXferMode(other.xferMode());
setColorFilter(other.getColorFilter());
setImageFilter(other.getImageFilter());
+ setBackdropImageFilter(other.getBackdropImageFilter());
mStretchEffect = other.mStretchEffect;
return *this;
}
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 064ba7a..e358b57 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -97,8 +97,12 @@
bool setImageFilter(SkImageFilter* imageFilter);
+ bool setBackdropImageFilter(SkImageFilter* imageFilter);
+
SkImageFilter* getImageFilter() const { return mImageFilter.get(); }
+ SkImageFilter* getBackdropImageFilter() const { return mBackdropImageFilter.get(); }
+
const StretchEffect& getStretchEffect() const { return mStretchEffect; }
StretchEffect& mutableStretchEffect() { return mStretchEffect; }
@@ -129,6 +133,7 @@
SkBlendMode mMode;
sk_sp<SkColorFilter> mColorFilter;
sk_sp<SkImageFilter> mImageFilter;
+ sk_sp<SkImageFilter> mBackdropImageFilter;
StretchEffect mStretchEffect;
};
diff --git a/libs/hwui/jni/YuvToJpegEncoder.cpp b/libs/hwui/jni/YuvToJpegEncoder.cpp
index 69418b0..7298906 100644
--- a/libs/hwui/jni/YuvToJpegEncoder.cpp
+++ b/libs/hwui/jni/YuvToJpegEncoder.cpp
@@ -5,6 +5,7 @@
#include "SkStream.h"
#include "YuvToJpegEncoder.h"
#include <ui/PixelFormat.h>
+#include <utils/Errors.h>
#include <hardware/hardware.h>
#include "graphics_jni_helpers.h"
@@ -298,7 +299,7 @@
}
///////////////////////////////////////////////////////////////////////////////
-using namespace android::ultrahdr;
+using namespace ultrahdr;
ultrahdr_color_gamut P010Yuv420ToJpegREncoder::findColorGamut(JNIEnv* env, int aDataSpace) {
switch (aDataSpace & ADataSpace::STANDARD_MASK) {
diff --git a/libs/hwui/jni/YuvToJpegEncoder.h b/libs/hwui/jni/YuvToJpegEncoder.h
index 8ef7805..0e711ef 100644
--- a/libs/hwui/jni/YuvToJpegEncoder.h
+++ b/libs/hwui/jni/YuvToJpegEncoder.h
@@ -103,7 +103,7 @@
* @param aDataSpace data space defined in data_space.h.
* @return color gamut for JPEG/R.
*/
- static android::ultrahdr::ultrahdr_color_gamut findColorGamut(JNIEnv* env, int aDataSpace);
+ static ultrahdr::ultrahdr_color_gamut findColorGamut(JNIEnv* env, int aDataSpace);
/** Map data space (defined in DataSpace.java and data_space.h) to the transfer function
* used in JPEG/R
@@ -112,8 +112,8 @@
* @param aDataSpace data space defined in data_space.h.
* @return color gamut for JPEG/R.
*/
- static android::ultrahdr::ultrahdr_transfer_function findHdrTransferFunction(
- JNIEnv* env, int aDataSpace);
+ static ultrahdr::ultrahdr_transfer_function findHdrTransferFunction(JNIEnv* env,
+ int aDataSpace);
};
#endif // _ANDROID_GRAPHICS_YUV_TO_JPEG_ENCODER_H_
diff --git a/libs/hwui/jni/android_graphics_RenderNode.cpp b/libs/hwui/jni/android_graphics_RenderNode.cpp
index 8c7b9a4..2a218a2 100644
--- a/libs/hwui/jni/android_graphics_RenderNode.cpp
+++ b/libs/hwui/jni/android_graphics_RenderNode.cpp
@@ -243,6 +243,13 @@
return SET_AND_DIRTY(mutateLayerProperties().setImageFilter, imageFilter, RenderNode::GENERIC);
}
+static jboolean android_view_RenderNode_setBackdropRenderEffect(
+ CRITICAL_JNI_PARAMS_COMMA jlong renderNodePtr, jlong renderEffectPtr) {
+ SkImageFilter* imageFilter = reinterpret_cast<SkImageFilter*>(renderEffectPtr);
+ return SET_AND_DIRTY(mutateLayerProperties().setBackdropImageFilter, imageFilter,
+ RenderNode::GENERIC);
+}
+
static jboolean android_view_RenderNode_setHasOverlappingRendering(CRITICAL_JNI_PARAMS_COMMA jlong renderNodePtr,
bool hasOverlappingRendering) {
return SET_AND_DIRTY(setHasOverlappingRendering, hasOverlappingRendering,
@@ -792,6 +799,8 @@
{"nSetAlpha", "(JF)Z", (void*)android_view_RenderNode_setAlpha},
{"nSetRenderEffect", "(JJ)Z", (void*)android_view_RenderNode_setRenderEffect},
+ {"nSetBackdropRenderEffect", "(JJ)Z",
+ (void*)android_view_RenderNode_setBackdropRenderEffect},
{"nSetHasOverlappingRendering", "(JZ)Z",
(void*)android_view_RenderNode_setHasOverlappingRendering},
{"nSetUsageHint", "(JI)V", (void*)android_view_RenderNode_setUsageHint},
diff --git a/libs/hwui/pipeline/skia/BackdropFilterDrawable.cpp b/libs/hwui/pipeline/skia/BackdropFilterDrawable.cpp
new file mode 100644
index 0000000..ffad699
--- /dev/null
+++ b/libs/hwui/pipeline/skia/BackdropFilterDrawable.cpp
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+
+#include "BackdropFilterDrawable.h"
+
+#include <SkImage.h>
+#include <SkSurface.h>
+
+#include "RenderNode.h"
+#include "RenderNodeDrawable.h"
+
+namespace android {
+namespace uirenderer {
+namespace skiapipeline {
+
+BackdropFilterDrawable::~BackdropFilterDrawable() {}
+
+bool BackdropFilterDrawable::prepareToDraw(SkCanvas* canvas, const RenderProperties& properties,
+ int backdropImageWidth, int backdropImageHeight) {
+ // the drawing bounds for blurred content.
+ mDstBounds.setWH(properties.getWidth(), properties.getHeight());
+
+ float alphaMultiplier = 1.0f;
+ RenderNodeDrawable::setViewProperties(properties, canvas, &alphaMultiplier, true);
+
+ // get proper subset for previous content.
+ canvas->getTotalMatrix().mapRect(&mImageSubset, mDstBounds);
+ SkRect imageSubset(mImageSubset);
+ // ensure the subset is inside bounds of previous content.
+ if (!mImageSubset.intersect(SkRect::MakeWH(backdropImageWidth, backdropImageHeight))) {
+ return false;
+ }
+
+ // correct the drawing bounds if subset was changed.
+ if (mImageSubset != imageSubset) {
+ SkMatrix inverse;
+ if (canvas->getTotalMatrix().invert(&inverse)) {
+ inverse.mapRect(&mDstBounds, mImageSubset);
+ }
+ }
+
+ // follow the alpha from the target RenderNode.
+ mPaint.setAlpha(properties.layerProperties().alpha() * alphaMultiplier);
+ return true;
+}
+
+void BackdropFilterDrawable::onDraw(SkCanvas* canvas) {
+ const RenderProperties& properties = mTargetRenderNode->properties();
+ auto* backdropFilter = properties.layerProperties().getBackdropImageFilter();
+ auto* surface = canvas->getSurface();
+ if (!backdropFilter || !surface) {
+ return;
+ }
+
+ auto backdropImage = surface->makeImageSnapshot();
+ // sync necessary properties from target RenderNode.
+ if (!prepareToDraw(canvas, properties, backdropImage->width(), backdropImage->height())) {
+ return;
+ }
+
+ auto imageSubset = mImageSubset.roundOut();
+ backdropImage =
+ backdropImage->makeWithFilter(canvas->recordingContext(), backdropFilter, imageSubset,
+ imageSubset, &mOutSubset, &mOutOffset);
+ canvas->drawImageRect(backdropImage, SkRect::Make(mOutSubset), mDstBounds,
+ SkSamplingOptions(SkFilterMode::kLinear), &mPaint,
+ SkCanvas::kStrict_SrcRectConstraint);
+}
+
+} // namespace skiapipeline
+} // namespace uirenderer
+} // namespace android
diff --git a/libs/hwui/pipeline/skia/BackdropFilterDrawable.h b/libs/hwui/pipeline/skia/BackdropFilterDrawable.h
new file mode 100644
index 0000000..9e35837
--- /dev/null
+++ b/libs/hwui/pipeline/skia/BackdropFilterDrawable.h
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <SkCanvas.h>
+#include <SkDrawable.h>
+#include <SkPaint.h>
+
+namespace android {
+namespace uirenderer {
+
+class RenderNode;
+class RenderProperties;
+
+namespace skiapipeline {
+
+/**
+ * This drawable captures it's backdrop content and render it with a
+ * image filter.
+ */
+class BackdropFilterDrawable : public SkDrawable {
+public:
+ BackdropFilterDrawable(RenderNode* renderNode, SkCanvas* canvas)
+ : mTargetRenderNode(renderNode), mBounds(canvas->getLocalClipBounds()) {}
+
+ ~BackdropFilterDrawable();
+
+private:
+ RenderNode* mTargetRenderNode;
+ SkPaint mPaint;
+
+ SkRect mDstBounds;
+ SkRect mImageSubset;
+ SkIRect mOutSubset;
+ SkIPoint mOutOffset;
+
+ /**
+ * Check all necessary properties before actual drawing.
+ * Return true if ready to draw.
+ */
+ bool prepareToDraw(SkCanvas* canvas, const RenderProperties& properties, int backdropImageWidth,
+ int backdropImageHeight);
+
+protected:
+ void onDraw(SkCanvas* canvas) override;
+
+ virtual SkRect onGetBounds() override { return mBounds; }
+ const SkRect mBounds;
+};
+
+} // namespace skiapipeline
+} // namespace uirenderer
+} // namespace android
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
index da4f66d..9d72c23 100644
--- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
+++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
@@ -362,7 +362,7 @@
}
void RenderNodeDrawable::setViewProperties(const RenderProperties& properties, SkCanvas* canvas,
- float* alphaMultiplier) {
+ float* alphaMultiplier, bool ignoreLayer) {
if (properties.getLeft() != 0 || properties.getTop() != 0) {
canvas->translate(properties.getLeft(), properties.getTop());
}
@@ -378,7 +378,8 @@
canvas->concat(*properties.getTransformMatrix());
}
}
- if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) {
+ if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale &&
+ !ignoreLayer) {
const StretchEffect& stretch = properties.layerProperties().getStretchEffect();
if (!stretch.isEmpty()) {
canvas->concat(
@@ -388,10 +389,10 @@
const bool isLayer = properties.effectiveLayerType() != LayerType::None;
int clipFlags = properties.getClippingFlags();
if (properties.getAlpha() < 1) {
- if (isLayer) {
+ if (isLayer && !ignoreLayer) {
clipFlags &= ~CLIP_TO_BOUNDS; // bounds clipping done by layer
}
- if (CC_LIKELY(isLayer || !properties.getHasOverlappingRendering())) {
+ if (CC_LIKELY(isLayer || !properties.getHasOverlappingRendering()) || ignoreLayer) {
*alphaMultiplier = properties.getAlpha();
} else {
// savelayer needed to create an offscreen buffer
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.h b/libs/hwui/pipeline/skia/RenderNodeDrawable.h
index c7582e7..818ac45 100644
--- a/libs/hwui/pipeline/skia/RenderNodeDrawable.h
+++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.h
@@ -120,7 +120,7 @@
* Applies the rendering properties of a view onto a SkCanvas.
*/
static void setViewProperties(const RenderProperties& properties, SkCanvas* canvas,
- float* alphaMultiplier);
+ float* alphaMultiplier, bool ignoreLayer = false);
/**
* Stores transform on the canvas at time of recording and is used for
@@ -149,6 +149,11 @@
* display list that is searched for any render nodes with getProjectBackwards==true
*/
SkiaDisplayList* mProjectedDisplayList = nullptr;
+
+ /**
+ * Allow BackdropFilterDrawable to apply same render properties onto SkCanvas.
+ */
+ friend class BackdropFilterDrawable;
};
} // namespace skiapipeline
diff --git a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
index 3ca7eeb..58c14c1 100644
--- a/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
+++ b/libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp
@@ -37,6 +37,7 @@
#include "NinePatchUtils.h"
#include "RenderNode.h"
#include "pipeline/skia/AnimatedDrawables.h"
+#include "pipeline/skia/BackdropFilterDrawable.h"
#ifdef __ANDROID__ // Layoutlib does not support GL, Vulcan etc.
#include "pipeline/skia/GLFunctorDrawable.h"
#include "pipeline/skia/VkFunctorDrawable.h"
@@ -168,6 +169,14 @@
// Put Vulkan WebViews with non-rectangular clips in a HW layer
renderNode->mutateStagingProperties().setClipMayBeComplex(mRecorder.isClipMayBeComplex());
}
+
+ // draw backdrop filter drawable if needed.
+ if (renderNode->stagingProperties().layerProperties().getBackdropImageFilter()) {
+ auto* backdropFilterDrawable =
+ mDisplayList->allocateDrawable<BackdropFilterDrawable>(renderNode, asSkCanvas());
+ drawDrawable(backdropFilterDrawable);
+ }
+
drawDrawable(&renderNodeDrawable);
// use staging property, since recording on UI thread
diff --git a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
index 596bd37..f67042b 100644
--- a/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
+++ b/libs/hwui/tests/unit/RenderNodeDrawableTests.cpp
@@ -20,14 +20,17 @@
#include <SkBlendMode.h>
#include <SkClipStack.h>
#include <SkSurface_Base.h>
+#include <include/effects/SkImageFilters.h>
#include <string.h>
+
#include "AnimationContext.h"
#include "DamageAccumulator.h"
#include "FatalTestCanvas.h"
#include "IContextFactory.h"
-#include "hwui/Paint.h"
#include "RecordingCanvas.h"
#include "SkiaCanvas.h"
+#include "hwui/Paint.h"
+#include "pipeline/skia/BackdropFilterDrawable.h"
#include "pipeline/skia/SkiaDisplayList.h"
#include "pipeline/skia/SkiaOpenGLPipeline.h"
#include "pipeline/skia/SkiaPipeline.h"
@@ -1210,3 +1213,77 @@
canvas.drawDrawable(&drawable);
EXPECT_EQ(2, canvas.mDrawCounter);
}
+
+// Verify drawing logics for BackdropFilterDrawable
+RENDERTHREAD_TEST(BackdropFilterDrawable, drawing) {
+ static const int CANVAS_WIDTH = 100;
+ static const int CANVAS_HEIGHT = 200;
+ class SimpleTestCanvas : public TestCanvasBase {
+ public:
+ SkRect mDstBounds;
+ SimpleTestCanvas() : TestCanvasBase(CANVAS_WIDTH, CANVAS_HEIGHT) {}
+ void onDrawRect(const SkRect& rect, const SkPaint& paint) override {
+ // did nothing.
+ }
+
+ // called when BackdropFilterDrawable is drawn.
+ void onDrawImageRect2(const SkImage*, const SkRect& src, const SkRect& dst,
+ const SkSamplingOptions&, const SkPaint*,
+ SrcRectConstraint) override {
+ mDrawCounter++;
+ mDstBounds = dst;
+ }
+ };
+ class SimpleLayer : public SkSurface_Base {
+ public:
+ SimpleLayer()
+ : SkSurface_Base(SkImageInfo::MakeN32Premul(CANVAS_WIDTH, CANVAS_HEIGHT), nullptr) {
+ }
+ virtual sk_sp<SkImage> onNewImageSnapshot(const SkIRect* bounds) override {
+ SkBitmap bitmap;
+ bitmap.allocN32Pixels(CANVAS_WIDTH, CANVAS_HEIGHT);
+ bitmap.setImmutable();
+ return SkImage::MakeFromBitmap(bitmap);
+ }
+ SkCanvas* onNewCanvas() override { return new SimpleTestCanvas(); }
+ sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override { return nullptr; }
+ bool onCopyOnWrite(ContentChangeMode) override { return true; }
+ void onWritePixels(const SkPixmap&, int x, int y) {}
+ };
+
+ auto node = TestUtils::createSkiaNode(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT,
+ [](RenderProperties& props, SkiaRecordingCanvas& canvas) {
+ canvas.drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT,
+ Paint());
+ });
+
+ sk_sp<SkSurface> surface(new SimpleLayer());
+ auto* canvas = reinterpret_cast<SimpleTestCanvas*>(surface->getCanvas());
+ RenderNodeDrawable drawable(node.get(), canvas, true);
+ BackdropFilterDrawable backdropDrawable(node.get(), canvas);
+ canvas->drawDrawable(&drawable);
+ canvas->drawDrawable(&backdropDrawable);
+ // no backdrop filter, skip drawing.
+ EXPECT_EQ(0, canvas->mDrawCounter);
+
+ sk_sp<SkImageFilter> filter(SkImageFilters::Blur(3, 3, nullptr));
+ node->animatorProperties().mutateLayerProperties().setBackdropImageFilter(filter.get());
+ canvas->drawDrawable(&drawable);
+ canvas->drawDrawable(&backdropDrawable);
+ // backdrop filter is set, ok to draw.
+ EXPECT_EQ(1, canvas->mDrawCounter);
+ EXPECT_EQ(SkRect::MakeLTRB(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT), canvas->mDstBounds);
+
+ canvas->translate(30, 30);
+ canvas->drawDrawable(&drawable);
+ canvas->drawDrawable(&backdropDrawable);
+ // the drawable is still visible, ok to draw.
+ EXPECT_EQ(2, canvas->mDrawCounter);
+ EXPECT_EQ(SkRect::MakeLTRB(0, 0, CANVAS_WIDTH - 30, CANVAS_HEIGHT - 30), canvas->mDstBounds);
+
+ canvas->translate(CANVAS_WIDTH, CANVAS_HEIGHT);
+ canvas->drawDrawable(&drawable);
+ canvas->drawDrawable(&backdropDrawable);
+ // the drawable is invisible, skip drawing.
+ EXPECT_EQ(2, canvas->mDrawCounter);
+}
diff --git a/media/java/android/media/MediaCas.java b/media/java/android/media/MediaCas.java
index 0a0a626..ab7c27f 100644
--- a/media/java/android/media/MediaCas.java
+++ b/media/java/android/media/MediaCas.java
@@ -272,7 +272,7 @@
Log.d(TAG, "Trying to get AIDL service");
IMediaCasService serviceAidl =
IMediaCasService.Stub.asInterface(
- ServiceManager.getService(
+ ServiceManager.waitForDeclaredService(
IMediaCasService.DESCRIPTOR + "/default"));
if (serviceAidl != null) {
return serviceAidl;
diff --git a/media/jni/Android.bp b/media/jni/Android.bp
index 6031ef7..94fce79 100644
--- a/media/jni/Android.bp
+++ b/media/jni/Android.bp
@@ -122,11 +122,6 @@
"-Wunused",
"-Wunreachable-code",
],
-
- // Workaround Clang LTO crash.
- lto: {
- never: true,
- },
}
cc_library_shared {
diff --git a/media/jni/audioeffect/Android.bp b/media/jni/audioeffect/Android.bp
index 8b5b726..cf5059c 100644
--- a/media/jni/audioeffect/Android.bp
+++ b/media/jni/audioeffect/Android.bp
@@ -44,9 +44,4 @@
"-Wunreachable-code",
"-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
],
-
- // Workaround Clang LTO crash.
- lto: {
- never: true,
- },
}
diff --git a/mime/java-res/android.mime.types b/mime/java-res/android.mime.types
index cb74cfc..fbdfe3e 100644
--- a/mime/java-res/android.mime.types
+++ b/mime/java-res/android.mime.types
@@ -54,6 +54,8 @@
?application/ttml+xml ttml dfxp
?application/vnd.android.ota ota
?application/vnd.apple.mpegurl m3u8
+?application/vnd.apple.pkpass pkpass
+?application/vnd.apple.pkpasses pkpasses
?application/vnd.ms-pki.stl stl
?application/vnd.ms-powerpoint pot
?application/vnd.ms-wpl wpl
diff --git a/nfc/Android.bp b/nfc/Android.bp
new file mode 100644
index 0000000..bf9f47c
--- /dev/null
+++ b/nfc/Android.bp
@@ -0,0 +1,51 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "frameworks_base_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+filegroup {
+ name: "framework-nfc-non-updatable-sources",
+ path: "java",
+ srcs: [],
+}
+
+filegroup {
+ name: "framework-nfc-updatable-sources",
+ path: "java",
+ srcs: [
+ "java/**/*.java",
+ "java/**/*.aidl",
+ ],
+ exclude_srcs: [
+ ":framework-nfc-non-updatable-sources",
+ ],
+}
+
+java_sdk_library {
+ name: "framework-nfc",
+ libs: [
+ "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
+ ],
+ srcs: [
+ ":framework-nfc-updatable-sources",
+ ],
+ defaults: ["framework-non-updatable-unbundled-defaults"],
+ permitted_packages: [
+ "android.nfc",
+ "com.android.nfc",
+ ],
+ hidden_api_packages: [
+ "com.android.nfc",
+ ],
+ aidl: {
+ include_dirs: [
+ // TODO (b/303286040): Remove these when we change to |framework-module-defaults|
+ "frameworks/base/nfc/java",
+ "frameworks/base/core/java",
+ ],
+ },
+}
diff --git a/nfc/OWNERS b/nfc/OWNERS
new file mode 100644
index 0000000..35e9713
--- /dev/null
+++ b/nfc/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 48448
+include platform/packages/apps/Nfc:/OWNERS
diff --git a/nfc/TEST_MAPPING b/nfc/TEST_MAPPING
new file mode 100644
index 0000000..5b5ea37
--- /dev/null
+++ b/nfc/TEST_MAPPING
@@ -0,0 +1,10 @@
+{
+ "presubmit": [
+ {
+ "name": "NfcManagerTests"
+ },
+ {
+ "name": "CtsNfcTestCases"
+ }
+ ]
+}
diff --git a/nfc/api/current.txt b/nfc/api/current.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/current.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/api/module-lib-current.txt b/nfc/api/module-lib-current.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/module-lib-current.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/api/module-lib-removed.txt b/nfc/api/module-lib-removed.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/module-lib-removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/api/removed.txt b/nfc/api/removed.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/api/system-current.txt b/nfc/api/system-current.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/system-current.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/api/system-removed.txt b/nfc/api/system-removed.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/system-removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/api/test-current.txt b/nfc/api/test-current.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/test-current.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/api/test-removed.txt b/nfc/api/test-removed.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/nfc/api/test-removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/nfc/java/android/nfc/Placeholder.java b/nfc/java/android/nfc/Placeholder.java
new file mode 100644
index 0000000..3509644
--- /dev/null
+++ b/nfc/java/android/nfc/Placeholder.java
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+package android.nfc;
+
+/**
+ * Placeholder class so new framework-nfc module isn't empty, will be removed once module is
+ * populated.
+ *
+ * @hide
+ *
+ */
+public class Placeholder {
+}
diff --git a/packages/CrashRecovery/OWNERS b/packages/CrashRecovery/OWNERS
new file mode 100644
index 0000000..daa0211
--- /dev/null
+++ b/packages/CrashRecovery/OWNERS
@@ -0,0 +1,3 @@
+ancr@google.com
+harshitmahajan@google.com
+robertogil@google.com
diff --git a/packages/CrashRecovery/framework/Android.bp b/packages/CrashRecovery/framework/Android.bp
new file mode 100644
index 0000000..b2af315
--- /dev/null
+++ b/packages/CrashRecovery/framework/Android.bp
@@ -0,0 +1,9 @@
+filegroup {
+ name: "framework-crashrecovery-sources",
+ srcs: [
+ "java/**/*.java",
+ "java/**/*.aidl",
+ ],
+ path: "java",
+ visibility: ["//frameworks/base:__subpackages__"],
+}
diff --git a/core/java/android/service/watchdog/ExplicitHealthCheckService.java b/packages/CrashRecovery/framework/java/android/service/watchdog/ExplicitHealthCheckService.java
similarity index 100%
rename from core/java/android/service/watchdog/ExplicitHealthCheckService.java
rename to packages/CrashRecovery/framework/java/android/service/watchdog/ExplicitHealthCheckService.java
diff --git a/core/java/android/service/watchdog/IExplicitHealthCheckService.aidl b/packages/CrashRecovery/framework/java/android/service/watchdog/IExplicitHealthCheckService.aidl
similarity index 96%
rename from core/java/android/service/watchdog/IExplicitHealthCheckService.aidl
rename to packages/CrashRecovery/framework/java/android/service/watchdog/IExplicitHealthCheckService.aidl
index 78c0328..9096509 100644
--- a/core/java/android/service/watchdog/IExplicitHealthCheckService.aidl
+++ b/packages/CrashRecovery/framework/java/android/service/watchdog/IExplicitHealthCheckService.aidl
@@ -21,6 +21,7 @@
/**
* @hide
*/
+@PermissionManuallyEnforced
oneway interface IExplicitHealthCheckService
{
void setCallback(in @nullable RemoteCallback callback);
diff --git a/core/java/android/service/watchdog/OWNERS b/packages/CrashRecovery/framework/java/android/service/watchdog/OWNERS
similarity index 100%
rename from core/java/android/service/watchdog/OWNERS
rename to packages/CrashRecovery/framework/java/android/service/watchdog/OWNERS
diff --git a/core/java/android/service/watchdog/PackageConfig.aidl b/packages/CrashRecovery/framework/java/android/service/watchdog/PackageConfig.aidl
similarity index 100%
rename from core/java/android/service/watchdog/PackageConfig.aidl
rename to packages/CrashRecovery/framework/java/android/service/watchdog/PackageConfig.aidl
diff --git a/packages/CrashRecovery/services/Android.bp b/packages/CrashRecovery/services/Android.bp
new file mode 100644
index 0000000..27ddff9
--- /dev/null
+++ b/packages/CrashRecovery/services/Android.bp
@@ -0,0 +1,9 @@
+filegroup {
+ name: "services-crashrecovery-sources",
+ srcs: [
+ "java/**/*.java",
+ "java/**/*.aidl",
+ ],
+ path: "java",
+ visibility: ["//frameworks/base:__subpackages__"],
+}
diff --git a/services/core/java/com/android/server/ExplicitHealthCheckController.java b/packages/CrashRecovery/services/java/com/android/server/ExplicitHealthCheckController.java
similarity index 100%
rename from services/core/java/com/android/server/ExplicitHealthCheckController.java
rename to packages/CrashRecovery/services/java/com/android/server/ExplicitHealthCheckController.java
diff --git a/services/core/java/com/android/server/PackageWatchdog.java b/packages/CrashRecovery/services/java/com/android/server/PackageWatchdog.java
similarity index 100%
rename from services/core/java/com/android/server/PackageWatchdog.java
rename to packages/CrashRecovery/services/java/com/android/server/PackageWatchdog.java
diff --git a/services/core/java/com/android/server/RescueParty.java b/packages/CrashRecovery/services/java/com/android/server/RescueParty.java
similarity index 100%
rename from services/core/java/com/android/server/RescueParty.java
rename to packages/CrashRecovery/services/java/com/android/server/RescueParty.java
diff --git a/services/core/java/com/android/server/rollback/RollbackPackageHealthObserver.java b/packages/CrashRecovery/services/java/com/android/server/rollback/RollbackPackageHealthObserver.java
similarity index 100%
rename from services/core/java/com/android/server/rollback/RollbackPackageHealthObserver.java
rename to packages/CrashRecovery/services/java/com/android/server/rollback/RollbackPackageHealthObserver.java
diff --git a/services/core/java/com/android/server/rollback/WatchdogRollbackLogger.java b/packages/CrashRecovery/services/java/com/android/server/rollback/WatchdogRollbackLogger.java
similarity index 100%
rename from services/core/java/com/android/server/rollback/WatchdogRollbackLogger.java
rename to packages/CrashRecovery/services/java/com/android/server/rollback/WatchdogRollbackLogger.java
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java
index 1088ace..4992ef1 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java
@@ -290,7 +290,14 @@
broadcastIntent,
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);
- session.commit(pendingIntent.getIntentSender());
+ try {
+ session.commit(pendingIntent.getIntentSender());
+ } catch (Exception e) {
+ Log.e(LOG_TAG, "Cannot install package: ", e);
+ launchFailure(PackageInstaller.STATUS_FAILURE,
+ PackageManager.INSTALL_FAILED_INTERNAL_ERROR, null);
+ return;
+ }
mCancelButton.setEnabled(false);
setFinishOnTouchOutside(false);
} else {
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index ed5654d..ec50323 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -2432,9 +2432,7 @@
R.bool.def_auto_time_zone); // Sync timezone to NITZ
loadSetting(stmt, Settings.Global.STAY_ON_WHILE_PLUGGED_IN,
- ("1".equals(SystemProperties.get("ro.boot.qemu"))
- || res.getBoolean(R.bool.def_stay_on_while_plugged_in))
- ? 1 : 0);
+ res.getBoolean(R.bool.def_stay_on_while_plugged_in) ? 1 : 0);
loadIntegerSetting(stmt, Settings.Global.WIFI_SLEEP_POLICY,
R.integer.def_wifi_sleep_policy);
diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java
index 63b4288..e0ce3db 100644
--- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java
+++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardListener.java
@@ -27,7 +27,7 @@
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
-import android.os.SystemProperties;
+import android.os.Build;
import android.provider.Settings;
import android.util.Log;
@@ -87,7 +87,7 @@
String clipSource = mClipboardManager.getPrimaryClipSource();
ClipData clipData = mClipboardManager.getPrimaryClip();
- if (shouldSuppressOverlay(clipData, clipSource, isEmulator())) {
+ if (shouldSuppressOverlay(clipData, clipSource, Build.IS_EMULATOR)) {
Log.i(TAG, "Clipboard overlay suppressed.");
return;
}
@@ -141,10 +141,6 @@
return true;
}
- private static boolean isEmulator() {
- return SystemProperties.getBoolean("ro.boot.qemu", false);
- }
-
private boolean isUserSetupComplete() {
return Settings.Secure.getInt(mContext.getContentResolver(),
SETTINGS_SECURE_USER_SETUP_COMPLETE, 0) == 1;
diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java b/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
index 67e9664..27e6895 100644
--- a/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
@@ -165,6 +165,9 @@
+ "\\p{Emoji}(\\p{EMod}|\\x{FE0F}\\x{20E3}?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})"
+ "?)*";
+ // Not all JDKs support emoji patterns, including the one errorprone runs under, which
+ // makes it think that this is an invalid pattern.
+ @SuppressWarnings("InvalidPatternSyntax")
private static final Pattern EMOJI_PATTERN = Pattern.compile(UNICODE_EMOJI_REGEX);
public static final String EMPTY_STRING = "";
diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java
index 941cd77..900805f 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java
@@ -25,6 +25,7 @@
import android.content.IntentFilter;
import android.debug.IAdbManager;
import android.hardware.usb.UsbManager;
+import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.ServiceManager;
@@ -69,8 +70,7 @@
super.onCreate(icicle);
// Emulator does not support reseating the usb cable to reshow the dialog.
- boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1");
- if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0 && !isEmulator) {
+ if (SystemProperties.getInt("service.adb.tcp.port", 0) == 0 && !Build.IS_EMULATOR) {
mDisconnectedReceiver = new UsbDisconnectedReceiver(this);
IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_STATE);
mBroadcastDispatcher.registerReceiver(mDisconnectedReceiver, filter);
diff --git a/services/Android.bp b/services/Android.bp
index 0f6b984..e4fe581 100644
--- a/services/Android.bp
+++ b/services/Android.bp
@@ -43,7 +43,10 @@
name: "system_optimized_java_defaults",
module_type: "java_defaults",
config_namespace: "ANDROID",
- bool_variables: ["SYSTEM_OPTIMIZE_JAVA"],
+ bool_variables: [
+ "SYSTEM_OPTIMIZE_JAVA",
+ "FULL_SYSTEM_OPTIMIZE_JAVA",
+ ],
properties: ["optimize"],
}
@@ -55,6 +58,7 @@
enabled: true,
// TODO(b/210510433): Enable optimizations after improving
// retracing infra.
+ // See also FULL_SYSTEM_OPTIMIZE_JAVA.
optimize: false,
shrink: true,
ignore_warnings: false,
@@ -78,6 +82,12 @@
},
},
},
+ // Allow form factors to opt-in full system java optimization
+ FULL_SYSTEM_OPTIMIZE_JAVA: {
+ optimize: {
+ optimize: true,
+ },
+ },
},
}
diff --git a/services/companion/java/com/android/server/companion/virtual/OWNERS b/services/companion/java/com/android/server/companion/virtual/OWNERS
index 5295ec8..4fe0592 100644
--- a/services/companion/java/com/android/server/companion/virtual/OWNERS
+++ b/services/companion/java/com/android/server/companion/virtual/OWNERS
@@ -2,7 +2,7 @@
set noparent
-ogunwale@google.com
-michaelwr@google.com
+marvinramin@google.com
vladokom@google.com
-marvinramin@google.com
\ No newline at end of file
+ogunwale@google.com
+michaelwr@google.com
\ No newline at end of file
diff --git a/services/core/Android.bp b/services/core/Android.bp
index 22f8570..37976b5 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -122,6 +122,9 @@
"java/com/android/server/am/EventLogTags.logtags",
"java/com/android/server/wm/EventLogTags.logtags",
"java/com/android/server/policy/EventLogTags.logtags",
+
+ // Java/AIDL sources to be moved out to CrashRecovery module
+ ":services-crashrecovery-sources",
],
libs: [
@@ -130,7 +133,6 @@
"android.hardware.light-V2.0-java",
"android.hardware.gnss-V2-java",
"android.hardware.vibrator-V2-java",
- "android.nfc.flags-aconfig-java",
"app-compat-annotations",
"framework-tethering.stubs.module_lib",
"service-art.stubs.system_server",
@@ -153,7 +155,7 @@
"android.hardware.boot-V1.0-java", // HIDL
"android.hardware.boot-V1.1-java", // HIDL
"android.hardware.boot-V1.2-java", // HIDL
- "android.hardware.boot-V1-java", // AIDL
+ "android.hardware.boot-V1-java", // AIDL
"android.hardware.broadcastradio-V2.0-java", // HIDL
"android.hardware.broadcastradio-V1-java", // AIDL
"android.hardware.health-V1.0-java", // HIDL
diff --git a/services/core/java/com/android/server/BootReceiver.java b/services/core/java/com/android/server/BootReceiver.java
index 572e9c2..926d7a4 100644
--- a/services/core/java/com/android/server/BootReceiver.java
+++ b/services/core/java/com/android/server/BootReceiver.java
@@ -62,6 +62,7 @@
import java.nio.file.attribute.PosixFilePermissions;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -328,9 +329,11 @@
* @param tombstone path to the tombstone
* @param proto whether the tombstone is stored as proto
* @param processName the name of the process corresponding to the tombstone
+ * @param tmpFileLock the lock for reading/writing tmp files
*/
public static void addTombstoneToDropBox(
- Context ctx, File tombstone, boolean proto, String processName) {
+ Context ctx, File tombstone, boolean proto, String processName,
+ ReentrantLock tmpFileLock) {
final DropBoxManager db = ctx.getSystemService(DropBoxManager.class);
if (db == null) {
Slog.e(TAG, "Can't log tombstone: DropBoxManager not available");
@@ -351,39 +354,11 @@
// due to rate limiting. Do this by enclosing the proto tombsstone in a
// container proto that has the dropped entry count and the proto tombstone as
// bytes (to avoid the complexity of reading and writing nested protos).
-
- // Read the proto tombstone file as bytes.
- final byte[] tombstoneBytes = Files.readAllBytes(tombstone.toPath());
-
- final File tombstoneProtoWithHeaders = File.createTempFile(
- tombstone.getName(), ".tmp", TOMBSTONE_TMP_DIR);
- Files.setPosixFilePermissions(
- tombstoneProtoWithHeaders.toPath(),
- PosixFilePermissions.fromString("rw-rw----"));
-
- // Write the new proto container proto with headers.
- ParcelFileDescriptor pfd;
+ tmpFileLock.lock();
try {
- pfd = ParcelFileDescriptor.open(tombstoneProtoWithHeaders, MODE_READ_WRITE);
-
- ProtoOutputStream protoStream = new ProtoOutputStream(
- pfd.getFileDescriptor());
- protoStream.write(TombstoneWithHeadersProto.TOMBSTONE, tombstoneBytes);
- protoStream.write(
- TombstoneWithHeadersProto.DROPPED_COUNT,
- rateLimitResult.droppedCountSinceRateLimitActivated());
- protoStream.flush();
-
- // Add the proto to dropbox.
- db.addFile(TAG_TOMBSTONE_PROTO_WITH_HEADERS, tombstoneProtoWithHeaders, 0);
- } catch (FileNotFoundException ex) {
- Slog.e(TAG, "failed to open for write: " + tombstoneProtoWithHeaders, ex);
- throw ex;
+ addAugmentedProtoToDropbox(tombstone, db, rateLimitResult);
} finally {
- // Remove the temporary file.
- if (tombstoneProtoWithHeaders != null) {
- tombstoneProtoWithHeaders.delete();
- }
+ tmpFileLock.unlock();
}
}
} else {
@@ -399,6 +374,44 @@
writeTimestamps(timestamps);
}
+ private static void addAugmentedProtoToDropbox(
+ File tombstone, DropBoxManager db,
+ DropboxRateLimiter.RateLimitResult rateLimitResult) throws IOException {
+ // Read the proto tombstone file as bytes.
+ final byte[] tombstoneBytes = Files.readAllBytes(tombstone.toPath());
+
+ final File tombstoneProtoWithHeaders = File.createTempFile(
+ tombstone.getName(), ".tmp", TOMBSTONE_TMP_DIR);
+ Files.setPosixFilePermissions(
+ tombstoneProtoWithHeaders.toPath(),
+ PosixFilePermissions.fromString("rw-rw----"));
+
+ // Write the new proto container proto with headers.
+ try (ParcelFileDescriptor pfd = ParcelFileDescriptor.open(
+ tombstoneProtoWithHeaders, MODE_READ_WRITE)) {
+ ProtoOutputStream protoStream =
+ new ProtoOutputStream(pfd.getFileDescriptor());
+ protoStream.write(TombstoneWithHeadersProto.TOMBSTONE, tombstoneBytes);
+ protoStream.write(
+ TombstoneWithHeadersProto.DROPPED_COUNT,
+ rateLimitResult.droppedCountSinceRateLimitActivated());
+ protoStream.flush();
+
+ // Add the proto to dropbox.
+ db.addFile(TAG_TOMBSTONE_PROTO_WITH_HEADERS, tombstoneProtoWithHeaders, 0);
+ } catch (FileNotFoundException ex) {
+ Slog.e(TAG, "failed to open for write: " + tombstoneProtoWithHeaders, ex);
+ throw ex;
+ } catch (IOException ex) {
+ Slog.e(TAG, "IO exception during write: " + tombstoneProtoWithHeaders, ex);
+ } finally {
+ // Remove the temporary file and unlock the lock.
+ if (tombstoneProtoWithHeaders != null) {
+ tombstoneProtoWithHeaders.delete();
+ }
+ }
+ }
+
private static void addLastkToDropBox(
DropBoxManager db, HashMap<String, Long> timestamps,
String headers, String footers, String filename, int maxSize,
diff --git a/services/core/java/com/android/server/OWNERS b/services/core/java/com/android/server/OWNERS
index 987507f..3aa275c 100644
--- a/services/core/java/com/android/server/OWNERS
+++ b/services/core/java/com/android/server/OWNERS
@@ -1,5 +1,5 @@
-# BootReceiver
-per-file BootReceiver.java = gaillard@google.com
+# BootReceiver / Watchdog
+per-file BootReceiver.java,Watchdog.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/adb/AdbDebuggingManager.java b/services/core/java/com/android/server/adb/AdbDebuggingManager.java
index 6794f75..3280afdf 100644
--- a/services/core/java/com/android/server/adb/AdbDebuggingManager.java
+++ b/services/core/java/com/android/server/adb/AdbDebuggingManager.java
@@ -1797,8 +1797,13 @@
mFingerprints);
try {
- dump.write("user_keys", AdbDebuggingManagerProto.USER_KEYS,
- FileUtils.readTextFile(new File("/data/misc/adb/adb_keys"), 0, null));
+ File userKeys = new File("/data/misc/adb/adb_keys");
+ if (userKeys.exists()) {
+ dump.write("user_keys", AdbDebuggingManagerProto.USER_KEYS,
+ FileUtils.readTextFile(userKeys, 0, null));
+ } else {
+ Slog.i(TAG, "No user keys on this device");
+ }
} catch (IOException e) {
Slog.i(TAG, "Cannot read user keys", e);
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index c0da30d..6c840a5 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -1690,19 +1690,23 @@
private static final int INDEX_NATIVE_PSS = 0;
private static final int INDEX_NATIVE_SWAP_PSS = 1;
private static final int INDEX_NATIVE_RSS = 2;
- private static final int INDEX_DALVIK_PSS = 3;
- private static final int INDEX_DALVIK_SWAP_PSS = 4;
- private static final int INDEX_DALVIK_RSS = 5;
- private static final int INDEX_OTHER_PSS = 6;
- private static final int INDEX_OTHER_SWAP_PSS = 7;
- private static final int INDEX_OTHER_RSS = 8;
- private static final int INDEX_TOTAL_PSS = 9;
- private static final int INDEX_TOTAL_SWAP_PSS = 10;
- private static final int INDEX_TOTAL_RSS = 11;
- private static final int INDEX_TOTAL_NATIVE_PSS = 12;
- private static final int INDEX_TOTAL_MEMTRACK_GRAPHICS = 13;
- private static final int INDEX_TOTAL_MEMTRACK_GL = 14;
- private static final int INDEX_LAST = 15;
+ private static final int INDEX_NATIVE_PRIVATE_DIRTY = 3;
+ private static final int INDEX_DALVIK_PSS = 4;
+ private static final int INDEX_DALVIK_SWAP_PSS = 5;
+ private static final int INDEX_DALVIK_RSS = 6;
+ private static final int INDEX_DALVIK_PRIVATE_DIRTY = 7;
+ private static final int INDEX_OTHER_PSS = 8;
+ private static final int INDEX_OTHER_SWAP_PSS = 9;
+ private static final int INDEX_OTHER_RSS = 10;
+ private static final int INDEX_OTHER_PRIVATE_DIRTY = 11;
+ private static final int INDEX_TOTAL_PSS = 12;
+ private static final int INDEX_TOTAL_SWAP_PSS = 13;
+ private static final int INDEX_TOTAL_RSS = 14;
+ private static final int INDEX_TOTAL_PRIVATE_DIRTY = 15;
+ private static final int INDEX_TOTAL_NATIVE_PSS = 16;
+ private static final int INDEX_TOTAL_MEMTRACK_GRAPHICS = 17;
+ private static final int INDEX_TOTAL_MEMTRACK_GL = 18;
+ private static final int INDEX_LAST = 19;
/**
* Used to notify activity lifecycle events.
@@ -11355,13 +11359,14 @@
final long pss;
final long swapPss;
final long mRss;
+ final long mPrivateDirty;
final int id; // pid
final int userId;
final boolean hasActivities;
ArrayList<MemItem> subitems;
- MemItem(String label, String shortLabel, long pss, long swapPss, long rss, int id,
- @UserIdInt int userId,
+ MemItem(String label, String shortLabel, long pss, long swapPss, long rss,
+ long privateDirty, int id, @UserIdInt int userId,
boolean hasActivities) {
this.isProc = true;
this.label = label;
@@ -11369,18 +11374,21 @@
this.pss = pss;
this.swapPss = swapPss;
this.mRss = rss;
+ this.mPrivateDirty = privateDirty;
this.id = id;
this.userId = userId;
this.hasActivities = hasActivities;
}
- MemItem(String label, String shortLabel, long pss, long swapPss, long rss, int id) {
+ MemItem(String label, String shortLabel, long pss, long swapPss, long rss,
+ long privateDirty, int id) {
this.isProc = false;
this.label = label;
this.shortLabel = shortLabel;
this.pss = pss;
this.swapPss = swapPss;
this.mRss = rss;
+ this.mPrivateDirty = privateDirty;
this.id = id;
this.userId = UserHandle.USER_SYSTEM;
this.hasActivities = false;
@@ -11405,7 +11413,7 @@
static final void dumpMemItems(PrintWriter pw, String prefix, String tag,
ArrayList<MemItem> items, boolean sort, boolean isCompact, boolean dumpPss,
- boolean dumpSwapPss) {
+ boolean dumpSwapPss, boolean dumpPrivateDirty) {
if (sort && !isCompact) {
sortMemItems(items, dumpPss);
}
@@ -11413,14 +11421,18 @@
for (int i=0; i<items.size(); i++) {
MemItem mi = items.get(i);
if (!isCompact) {
- if (dumpPss && dumpSwapPss) {
- pw.printf("%s%s: %-60s (%s in swap)\n", prefix, stringifyKBSize(mi.pss),
- mi.label, stringifyKBSize(mi.swapPss));
- } else {
- pw.printf("%s%s: %s%s\n", prefix, stringifyKBSize(dumpPss ? mi.pss : mi.mRss),
+ pw.printf("%s%s: %s%s\n", prefix, stringifyKBSize(dumpPss ? mi.pss : mi.mRss),
mi.label,
mi.userId != UserHandle.USER_SYSTEM ? " (user " + mi.userId + ")" : "");
+ if (dumpPss && dumpSwapPss) {
+ pw.printf("(%s in swap%s", stringifyKBSize(mi.swapPss),
+ dumpPrivateDirty ? ", " : ")");
}
+ if (dumpPrivateDirty) {
+ pw.printf("%s%s private dirty)", dumpSwapPss ? "" : "(",
+ stringifyKBSize(mi.mPrivateDirty));
+ }
+ pw.printf("\n");
} else if (mi.isProc) {
pw.print("proc,"); pw.print(tag); pw.print(","); pw.print(mi.shortLabel);
pw.print(","); pw.print(mi.id); pw.print(",");
@@ -11434,7 +11446,7 @@
}
if (mi.subitems != null) {
dumpMemItems(pw, prefix + " ", mi.shortLabel, mi.subitems,
- true, isCompact, dumpPss, dumpSwapPss);
+ true, isCompact, dumpPss, dumpSwapPss, dumpPrivateDirty);
}
}
}
@@ -11602,6 +11614,7 @@
boolean isCheckinRequest;
boolean dumpSwapPss;
boolean dumpProto;
+ boolean mDumpPrivateDirty;
}
@NeverCompile // Avoid size overhead of debugging code.
@@ -11620,6 +11633,7 @@
opts.isCheckinRequest = false;
opts.dumpSwapPss = false;
opts.dumpProto = asProto;
+ opts.mDumpPrivateDirty = false;
int opti = 0;
while (opti < args.length) {
@@ -11642,6 +11656,8 @@
opts.dumpSummaryOnly = true;
} else if ("-S".equals(opt)) {
opts.dumpSwapPss = true;
+ } else if ("-p".equals(opt)) {
+ opts.mDumpPrivateDirty = true;
} else if ("--unreachable".equals(opt)) {
opts.dumpUnreachable = true;
} else if ("--oom".equals(opt)) {
@@ -11662,6 +11678,7 @@
pw.println(" -c: dump in a compact machine-parseable representation.");
pw.println(" -s: dump only summary of application memory usage.");
pw.println(" -S: dump also SwapPss.");
+ pw.println(" -p: dump also private dirty memory usage.");
pw.println(" --oom: only show processes organized by oom adj.");
pw.println(" --local: only collect details locally, don't call process.");
pw.println(" --package: interpret process arg as package, dumping all");
@@ -11780,14 +11797,18 @@
EmptyArray.LONG;
long[] dalvikSubitemRss = opts.dumpDalvik ? new long[Debug.MemoryInfo.NUM_DVK_STATS] :
EmptyArray.LONG;
+ long[] dalvikSubitemPrivateDirty = opts.dumpDalvik
+ ? new long[Debug.MemoryInfo.NUM_DVK_STATS] : EmptyArray.LONG;
long[] miscPss = new long[Debug.MemoryInfo.NUM_OTHER_STATS];
long[] miscSwapPss = new long[Debug.MemoryInfo.NUM_OTHER_STATS];
long[] miscRss = new long[Debug.MemoryInfo.NUM_OTHER_STATS];
+ long[] miscPrivateDirty = new long[Debug.MemoryInfo.NUM_OTHER_STATS];
long[] memtrackTmp = new long[4];
long oomPss[] = new long[DUMP_MEM_OOM_LABEL.length];
long oomSwapPss[] = new long[DUMP_MEM_OOM_LABEL.length];
long[] oomRss = new long[DUMP_MEM_OOM_LABEL.length];
+ long[] oomPrivateDirty = new long[DUMP_MEM_OOM_LABEL.length];
ArrayList<MemItem>[] oomProcs = (ArrayList<MemItem>[])
new ArrayList[DUMP_MEM_OOM_LABEL.length];
@@ -11883,6 +11904,7 @@
final long myTotalUss = mi.getTotalUss();
final long myTotalRss = mi.getTotalRss();
final long myTotalSwapPss = mi.getTotalSwappedOutPss();
+ final long myTotalPrivateDirty = mi.getTotalPrivateDirty();
synchronized (mProcLock) {
if (r.getThread() != null && oomAdj == r.mState.getSetAdjWithServices()) {
@@ -11896,29 +11918,36 @@
ss[INDEX_TOTAL_PSS] += myTotalPss;
ss[INDEX_TOTAL_SWAP_PSS] += myTotalSwapPss;
ss[INDEX_TOTAL_RSS] += myTotalRss;
+ ss[INDEX_TOTAL_PRIVATE_DIRTY] += myTotalPrivateDirty;
ss[INDEX_TOTAL_MEMTRACK_GRAPHICS] += memtrackGraphics;
ss[INDEX_TOTAL_MEMTRACK_GL] += memtrackGl;
MemItem pssItem = new MemItem(r.processName + " (pid " + pid +
(hasActivities ? " / activities)" : ")"), r.processName, myTotalPss,
- myTotalSwapPss, myTotalRss, pid, r.userId, hasActivities);
+ myTotalSwapPss, myTotalRss, myTotalPrivateDirty,
+ pid, r.userId, hasActivities);
procMems.add(pssItem);
procMemsMap.put(pid, pssItem);
ss[INDEX_NATIVE_PSS] += mi.nativePss;
ss[INDEX_NATIVE_SWAP_PSS] += mi.nativeSwappedOutPss;
ss[INDEX_NATIVE_RSS] += mi.nativeRss;
+ ss[INDEX_NATIVE_PRIVATE_DIRTY] += mi.nativePrivateDirty;
ss[INDEX_DALVIK_PSS] += mi.dalvikPss;
ss[INDEX_DALVIK_SWAP_PSS] += mi.dalvikSwappedOutPss;
ss[INDEX_DALVIK_RSS] += mi.dalvikRss;
+ ss[INDEX_DALVIK_PRIVATE_DIRTY] += mi.dalvikPrivateDirty;
for (int j=0; j<dalvikSubitemPss.length; j++) {
dalvikSubitemPss[j] += mi.getOtherPss(Debug.MemoryInfo.NUM_OTHER_STATS + j);
dalvikSubitemSwapPss[j] +=
mi.getOtherSwappedOutPss(Debug.MemoryInfo.NUM_OTHER_STATS + j);
+ dalvikSubitemPrivateDirty[j] +=
+ mi.getOtherPrivateDirty(Debug.MemoryInfo.NUM_OTHER_STATS + j);
dalvikSubitemRss[j] += mi.getOtherRss(Debug.MemoryInfo.NUM_OTHER_STATS + j);
}
ss[INDEX_OTHER_PSS] += mi.otherPss;
ss[INDEX_OTHER_RSS] += mi.otherRss;
ss[INDEX_OTHER_SWAP_PSS] += mi.otherSwappedOutPss;
+ ss[INDEX_OTHER_PRIVATE_DIRTY] += mi.otherPrivateDirty;
for (int j=0; j<Debug.MemoryInfo.NUM_OTHER_STATS; j++) {
long mem = mi.getOtherPss(j);
miscPss[j] += mem;
@@ -11926,6 +11955,9 @@
mem = mi.getOtherSwappedOutPss(j);
miscSwapPss[j] += mem;
ss[INDEX_OTHER_SWAP_PSS] -= mem;
+ mem = mi.getOtherPrivateDirty(j);
+ miscPrivateDirty[j] += mem;
+ ss[INDEX_OTHER_PRIVATE_DIRTY] -= mem;
mem = mi.getOtherRss(j);
miscRss[j] += mem;
ss[INDEX_OTHER_RSS] -= mem;
@@ -11942,6 +11974,7 @@
&& oomAdj < DUMP_MEM_OOM_ADJ[oomIndex + 1])) {
oomPss[oomIndex] += myTotalPss;
oomSwapPss[oomIndex] += myTotalSwapPss;
+ oomPrivateDirty[oomIndex] += myTotalPrivateDirty;
if (oomProcs[oomIndex] == null) {
oomProcs[oomIndex] = new ArrayList<MemItem>();
}
@@ -11988,6 +12021,7 @@
final long myTotalPss = info.getTotalPss();
final long myTotalSwapPss = info.getTotalSwappedOutPss();
final long myTotalRss = info.getTotalRss();
+ final long myTotalPrivateDirty = info.getTotalPrivateDirty();
ss[INDEX_TOTAL_PSS] += myTotalPss;
ss[INDEX_TOTAL_SWAP_PSS] += myTotalSwapPss;
ss[INDEX_TOTAL_RSS] += myTotalRss;
@@ -11997,15 +12031,17 @@
MemItem pssItem = new MemItem(st.name + " (pid " + st.pid + ")",
st.name, myTotalPss, info.getSummaryTotalSwapPss(), myTotalRss,
- st.pid, UserHandle.getUserId(st.uid), false);
+ myTotalPrivateDirty, st.pid, UserHandle.getUserId(st.uid), false);
procMems.add(pssItem);
ss[INDEX_NATIVE_PSS] += info.nativePss;
ss[INDEX_NATIVE_SWAP_PSS] += info.nativeSwappedOutPss;
ss[INDEX_NATIVE_RSS] += info.nativeRss;
+ ss[INDEX_NATIVE_PRIVATE_DIRTY] += info.nativePrivateDirty;
ss[INDEX_DALVIK_PSS] += info.dalvikPss;
ss[INDEX_DALVIK_SWAP_PSS] += info.dalvikSwappedOutPss;
ss[INDEX_DALVIK_RSS] += info.dalvikRss;
+ ss[INDEX_DALVIK_PRIVATE_DIRTY] += info.dalvikPrivateDirty;
for (int j = 0; j < dalvikSubitemPss.length; j++) {
dalvikSubitemPss[j] += info.getOtherPss(
Debug.MemoryInfo.NUM_OTHER_STATS + j);
@@ -12013,10 +12049,13 @@
info.getOtherSwappedOutPss(Debug.MemoryInfo.NUM_OTHER_STATS + j);
dalvikSubitemRss[j] += info.getOtherRss(Debug.MemoryInfo.NUM_OTHER_STATS
+ j);
+ dalvikSubitemPrivateDirty[j] +=
+ info.getOtherPrivateDirty(Debug.MemoryInfo.NUM_OTHER_STATS + j);
}
ss[INDEX_OTHER_PSS] += info.otherPss;
ss[INDEX_OTHER_SWAP_PSS] += info.otherSwappedOutPss;
ss[INDEX_OTHER_RSS] += info.otherRss;
+ ss[INDEX_OTHER_PRIVATE_DIRTY] += info.otherPrivateDirty;
for (int j = 0; j < Debug.MemoryInfo.NUM_OTHER_STATS; j++) {
long mem = info.getOtherPss(j);
miscPss[j] += mem;
@@ -12027,6 +12066,9 @@
mem = info.getOtherRss(j);
miscRss[j] += mem;
ss[INDEX_OTHER_RSS] -= mem;
+ mem = info.getOtherPrivateDirty(j);
+ miscPrivateDirty[j] += mem;
+ ss[INDEX_OTHER_PRIVATE_DIRTY] -= mem;
}
oomPss[0] += myTotalPss;
oomSwapPss[0] += myTotalSwapPss;
@@ -12035,21 +12077,26 @@
}
oomProcs[0].add(pssItem);
oomRss[0] += myTotalRss;
+ oomPrivateDirty[0] += myTotalPrivateDirty;
}
});
ArrayList<MemItem> catMems = new ArrayList<MemItem>();
catMems.add(new MemItem("Native", "Native",
- ss[INDEX_NATIVE_PSS], ss[INDEX_NATIVE_SWAP_PSS], ss[INDEX_NATIVE_RSS], -1));
+ ss[INDEX_NATIVE_PSS], ss[INDEX_NATIVE_SWAP_PSS],
+ ss[INDEX_NATIVE_RSS], ss[INDEX_NATIVE_PRIVATE_DIRTY], -1));
final int dalvikId = -2;
catMems.add(new MemItem("Dalvik", "Dalvik", ss[INDEX_DALVIK_PSS],
- ss[INDEX_DALVIK_SWAP_PSS], ss[INDEX_DALVIK_RSS], dalvikId));
+ ss[INDEX_DALVIK_SWAP_PSS], ss[INDEX_DALVIK_RSS],
+ ss[INDEX_DALVIK_PRIVATE_DIRTY], dalvikId));
catMems.add(new MemItem("Unknown", "Unknown", ss[INDEX_OTHER_PSS],
- ss[INDEX_OTHER_SWAP_PSS], ss[INDEX_OTHER_RSS], -3));
+ ss[INDEX_OTHER_SWAP_PSS], ss[INDEX_OTHER_RSS],
+ ss[INDEX_OTHER_PRIVATE_DIRTY], -3));
for (int j=0; j<Debug.MemoryInfo.NUM_OTHER_STATS; j++) {
String label = Debug.MemoryInfo.getOtherLabel(j);
- catMems.add(new MemItem(label, label, miscPss[j], miscSwapPss[j], miscRss[j], j));
+ catMems.add(new MemItem(label, label, miscPss[j], miscSwapPss[j], miscRss[j],
+ miscPrivateDirty[j], j));
}
if (dalvikSubitemPss.length > 0) {
// Add dalvik subitems.
@@ -12075,7 +12122,8 @@
final String name = Debug.MemoryInfo.getOtherLabel(
Debug.MemoryInfo.NUM_OTHER_STATS + j);
memItem.subitems.add(new MemItem(name, name, dalvikSubitemPss[j],
- dalvikSubitemSwapPss[j], dalvikSubitemRss[j], j));
+ dalvikSubitemSwapPss[j], dalvikSubitemRss[j],
+ dalvikSubitemPrivateDirty[j], j));
}
}
}
@@ -12086,7 +12134,7 @@
String label = opts.isCompact ? DUMP_MEM_OOM_COMPACT_LABEL[j]
: DUMP_MEM_OOM_LABEL[j];
MemItem item = new MemItem(label, label, oomPss[j], oomSwapPss[j], oomRss[j],
- DUMP_MEM_OOM_ADJ[j]);
+ oomPrivateDirty[j], DUMP_MEM_OOM_ADJ[j]);
item.subitems = oomProcs[j];
oomMems.add(item);
}
@@ -12097,33 +12145,34 @@
if (!brief && !opts.oomOnly && !opts.isCompact) {
pw.println();
pw.println("Total RSS by process:");
- dumpMemItems(pw, " ", "proc", procMems, true, opts.isCompact, false, false);
+ dumpMemItems(pw, " ", "proc", procMems, true, opts.isCompact, false, false, false);
pw.println();
}
if (!opts.isCompact) {
pw.println("Total RSS by OOM adjustment:");
}
- dumpMemItems(pw, " ", "oom", oomMems, false, opts.isCompact, false, false);
+ dumpMemItems(pw, " ", "oom", oomMems, false, opts.isCompact, false, false, false);
if (!brief && !opts.oomOnly) {
PrintWriter out = categoryPw != null ? categoryPw : pw;
if (!opts.isCompact) {
out.println();
out.println("Total RSS by category:");
}
- dumpMemItems(out, " ", "cat", catMems, true, opts.isCompact, false, false);
+ dumpMemItems(out, " ", "cat", catMems, true, opts.isCompact, false, false, false);
}
opts.dumpSwapPss = opts.dumpSwapPss && hasSwapPss && ss[INDEX_TOTAL_SWAP_PSS] != 0;
if (!brief && !opts.oomOnly && !opts.isCompact) {
pw.println();
pw.println("Total PSS by process:");
dumpMemItems(pw, " ", "proc", procMems, true, opts.isCompact, true,
- opts.dumpSwapPss);
+ opts.dumpSwapPss, opts.mDumpPrivateDirty);
pw.println();
}
if (!opts.isCompact) {
pw.println("Total PSS by OOM adjustment:");
}
- dumpMemItems(pw, " ", "oom", oomMems, false, opts.isCompact, true, opts.dumpSwapPss);
+ dumpMemItems(pw, " ", "oom", oomMems, false, opts.isCompact, true, opts.dumpSwapPss,
+ opts.mDumpPrivateDirty);
if (!brief && !opts.oomOnly) {
PrintWriter out = categoryPw != null ? categoryPw : pw;
if (!opts.isCompact) {
@@ -12131,7 +12180,7 @@
out.println("Total PSS by category:");
}
dumpMemItems(out, " ", "cat", catMems, true, opts.isCompact, true,
- opts.dumpSwapPss);
+ opts.dumpSwapPss, opts.mDumpPrivateDirty);
}
if (!opts.isCompact) {
pw.println();
@@ -12533,7 +12582,7 @@
ss[INDEX_TOTAL_RSS] += myTotalRss;
MemItem pssItem = new MemItem(r.processName + " (pid " + pid +
(hasActivities ? " / activities)" : ")"), r.processName, myTotalPss,
- myTotalSwapPss, myTotalRss, pid, r.userId, hasActivities);
+ myTotalSwapPss, myTotalRss, 0, pid, r.userId, hasActivities);
procMems.add(pssItem);
procMemsMap.put(pid, pssItem);
@@ -12620,7 +12669,7 @@
ss[INDEX_TOTAL_NATIVE_PSS] += myTotalPss;
MemItem pssItem = new MemItem(st.name + " (pid " + st.pid + ")",
- st.name, myTotalPss, info.getSummaryTotalSwapPss(), myTotalRss,
+ st.name, myTotalPss, info.getSummaryTotalSwapPss(), myTotalRss, 0,
st.pid, UserHandle.getUserId(st.uid), false);
procMems.add(pssItem);
@@ -12665,15 +12714,16 @@
ArrayList<MemItem> catMems = new ArrayList<MemItem>();
catMems.add(new MemItem("Native", "Native", ss[INDEX_NATIVE_PSS],
- ss[INDEX_NATIVE_SWAP_PSS], ss[INDEX_NATIVE_RSS], -1));
+ ss[INDEX_NATIVE_SWAP_PSS], ss[INDEX_NATIVE_RSS], 0, -1));
final int dalvikId = -2;
catMems.add(new MemItem("Dalvik", "Dalvik", ss[INDEX_DALVIK_PSS],
- ss[INDEX_DALVIK_SWAP_PSS], ss[INDEX_DALVIK_RSS], dalvikId));
+ ss[INDEX_DALVIK_SWAP_PSS], ss[INDEX_DALVIK_RSS], 0, dalvikId));
catMems.add(new MemItem("Unknown", "Unknown", ss[INDEX_OTHER_PSS],
- ss[INDEX_OTHER_SWAP_PSS], ss[INDEX_OTHER_RSS], -3));
+ ss[INDEX_OTHER_SWAP_PSS], ss[INDEX_OTHER_RSS], 0, -3));
for (int j=0; j<Debug.MemoryInfo.NUM_OTHER_STATS; j++) {
String label = Debug.MemoryInfo.getOtherLabel(j);
- catMems.add(new MemItem(label, label, miscPss[j], miscSwapPss[j], miscRss[j], j));
+ catMems.add(new MemItem(label, label, miscPss[j], miscSwapPss[j],
+ miscRss[j], 0, j));
}
if (dalvikSubitemPss.length > 0) {
// Add dalvik subitems.
@@ -12699,7 +12749,7 @@
final String name = Debug.MemoryInfo.getOtherLabel(
Debug.MemoryInfo.NUM_OTHER_STATS + j);
memItem.subitems.add(new MemItem(name, name, dalvikSubitemPss[j],
- dalvikSubitemSwapPss[j], dalvikSubitemRss[j], j));
+ dalvikSubitemSwapPss[j], dalvikSubitemRss[j], 0, j));
}
}
}
@@ -12709,7 +12759,7 @@
if (oomPss[j] != 0) {
String label = opts.isCompact ? DUMP_MEM_OOM_COMPACT_LABEL[j]
: DUMP_MEM_OOM_LABEL[j];
- MemItem item = new MemItem(label, label, oomPss[j], oomSwapPss[j], oomRss[j],
+ MemItem item = new MemItem(label, label, oomPss[j], oomSwapPss[j], oomRss[j], 0,
DUMP_MEM_OOM_ADJ[j]);
item.subitems = oomProcs[j];
oomMems.add(item);
diff --git a/services/core/java/com/android/server/am/BroadcastProcessQueue.java b/services/core/java/com/android/server/am/BroadcastProcessQueue.java
index 0fcec6f..c26fd5d 100644
--- a/services/core/java/com/android/server/am/BroadcastProcessQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastProcessQueue.java
@@ -258,13 +258,6 @@
@Nullable
public BroadcastRecord enqueueOrReplaceBroadcast(@NonNull BroadcastRecord record,
int recordIndex, @NonNull BroadcastConsumer deferredStatesApplyConsumer) {
- // When updateDeferredStates() has already applied a deferred state to
- // all pending items, apply to this new broadcast too
- if (mLastDeferredStates && record.deferUntilActive
- && (record.getDeliveryState(recordIndex) == BroadcastRecord.DELIVERY_PENDING)) {
- deferredStatesApplyConsumer.accept(record, recordIndex);
- }
-
// Ignore FLAG_RECEIVER_REPLACE_PENDING if the sender specified the policy using the
// BroadcastOptions delivery group APIs.
if (record.isReplacePending()
@@ -287,6 +280,13 @@
// with implicit responsiveness expectations.
getQueueForBroadcast(record).addLast(newBroadcastArgs);
onBroadcastEnqueued(record, recordIndex);
+
+ // When updateDeferredStates() has already applied a deferred state to
+ // all pending items, apply to this new broadcast too
+ if (mLastDeferredStates && shouldBeDeferred()
+ && (record.getDeliveryState(recordIndex) == BroadcastRecord.DELIVERY_PENDING)) {
+ deferredStatesApplyConsumer.accept(record, recordIndex);
+ }
return null;
}
@@ -1144,9 +1144,6 @@
} else if (mProcessPersistent) {
mRunnableAt = runnableAt + constants.DELAY_PERSISTENT_PROC_MILLIS;
mRunnableAtReason = REASON_PERSISTENT;
- } else if (UserHandle.isCore(uid)) {
- mRunnableAt = runnableAt;
- mRunnableAtReason = REASON_CORE_UID;
} else if (mCountOrdered > 0) {
mRunnableAt = runnableAt;
mRunnableAtReason = REASON_CONTAINS_ORDERED;
@@ -1193,6 +1190,9 @@
// is already cached, they'll be deferred on the line above
mRunnableAt = runnableAt;
mRunnableAtReason = REASON_CONTAINS_RESULT_TO;
+ } else if (UserHandle.isCore(uid)) {
+ mRunnableAt = runnableAt;
+ mRunnableAtReason = REASON_CORE_UID;
} else {
mRunnableAt = runnableAt + constants.DELAY_NORMAL_MILLIS;
mRunnableAtReason = REASON_NORMAL;
@@ -1221,32 +1221,45 @@
}
/**
- * Update {@link BroadcastRecord.DELIVERY_DEFERRED} states of all our
+ * Update {@link BroadcastRecord#DELIVERY_DEFERRED} states of all our
* pending broadcasts, when needed.
*/
void updateDeferredStates(@NonNull BroadcastConsumer applyConsumer,
@NonNull BroadcastConsumer clearConsumer) {
// When all we have pending is deferred broadcasts, and we're cached,
// then we want everything to be marked deferred
- final boolean wantDeferredStates = (mCountDeferred > 0)
- && (mCountDeferred == mCountEnqueued) && mProcessFreezable;
+ final boolean wantDeferredStates = shouldBeDeferred();
if (mLastDeferredStates != wantDeferredStates) {
mLastDeferredStates = wantDeferredStates;
if (wantDeferredStates) {
forEachMatchingBroadcast((r, i) -> {
- return r.deferUntilActive
- && (r.getDeliveryState(i) == BroadcastRecord.DELIVERY_PENDING);
+ return (r.getDeliveryState(i) == BroadcastRecord.DELIVERY_PENDING);
}, applyConsumer, false);
} else {
forEachMatchingBroadcast((r, i) -> {
- return r.deferUntilActive
- && (r.getDeliveryState(i) == BroadcastRecord.DELIVERY_DEFERRED);
+ return (r.getDeliveryState(i) == BroadcastRecord.DELIVERY_DEFERRED);
}, clearConsumer, false);
}
}
}
+ void clearDeferredStates(@NonNull BroadcastConsumer clearConsumer) {
+ if (mLastDeferredStates) {
+ mLastDeferredStates = false;
+ forEachMatchingBroadcast((r, i) -> {
+ return (r.getDeliveryState(i) == BroadcastRecord.DELIVERY_DEFERRED);
+ }, clearConsumer, false);
+ }
+ }
+
+ @VisibleForTesting
+ boolean shouldBeDeferred() {
+ if (mRunnableAtInvalidated) updateRunnableAt();
+ return mRunnableAtReason == REASON_CACHED
+ || mRunnableAtReason == REASON_CACHED_INFINITE_DEFER;
+ }
+
/**
* Check overall health, confirming things are in a reasonable state and
* that we're not wedged.
diff --git a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
index f420619..abec890 100644
--- a/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
+++ b/services/core/java/com/android/server/am/BroadcastQueueModernImpl.java
@@ -249,6 +249,7 @@
private static final int MSG_CHECK_HEALTH = 5;
private static final int MSG_CHECK_PENDING_COLD_START_VALIDITY = 6;
private static final int MSG_PROCESS_FREEZABLE_CHANGED = 7;
+ private static final int MSG_UID_STATE_CHANGED = 8;
private void enqueueUpdateRunningList() {
mLocalHandler.removeMessages(MSG_UPDATE_RUNNING_LIST);
@@ -295,6 +296,19 @@
}
return true;
}
+ case MSG_UID_STATE_CHANGED: {
+ final int uid = (int) msg.obj;
+ final int procState = msg.arg1;
+ synchronized (mService) {
+ if (procState == ActivityManager.PROCESS_STATE_TOP) {
+ mUidForeground.put(uid, true);
+ } else {
+ mUidForeground.delete(uid);
+ }
+ refreshProcessQueuesLocked(uid);
+ }
+ return true;
+ }
}
return false;
};
@@ -450,6 +464,10 @@
break;
}
+ // Clear the deferred state of broadcasts in this queue as we are just about to
+ // deliver broadcasts to this process.
+ queue.clearDeferredStates(mBroadcastConsumerDeferClear);
+
// We might not have heard about a newly running process yet, so
// consider refreshing if we think we're cold
updateWarmProcess(queue);
@@ -672,7 +690,7 @@
@Override
public void onProcessFreezableChangedLocked(@NonNull ProcessRecord app) {
mLocalHandler.removeMessages(MSG_PROCESS_FREEZABLE_CHANGED, app);
- mLocalHandler.sendMessage(mHandler.obtainMessage(MSG_PROCESS_FREEZABLE_CHANGED, app));
+ mLocalHandler.obtainMessage(MSG_PROCESS_FREEZABLE_CHANGED, app).sendToTarget();
}
@Override
@@ -1510,12 +1528,14 @@
r.resultExtras = null;
};
- private final BroadcastConsumer mBroadcastConsumerDeferApply = (r, i) -> {
+ @VisibleForTesting
+ final BroadcastConsumer mBroadcastConsumerDeferApply = (r, i) -> {
setDeliveryState(null, null, r, i, r.receivers.get(i), BroadcastRecord.DELIVERY_DEFERRED,
"mBroadcastConsumerDeferApply");
};
- private final BroadcastConsumer mBroadcastConsumerDeferClear = (r, i) -> {
+ @VisibleForTesting
+ final BroadcastConsumer mBroadcastConsumerDeferClear = (r, i) -> {
setDeliveryState(null, null, r, i, r.receivers.get(i), BroadcastRecord.DELIVERY_PENDING,
"mBroadcastConsumerDeferClear");
};
@@ -1601,14 +1621,9 @@
@Override
public void onUidStateChanged(int uid, int procState, long procStateSeq,
int capability) {
- synchronized (mService) {
- if (procState == ActivityManager.PROCESS_STATE_TOP) {
- mUidForeground.put(uid, true);
- } else {
- mUidForeground.delete(uid);
- }
- refreshProcessQueuesLocked(uid);
- }
+ mLocalHandler.removeMessages(MSG_UID_STATE_CHANGED, uid);
+ mLocalHandler.obtainMessage(MSG_UID_STATE_CHANGED, procState, 0, uid)
+ .sendToTarget();
}
}, ActivityManager.UID_OBSERVER_PROCSTATE,
ActivityManager.PROCESS_STATE_TOP, "android");
diff --git a/services/core/java/com/android/server/appop/AppOpsCheckingServiceImpl.java b/services/core/java/com/android/server/appop/AppOpsCheckingServiceImpl.java
index 4dfd9b0..f0dd23c 100644
--- a/services/core/java/com/android/server/appop/AppOpsCheckingServiceImpl.java
+++ b/services/core/java/com/android/server/appop/AppOpsCheckingServiceImpl.java
@@ -221,20 +221,24 @@
synchronized (mLock) {
SparseIntArray opModes = mUidModes.get(uid, null);
if (opModes == null) {
- if (mode != defaultMode) {
- opModes = new SparseIntArray();
- mUidModes.put(uid, opModes);
- opModes.put(op, mode);
- scheduleWriteLocked();
+ if (mode == defaultMode) {
+ return false;
}
+ opModes = new SparseIntArray();
+ mUidModes.put(uid, opModes);
+ opModes.put(op, mode);
+ scheduleWriteLocked();
} else {
- if (opModes.indexOfKey(op) >= 0 && opModes.get(op) == mode) {
+ if (opModes.indexOfKey(op) >= 0) {
+ if (opModes.get(op) == mode) {
+ return false;
+ }
+ } else if (mode == defaultMode) {
return false;
}
if (mode == defaultMode) {
opModes.delete(op);
if (opModes.size() <= 0) {
- opModes = null;
mUidModes.delete(uid);
}
} else {
diff --git a/services/core/java/com/android/server/audio/SpatializerHelper.java b/services/core/java/com/android/server/audio/SpatializerHelper.java
index 18f24db..f465867 100644
--- a/services/core/java/com/android/server/audio/SpatializerHelper.java
+++ b/services/core/java/com/android/server/audio/SpatializerHelper.java
@@ -965,6 +965,11 @@
if (mSpat == null) {
mSpatCallback = new SpatializerCallback();
mSpat = AudioSystem.getSpatializer(mSpatCallback);
+ if (mSpat == null) {
+ Log.e(TAG, "createSpat(): No Spatializer found");
+ postReset();
+ return;
+ }
try {
//TODO: register heatracking callback only when sensors are registered
if (mIsHeadTrackingSupported) {
diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java
index 3c885a1..3b18f0c 100644
--- a/services/core/java/com/android/server/camera/CameraServiceProxy.java
+++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java
@@ -52,7 +52,6 @@
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbManager;
import android.media.AudioManager;
-import android.nfc.INfcAdapter;
import android.nfc.NfcAdapter;
import android.nfc.NfcManager;
import android.os.Binder;
@@ -1252,45 +1251,19 @@
}
}
- // TODO(b/303286040): Remove the raw INfcAdapter usage once |ENABLE_NFC_MAINLINE_FLAG| is
- // rolled out.
- private static final String NFC_SERVICE_BINDER_NAME = "nfc";
- // Flags arguments to NFC adapter to enable/disable NFC
- public static final int DISABLE_POLLING_FLAGS = 0x1000;
- public static final int ENABLE_POLLING_FLAGS = 0x0000;
- private void setNfcReaderModeUsingINfcAdapter(boolean enablePolling) {
- IBinder nfcServiceBinder = getBinderService(NFC_SERVICE_BINDER_NAME);
- if (nfcServiceBinder == null) {
+ private void notifyNfcService(boolean enablePolling) {
+ NfcManager nfcManager = mContext.getSystemService(NfcManager.class);
+ if (nfcManager == null) {
Slog.w(TAG, "Could not connect to NFC service to notify it of camera state");
return;
}
- INfcAdapter nfcAdapterRaw = INfcAdapter.Stub.asInterface(nfcServiceBinder);
- int flags = enablePolling ? ENABLE_POLLING_FLAGS : DISABLE_POLLING_FLAGS;
- if (DEBUG) Slog.v(TAG, "Setting NFC reader mode to flags " + flags);
- try {
- nfcAdapterRaw.setReaderMode(nfcInterfaceToken, null, flags, null);
- } catch (RemoteException e) {
- Slog.w(TAG, "Could not notify NFC service, remote exception: " + e);
+ NfcAdapter nfcAdapter = nfcManager.getDefaultAdapter();
+ if (nfcAdapter == null) {
+ Slog.w(TAG, "Could not connect to NFC service to notify it of camera state");
+ return;
}
- }
-
- private void notifyNfcService(boolean enablePolling) {
- if (android.nfc.Flags.enableNfcMainline()) {
- NfcManager nfcManager = mContext.getSystemService(NfcManager.class);
- if (nfcManager == null) {
- Slog.w(TAG, "Could not connect to NFC service to notify it of camera state");
- return;
- }
- NfcAdapter nfcAdapter = nfcManager.getDefaultAdapter();
- if (nfcAdapter == null) {
- Slog.w(TAG, "Could not connect to NFC service to notify it of camera state");
- return;
- }
- if (DEBUG) Slog.v(TAG, "Setting NFC reader mode. enablePolling: " + enablePolling);
- nfcAdapter.setReaderMode(enablePolling);
- } else {
- setNfcReaderModeUsingINfcAdapter(enablePolling);
- }
+ if (DEBUG) Slog.v(TAG, "Setting NFC reader mode. enablePolling: " + enablePolling);
+ nfcAdapter.setReaderMode(enablePolling);
}
private static int[] toArray(Collection<Integer> c) {
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index 4b8b431..74310b5 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -54,6 +54,7 @@
import android.hardware.display.DisplayManager;
import android.net.Uri;
import android.os.Binder;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
@@ -65,7 +66,6 @@
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.DeviceConfig;
@@ -114,8 +114,6 @@
public class ClipboardService extends SystemService {
private static final String TAG = "ClipboardService";
- private static final boolean IS_EMULATOR =
- SystemProperties.getBoolean("ro.boot.qemu", false);
@VisibleForTesting
public static final long DEFAULT_CLIPBOARD_TIMEOUT_MILLIS = 3600000;
@@ -190,7 +188,7 @@
mAutofillInternal = LocalServices.getService(AutofillManagerInternal.class);
final IBinder permOwner = mUgmInternal.newUriPermissionOwner("clipboard");
mPermissionOwner = permOwner;
- if (IS_EMULATOR) {
+ if (Build.IS_EMULATOR) {
mEmulatorClipboardMonitor = new EmulatorClipboardMonitor((clip) -> {
synchronized (mLock) {
setPrimaryClipInternalLocked(getClipboardLocked(0, DEVICE_ID_DEFAULT), clip,
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index aef2248..c517058 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -56,7 +56,6 @@
import android.content.pm.UserInfo;
import android.net.ConnectivityDiagnosticsManager;
import android.net.ConnectivityManager;
-import android.net.DnsResolver;
import android.net.INetd;
import android.net.INetworkManagementEventObserver;
import android.net.Ikev2VpnProfile;
@@ -67,8 +66,6 @@
import android.net.IpSecTransform;
import android.net.LinkAddress;
import android.net.LinkProperties;
-import android.net.LocalSocket;
-import android.net.LocalSocketAddress;
import android.net.Network;
import android.net.NetworkAgent;
import android.net.NetworkAgentConfig;
@@ -109,7 +106,6 @@
import android.os.Binder;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
-import android.os.CancellationSignal;
import android.os.Handler;
import android.os.IBinder;
import android.os.INetworkManagementService;
@@ -120,7 +116,6 @@
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
-import android.os.SystemService;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -160,11 +155,8 @@
import libcore.io.IoUtils;
-import java.io.File;
import java.io.FileDescriptor;
import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
@@ -190,8 +182,6 @@
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.UUID;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledFuture;
@@ -451,10 +441,6 @@
// The user id of initiating VPN.
private final int mUserId;
- interface RetryScheduler {
- void checkInterruptAndDelay(boolean sleepLonger) throws InterruptedException;
- }
-
private static class CarrierConfigInfo {
public final String mccMnc;
public final int keepaliveDelaySec;
@@ -483,26 +469,6 @@
return Binder.getCallingUid() == Process.SYSTEM_UID;
}
- public void startService(final String serviceName) {
- SystemService.start(serviceName);
- }
-
- public void stopService(final String serviceName) {
- SystemService.stop(serviceName);
- }
-
- public boolean isServiceRunning(final String serviceName) {
- return SystemService.isRunning(serviceName);
- }
-
- public boolean isServiceStopped(final String serviceName) {
- return SystemService.isStopped(serviceName);
- }
-
- public File getStateFile() {
- return new File("/data/misc/vpn/state");
- }
-
public DeviceIdleInternal getDeviceIdleInternal() {
return LocalServices.getService(DeviceIdleInternal.class);
}
@@ -511,104 +477,6 @@
return VpnConfig.getIntentForStatusPanel(context);
}
- public void sendArgumentsToDaemon(
- final String daemon, final LocalSocket socket, final String[] arguments,
- final RetryScheduler retryScheduler) throws IOException, InterruptedException {
- final LocalSocketAddress address = new LocalSocketAddress(
- daemon, LocalSocketAddress.Namespace.RESERVED);
-
- // Wait for the socket to connect.
- while (true) {
- try {
- socket.connect(address);
- break;
- } catch (Exception e) {
- // ignore
- }
- retryScheduler.checkInterruptAndDelay(true /* sleepLonger */);
- }
- socket.setSoTimeout(500);
-
- final OutputStream out = socket.getOutputStream();
- for (String argument : arguments) {
- byte[] bytes = argument.getBytes(StandardCharsets.UTF_8);
- if (bytes.length >= 0xFFFF) {
- throw new IllegalArgumentException("Argument is too large");
- }
- out.write(bytes.length >> 8);
- out.write(bytes.length);
- out.write(bytes);
- retryScheduler.checkInterruptAndDelay(false /* sleepLonger */);
- }
- out.write(0xFF);
- out.write(0xFF);
-
- // Wait for End-of-File.
- final InputStream in = socket.getInputStream();
- while (true) {
- try {
- if (in.read() == -1) {
- break;
- }
- } catch (Exception e) {
- // ignore
- }
- retryScheduler.checkInterruptAndDelay(true /* sleepLonger */);
- }
- }
-
- @NonNull
- public InetAddress resolve(final String endpoint)
- throws ExecutionException, InterruptedException {
- try {
- return InetAddresses.parseNumericAddress(endpoint);
- } catch (IllegalArgumentException e) {
- // Endpoint is not numeric : fall through and resolve
- }
-
- final CancellationSignal cancellationSignal = new CancellationSignal();
- try {
- final DnsResolver resolver = DnsResolver.getInstance();
- final CompletableFuture<InetAddress> result = new CompletableFuture();
- final DnsResolver.Callback<List<InetAddress>> cb =
- new DnsResolver.Callback<List<InetAddress>>() {
- @Override
- public void onAnswer(@NonNull final List<InetAddress> answer,
- final int rcode) {
- if (answer.size() > 0) {
- result.complete(answer.get(0));
- } else {
- result.completeExceptionally(
- new UnknownHostException(endpoint));
- }
- }
-
- @Override
- public void onError(@Nullable final DnsResolver.DnsException error) {
- // Unfortunately UnknownHostException doesn't accept a cause, so
- // print a message here instead. Only show the summary, not the
- // full stack trace.
- Log.e(TAG, "Async dns resolver error : " + error);
- result.completeExceptionally(new UnknownHostException(endpoint));
- }
- };
- resolver.query(null /* network, null for default */, endpoint,
- DnsResolver.FLAG_EMPTY, r -> r.run(), cancellationSignal, cb);
- return result.get();
- } catch (final ExecutionException e) {
- Log.e(TAG, "Cannot resolve VPN endpoint : " + endpoint + ".", e);
- throw e;
- } catch (final InterruptedException e) {
- Log.e(TAG, "Legacy VPN was interrupted while resolving the endpoint", e);
- cancellationSignal.cancel();
- throw e;
- }
- }
-
- public boolean isInterfacePresent(final Vpn vpn, final String iface) {
- return vpn.jniCheck(iface) != 0;
- }
-
/**
* @see ParcelFileDescriptor#adoptFd(int)
*/
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
index 7d0d5a7..ec6b5ea 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -559,7 +559,9 @@
HdmiDeviceInfo cecDeviceInfo = mService.getHdmiCecNetwork().getCecDeviceInfo(address);
// If no non-default display name is available for the device, request the devices OSD name.
- if (cecDeviceInfo != null && cecDeviceInfo.getDisplayName().equals(
+ // On TV devices, the OSD name is queried in NewDeviceAction instead.
+ if (!mService.isTvDevice() && cecDeviceInfo != null
+ && cecDeviceInfo.getDisplayName().equals(
HdmiUtils.getDefaultDeviceName(address))) {
mService.sendCecCommand(
HdmiCecMessageBuilder.buildGiveOsdNameCommand(
diff --git a/services/core/java/com/android/server/hdmi/NewDeviceAction.java b/services/core/java/com/android/server/hdmi/NewDeviceAction.java
index 6147c10..f3532e5 100644
--- a/services/core/java/com/android/server/hdmi/NewDeviceAction.java
+++ b/services/core/java/com/android/server/hdmi/NewDeviceAction.java
@@ -182,7 +182,7 @@
.setVendorId(mVendorId)
.setDisplayName(mDisplayName)
.build();
- localDevice().mService.getHdmiCecNetwork().addCecDevice(deviceInfo);
+ localDevice().mService.getHdmiCecNetwork().updateCecDevice(deviceInfo);
// Consume CEC messages we already got for this newly found device.
tv().processDelayedMessages(mDeviceLogicalAddress);
diff --git a/services/core/java/com/android/server/inputmethod/OWNERS b/services/core/java/com/android/server/inputmethod/OWNERS
index 6e5eb56..aa638aa 100644
--- a/services/core/java/com/android/server/inputmethod/OWNERS
+++ b/services/core/java/com/android/server/inputmethod/OWNERS
@@ -3,6 +3,8 @@
roosa@google.com
yukawa@google.com
tarandeep@google.com
+fstern@google.com
+cosminbaies@google.com
ogunwale@google.com #{LAST_RESORT_SUGGESTION}
jjaggi@google.com #{LAST_RESORT_SUGGESTION}
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java
index ec7f561..b4c3997 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsService.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java
@@ -246,7 +246,7 @@
private static final String MIGRATED_SP_FULL = "migrated_all_users_to_sp_and_bound_keys";
private static final boolean FIX_UNLOCKED_DEVICE_REQUIRED_KEYS =
- android.security.Flags.fixUnlockedDeviceRequiredKeys();
+ android.security.Flags.fixUnlockedDeviceRequiredKeysV2();
// Duration that LockSettingsService will store the gatekeeper password for. This allows
// multiple biometric enrollments without prompting the user to enter their password via
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java b/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
index 4bac872..17f2fcc 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsShellCommand.java
@@ -155,43 +155,45 @@
try (final PrintWriter pw = getOutPrintWriter();) {
pw.println("lockSettings service commands:");
pw.println("");
- pw.println("NOTE: when lock screen is set, all commands require the --old <CREDENTIAL>"
- + " argument.");
+ pw.println("NOTE: when a secure lock screen is set, most commands require the");
+ pw.println("--old <CREDENTIAL> option.");
pw.println("");
pw.println(" help");
pw.println(" Prints this help text.");
pw.println("");
- pw.println(" get-disabled [--old <CREDENTIAL>] [--user USER_ID]");
- pw.println(" Checks whether lock screen is disabled.");
+ pw.println(" get-disabled [--user USER_ID]");
+ pw.println(" Prints true if the lock screen is completely disabled, i.e. set to None.");
+ pw.println(" Otherwise prints false.");
pw.println("");
- pw.println(" set-disabled [--old <CREDENTIAL>] [--user USER_ID] <true|false>");
- pw.println(" When true, disables lock screen.");
+ pw.println(" set-disabled [--user USER_ID] <true|false>");
+ pw.println(" Sets whether the lock screen is disabled. If the lock screen is secure, this");
+ pw.println(" has no immediate effect. I.e. this can only change between Swipe and None.");
pw.println("");
pw.println(" set-pattern [--old <CREDENTIAL>] [--user USER_ID] <PATTERN>");
- pw.println(" Sets the lock screen as pattern, using the given PATTERN to unlock.");
+ pw.println(" Sets a secure lock screen that uses the given PATTERN. PATTERN is a series");
+ pw.println(" of digits 1-9 that identify the cells of the pattern.");
pw.println("");
pw.println(" set-pin [--old <CREDENTIAL>] [--user USER_ID] <PIN>");
- pw.println(" Sets the lock screen as PIN, using the given PIN to unlock.");
+ pw.println(" Sets a secure lock screen that uses the given PIN.");
pw.println("");
pw.println(" set-password [--old <CREDENTIAL>] [--user USER_ID] <PASSWORD>");
- pw.println(" Sets the lock screen as password, using the given PASSWORD to unlock.");
+ pw.println(" Sets a secure lock screen that uses the given PASSWORD.");
pw.println("");
pw.println(" clear [--old <CREDENTIAL>] [--user USER_ID]");
- pw.println(" Clears the lock credentials.");
+ pw.println(" Clears the lock credential.");
pw.println("");
pw.println(" verify [--old <CREDENTIAL>] [--user USER_ID]");
- pw.println(" Verifies the lock credentials.");
+ pw.println(" Verifies the lock credential.");
pw.println("");
pw.println(" remove-cache [--user USER_ID]");
pw.println(" Removes cached unified challenge for the managed profile.");
pw.println("");
pw.println(" set-resume-on-reboot-provider-package <package_name>");
- pw.println(" Sets the package name for server based resume on reboot service "
- + "provider.");
+ pw.println(" Sets the package name for server based resume on reboot service provider.");
pw.println("");
pw.println(" require-strong-auth [--user USER_ID] <reason>");
- pw.println(" Requires the strong authentication. The current supported reasons: "
- + "STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN.");
+ pw.println(" Requires strong authentication. The current supported reasons:");
+ pw.println(" STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN.");
pw.println("");
}
}
diff --git a/services/core/java/com/android/server/os/NativeTombstoneManager.java b/services/core/java/com/android/server/os/NativeTombstoneManager.java
index e5616d0..ab0d0d2 100644
--- a/services/core/java/com/android/server/os/NativeTombstoneManager.java
+++ b/services/core/java/com/android/server/os/NativeTombstoneManager.java
@@ -61,6 +61,7 @@
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
+import java.util.concurrent.locks.ReentrantLock;
/**
* A class to manage native tombstones.
@@ -74,6 +75,8 @@
private final Handler mHandler;
private final TombstoneWatcher mWatcher;
+ private final ReentrantLock mTmpFileLock = new ReentrantLock();
+
private final Object mLock = new Object();
@GuardedBy("mLock")
@@ -112,7 +115,12 @@
// Clean up temporary files if they made it this far (e.g. if system server crashes).
if (filename.endsWith(".tmp")) {
- path.delete();
+ mTmpFileLock.lock();
+ try {
+ path.delete();
+ } finally {
+ mTmpFileLock.unlock();
+ }
return;
}
@@ -128,7 +136,7 @@
if (parsedTombstone.isPresent()) {
processName = parsedTombstone.get().getProcessName();
}
- BootReceiver.addTombstoneToDropBox(mContext, path, isProtoFile, processName);
+ BootReceiver.addTombstoneToDropBox(mContext, path, isProtoFile, processName, mTmpFileLock);
}
private Optional<TombstoneFile> handleProtoTombstone(File path, boolean addToList) {
diff --git a/services/core/java/com/android/server/pm/DumpHelper.java b/services/core/java/com/android/server/pm/DumpHelper.java
index fcaaa90..c33af9b 100644
--- a/services/core/java/com/android/server/pm/DumpHelper.java
+++ b/services/core/java/com/android/server/pm/DumpHelper.java
@@ -160,7 +160,7 @@
pkg = snapshot.resolveInternalPackageName(pkg,
PackageManager.VERSION_CODE_HIGHEST);
- pw.println(mPermissionManager.checkPermission(perm, pkg, user));
+ pw.println(mPermissionManager.checkPermission(pkg, perm, user));
return;
} else if ("l".equals(cmd) || "libraries".equals(cmd)) {
dumpState.setDump(DumpState.DUMP_LIBS);
diff --git a/services/core/java/com/android/server/pm/UserDataPreparer.java b/services/core/java/com/android/server/pm/UserDataPreparer.java
index 6d58d34..8adb566 100644
--- a/services/core/java/com/android/server/pm/UserDataPreparer.java
+++ b/services/core/java/com/android/server/pm/UserDataPreparer.java
@@ -23,10 +23,10 @@
import android.os.Environment;
import android.os.FileUtils;
import android.os.RecoverySystem;
-import android.os.storage.StorageManager;
-import android.os.storage.VolumeInfo;
import android.os.SystemProperties;
import android.os.UserHandle;
+import android.os.storage.StorageManager;
+import android.os.storage.VolumeInfo;
import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
@@ -35,6 +35,7 @@
import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.utils.Slogf;
import java.io.File;
import java.io.IOException;
@@ -43,7 +44,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Objects;
-import java.util.Set;
/**
* Helper class for preparing and destroying user storage
@@ -65,31 +65,37 @@
/**
* Prepare storage areas for given user on all mounted devices.
*/
- void prepareUserData(int userId, int userSerial, int flags) {
+ void prepareUserData(UserInfo userInfo, int flags) {
synchronized (mInstallLock) {
final StorageManager storage = mContext.getSystemService(StorageManager.class);
/*
* Internal storage must be prepared before adoptable storage, since the user's volume
* keys are stored in their internal storage.
*/
- prepareUserDataLI(null /* internal storage */, userId, userSerial, flags, true);
+ prepareUserDataLI(null /* internal storage */, userInfo, flags, true);
for (VolumeInfo vol : storage.getWritablePrivateVolumes()) {
final String volumeUuid = vol.getFsUuid();
if (volumeUuid != null) {
- prepareUserDataLI(volumeUuid, userId, userSerial, flags, true);
+ prepareUserDataLI(volumeUuid, userInfo, flags, true);
}
}
}
}
- private void prepareUserDataLI(String volumeUuid, int userId, int userSerial, int flags,
+ private void prepareUserDataLI(String volumeUuid, UserInfo userInfo, int flags,
boolean allowRecover) {
- // Prepare storage and verify that serial numbers are consistent; if
- // there's a mismatch we need to destroy to avoid leaking data
+ final int userId = userInfo.id;
+ final int userSerial = userInfo.serialNumber;
final StorageManager storage = mContext.getSystemService(StorageManager.class);
+ final boolean isNewUser = userInfo.lastLoggedInTime == 0;
+ Slogf.d(TAG, "Preparing user data; volumeUuid=%s, userId=%d, flags=0x%x, isNewUser=%s",
+ volumeUuid, userId, flags, isNewUser);
try {
+ // Prepare CE and/or DE storage.
storage.prepareUserStorage(volumeUuid, userId, userSerial, flags);
+ // Ensure that the data directories of a removed user with the same ID are not being
+ // reused. New users must get fresh data directories, to avoid leaking data.
if ((flags & StorageManager.FLAG_STORAGE_DE) != 0) {
enforceSerialNumber(getDataUserDeDirectory(volumeUuid, userId), userSerial);
if (Objects.equals(volumeUuid, StorageManager.UUID_PRIVATE_INTERNAL)) {
@@ -103,9 +109,10 @@
}
}
+ // Prepare the app data directories.
mInstaller.createUserData(volumeUuid, userId, userSerial, flags);
- // CE storage is available after they are prepared.
+ // If applicable, record that the system user's CE storage has been prepared.
if ((flags & StorageManager.FLAG_STORAGE_CE) != 0 &&
(userId == UserHandle.USER_SYSTEM)) {
String propertyName = "sys.user." + userId + ".ce_available";
@@ -113,20 +120,31 @@
SystemProperties.set(propertyName, "true");
}
} catch (Exception e) {
- logCriticalInfo(Log.WARN, "Destroying user " + userId + " on volume " + volumeUuid
- + " because we failed to prepare: " + e);
- destroyUserDataLI(volumeUuid, userId, flags);
-
+ // Failed to prepare user data. For new users, specifically users that haven't ever
+ // been unlocked, destroy the user data, and try again (if not already retried). This
+ // might be effective at resolving some errors, such as stale directories from a reused
+ // user ID. Don't auto-destroy data for existing users, since issues with existing
+ // users might be fixable via an OTA without having to wipe the user's data.
+ if (isNewUser) {
+ logCriticalInfo(Log.ERROR, "Destroying user " + userId + " on volume " + volumeUuid
+ + " because we failed to prepare: " + e);
+ destroyUserDataLI(volumeUuid, userId, flags);
+ } else {
+ logCriticalInfo(Log.ERROR, "Failed to prepare user " + userId + " on volume "
+ + volumeUuid + ": " + e);
+ }
if (allowRecover) {
// Try one last time; if we fail again we're really in trouble
- prepareUserDataLI(volumeUuid, userId, userSerial,
- flags | StorageManager.FLAG_STORAGE_DE, false);
+ prepareUserDataLI(volumeUuid, userInfo, flags | StorageManager.FLAG_STORAGE_DE,
+ false);
} else {
+ // If internal storage of the system user fails to prepare on first boot, then
+ // things are *really* broken, so we might as well reboot to recovery right away.
try {
Log.wtf(TAG, "prepareUserData failed for user " + userId, e);
- if (userId == UserHandle.USER_SYSTEM) {
+ if (isNewUser && userId == UserHandle.USER_SYSTEM && volumeUuid == null) {
RecoverySystem.rebootPromptAndWipeUserData(mContext,
- "prepareUserData failed for system user");
+ "failed to prepare internal storage for system user");
}
} catch (IOException e2) {
throw new RuntimeException("error rebooting into recovery", e2);
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index e11e226..6814848 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -4914,8 +4914,7 @@
// unlocked. We do this to ensure that CE storage isn't prepared before the CE key is
// saved to disk. This also matches what is done for user 0.
t.traceBegin("prepareUserData");
- mUserDataPreparer.prepareUserData(userId, userInfo.serialNumber,
- StorageManager.FLAG_STORAGE_DE);
+ mUserDataPreparer.prepareUserData(userInfo, StorageManager.FLAG_STORAGE_DE);
t.traceEnd();
t.traceBegin("LSS.createNewUser");
@@ -6199,12 +6198,11 @@
}
TimingsTraceAndSlog t = new TimingsTraceAndSlog();
t.traceBegin("onBeforeStartUser-" + userId);
- final int userSerial = userInfo.serialNumber;
// Migrate only if build fingerprints mismatch
boolean migrateAppsData = !PackagePartitions.FINGERPRINT.equals(
userInfo.lastLoggedInFingerprint);
t.traceBegin("prepareUserData");
- mUserDataPreparer.prepareUserData(userId, userSerial, StorageManager.FLAG_STORAGE_DE);
+ mUserDataPreparer.prepareUserData(userInfo, StorageManager.FLAG_STORAGE_DE);
t.traceEnd();
t.traceBegin("reconcileAppsData");
getPackageManagerInternal().reconcileAppsData(userId, StorageManager.FLAG_STORAGE_DE,
@@ -6230,14 +6228,13 @@
if (userInfo == null) {
return;
}
- final int userSerial = userInfo.serialNumber;
// Migrate only if build fingerprints mismatch
boolean migrateAppsData = !PackagePartitions.FINGERPRINT.equals(
userInfo.lastLoggedInFingerprint);
final TimingsTraceAndSlog t = new TimingsTraceAndSlog();
t.traceBegin("prepareUserData-" + userId);
- mUserDataPreparer.prepareUserData(userId, userSerial, StorageManager.FLAG_STORAGE_CE);
+ mUserDataPreparer.prepareUserData(userInfo, StorageManager.FLAG_STORAGE_CE);
t.traceEnd();
StorageManagerInternal smInternal = LocalServices.getService(StorageManagerInternal.class);
diff --git a/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java b/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java
index d0c346a..57f4a5d 100644
--- a/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java
+++ b/services/core/java/com/android/server/pm/dex/ArtStatsLogUtils.java
@@ -337,7 +337,8 @@
0, // deprecated, used to be durationIncludingSleepMs
0, // optimizedPackagesCount
0, // packagesDependingOnBootClasspathCount
- 0); // totalPackagesCount
+ 0, // totalPackagesCount
+ ArtStatsLog.BACKGROUND_DEXOPT_JOB_ENDED__PASS__PASS_UNKNOWN);
}
}
}
diff --git a/services/core/java/com/android/server/power/TEST_MAPPING b/services/core/java/com/android/server/power/TEST_MAPPING
index cf1bfc3..fbfe291 100644
--- a/services/core/java/com/android/server/power/TEST_MAPPING
+++ b/services/core/java/com/android/server/power/TEST_MAPPING
@@ -20,6 +20,7 @@
"name": "FrameworksServicesTests",
"options": [
{"include-filter": "com.android.server.power"},
+ {"exclude-filter": "com.android.server.power.BatteryStatsTests"},
{"exclude-annotation": "android.platform.test.annotations.FlakyTest"},
{"exclude-annotation": "androidx.test.filters.FlakyTest"}
]
@@ -38,7 +39,8 @@
{
"name": "FrameworksServicesTests",
"options": [
- {"include-filter": "com.android.server.power"}
+ {"include-filter": "com.android.server.power"},
+ {"exclude-filter": "com.android.server.power.BatteryStatsTests"}
]
}
]
diff --git a/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java b/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
index 27329e2..5dff9ef 100644
--- a/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
+++ b/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
@@ -8203,18 +8203,18 @@
@GuardedBy("mBsi")
private void ensureMultiStateCounters(long timestampMs) {
- if (mProcStateTimeMs != null) {
- return;
+ if (mProcStateTimeMs == null) {
+ mProcStateTimeMs =
+ new TimeInFreqMultiStateCounter(mBsi.mOnBatteryTimeBase,
+ PROC_STATE_TIME_COUNTER_STATE_COUNT, mBsi.getCpuFreqCount(),
+ timestampMs);
}
-
- mProcStateTimeMs =
- new TimeInFreqMultiStateCounter(mBsi.mOnBatteryTimeBase,
- PROC_STATE_TIME_COUNTER_STATE_COUNT, mBsi.getCpuFreqCount(),
- timestampMs);
- mProcStateScreenOffTimeMs =
- new TimeInFreqMultiStateCounter(mBsi.mOnBatteryScreenOffTimeBase,
- PROC_STATE_TIME_COUNTER_STATE_COUNT, mBsi.getCpuFreqCount(),
- timestampMs);
+ if (mProcStateScreenOffTimeMs == null) {
+ mProcStateScreenOffTimeMs =
+ new TimeInFreqMultiStateCounter(mBsi.mOnBatteryScreenOffTimeBase,
+ PROC_STATE_TIME_COUNTER_STATE_COUNT, mBsi.getCpuFreqCount(),
+ timestampMs);
+ }
}
@GuardedBy("mBsi")
diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java
index 635e11b..24c971c 100644
--- a/services/core/java/com/android/server/trust/TrustManagerService.java
+++ b/services/core/java/com/android/server/trust/TrustManagerService.java
@@ -829,7 +829,7 @@
}
final boolean trusted;
- if (android.security.Flags.fixUnlockedDeviceRequiredKeys()) {
+ if (android.security.Flags.fixUnlockedDeviceRequiredKeysV2()) {
trusted = getUserTrustStateInner(id) == TrustState.TRUSTED;
} else {
trusted = aggregateIsTrusted(id);
@@ -1647,8 +1647,22 @@
fout.printf(" User \"%s\" (id=%d, flags=%#x)",
user.name, user.id, user.flags);
if (!user.supportsSwitchToByUser()) {
- fout.println("(managed profile)");
- fout.println(" disabled because switching to this user is not possible.");
+ final boolean locked;
+ if (user.isProfile()) {
+ if (mLockPatternUtils.isSeparateProfileChallengeEnabled(user.id)) {
+ fout.print(" (profile with separate challenge)");
+ locked = isDeviceLockedInner(user.id);
+ } else {
+ fout.print(" (profile with unified challenge)");
+ locked = isDeviceLockedInner(resolveProfileParent(user.id));
+ }
+ } else {
+ fout.println(" (user that cannot be switched to)");
+ locked = isDeviceLockedInner(user.id);
+ }
+ fout.println(": deviceLocked=" + dumpBool(locked));
+ fout.println(
+ " Trust agents disabled because switching to this user is not possible.");
return;
}
if (isCurrent) {
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 6d560e4..f2346e6 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -6135,6 +6135,7 @@
// Avoid resuming activities on secondary displays since we don't want bubble
// activities to be resumed while bubble is still collapsed.
// TODO(b/113840485): Having keyguard going away state for secondary displays.
+ && display != null
&& display.isDefaultDisplay) {
return false;
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 06978a5..0a5b9eb 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -3276,7 +3276,9 @@
// just kill it. And if it is a window of foreground activity, the activity can be
// restarted automatically if needed.
Slog.w(TAG, "Exception thrown during dispatchAppVisibility " + this, e);
- android.os.Process.killProcess(mSession.mPid);
+ if (android.os.Process.getUidForPid(mSession.mPid) == mSession.mUid) {
+ android.os.Process.killProcess(mSession.mPid);
+ }
}
}
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index 81a5472..a8e6f68 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -910,7 +910,7 @@
constants().readLogsDisabledMarkerName),
0777, idFromMetadata(metadata), {})) {
//{.metadata = {metadata.data(), (IncFsSize)metadata.size()}})) {
- LOG(ERROR) << "Failed to make marker file for storageId: " << storageId;
+ LOG(ERROR) << "Failed to make marker file for storageId: " << storageId << " err: " << -err;
return;
}
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 3610542..f1f5d83 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -1451,8 +1451,6 @@
boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice",
false);
- boolean isEmulator = SystemProperties.get("ro.boot.qemu").equals("1");
-
boolean isWatch = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_WATCH);
@@ -2261,7 +2259,7 @@
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_USB_HOST)
|| mPackageManager.hasSystemFeature(
PackageManager.FEATURE_USB_ACCESSORY)
- || isEmulator) {
+ || Build.IS_EMULATOR) {
// Manage USB host and device support
t.traceBegin("StartUsbService");
mSystemServiceManager.startService(USB_SERVICE_CLASS);
diff --git a/services/proguard.flags b/services/proguard.flags
index 84f2a52..88561b4 100644
--- a/services/proguard.flags
+++ b/services/proguard.flags
@@ -50,6 +50,11 @@
-keep,allowoptimization,allowaccessmodification class com.android.net.module.util.* { *; }
-keep,allowoptimization,allowaccessmodification public class com.android.server.net.IpConfigStore { *; }
-keep,allowoptimization,allowaccessmodification public class com.android.server.net.BaseNetworkObserver { *; }
+-keep,allowoptimization,allowaccessmodification class com.android.server.display.feature.DisplayManagerFlags { *; }
+-keep,allowoptimization,allowaccessmodification class android.app.admin.flags.FeatureFlagsImpl { *; }
+-keep,allowoptimization,allowaccessmodification class com.android.server.input.NativeInputManagerService$NativeImpl { *; }
+-keep,allowoptimization,allowaccessmodification class com.android.server.ThreadPriorityBooster { *; }
+-keep,allowaccessmodification class android.app.admin.flags.Flags { *; }
# Referenced via CarServiceHelperService in car-frameworks-service (avoid removing)
-keep public class com.android.server.utils.Slogf { *; }
@@ -102,9 +107,6 @@
-keep,allowoptimization,allowaccessmodification class com.android.server.input.InputManagerService {
<methods>;
}
--keep,allowoptimization,allowaccessmodification class com.android.server.input.NativeInputManagerService$NativeImpl {
- <methods>;
-}
-keep,allowoptimization,allowaccessmodification class com.android.server.usb.UsbHostManager {
*** usbDeviceRemoved(...);
*** usbDeviceAdded(...);
diff --git a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/UserDataPreparerTest.java b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/UserDataPreparerTest.java
index afbe352..e5be4d9 100644
--- a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/UserDataPreparerTest.java
+++ b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/UserDataPreparerTest.java
@@ -21,6 +21,8 @@
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.eq;
import static org.mockito.Matchers.isNull;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -56,6 +58,7 @@
private static final int TEST_USER_SERIAL = 1000;
private static final int TEST_USER_ID = 10;
+ private static final UserInfo TEST_USER = new UserInfo();
private TestUserDataPreparer mUserDataPreparer;
@@ -72,6 +75,8 @@
@Before
public void setup() {
+ TEST_USER.id = TEST_USER_ID;
+ TEST_USER.serialNumber = TEST_USER_SERIAL;
Context ctx = InstrumentationRegistry.getContext();
FileUtils.deleteContents(ctx.getCacheDir());
mInstallLock = new Object();
@@ -92,8 +97,7 @@
userDeDir.mkdirs();
File systemDeDir = mUserDataPreparer.getDataSystemDeDirectory(TEST_USER_ID);
systemDeDir.mkdirs();
- mUserDataPreparer
- .prepareUserData(TEST_USER_ID, TEST_USER_SERIAL, StorageManager.FLAG_STORAGE_DE);
+ mUserDataPreparer.prepareUserData(TEST_USER, StorageManager.FLAG_STORAGE_DE);
verify(mStorageManagerMock).prepareUserStorage(isNull(String.class), eq(TEST_USER_ID),
eq(TEST_USER_SERIAL), eq(StorageManager.FLAG_STORAGE_DE));
verify(mInstaller).createUserData(isNull(String.class), eq(TEST_USER_ID),
@@ -110,8 +114,7 @@
userCeDir.mkdirs();
File systemCeDir = mUserDataPreparer.getDataSystemCeDirectory(TEST_USER_ID);
systemCeDir.mkdirs();
- mUserDataPreparer
- .prepareUserData(TEST_USER_ID, TEST_USER_SERIAL, StorageManager.FLAG_STORAGE_CE);
+ mUserDataPreparer.prepareUserData(TEST_USER, StorageManager.FLAG_STORAGE_CE);
verify(mStorageManagerMock).prepareUserStorage(isNull(String.class), eq(TEST_USER_ID),
eq(TEST_USER_SERIAL), eq(StorageManager.FLAG_STORAGE_CE));
verify(mInstaller).createUserData(isNull(String.class), eq(TEST_USER_ID),
@@ -123,6 +126,28 @@
}
@Test
+ public void testPrepareUserData_forNewUser_destroysOnFailure() throws Exception {
+ TEST_USER.lastLoggedInTime = 0;
+ doThrow(new IllegalStateException("expected exception for test")).when(mStorageManagerMock)
+ .prepareUserStorage(isNull(String.class), eq(TEST_USER_ID), eq(TEST_USER_SERIAL),
+ eq(StorageManager.FLAG_STORAGE_CE));
+ mUserDataPreparer.prepareUserData(TEST_USER, StorageManager.FLAG_STORAGE_CE);
+ verify(mStorageManagerMock).destroyUserStorage(isNull(String.class), eq(TEST_USER_ID),
+ eq(StorageManager.FLAG_STORAGE_CE));
+ }
+
+ @Test
+ public void testPrepareUserData_forExistingUser_doesNotDestroyOnFailure() throws Exception {
+ TEST_USER.lastLoggedInTime = System.currentTimeMillis();
+ doThrow(new IllegalStateException("expected exception for test")).when(mStorageManagerMock)
+ .prepareUserStorage(isNull(String.class), eq(TEST_USER_ID), eq(TEST_USER_SERIAL),
+ eq(StorageManager.FLAG_STORAGE_CE));
+ mUserDataPreparer.prepareUserData(TEST_USER, StorageManager.FLAG_STORAGE_CE);
+ verify(mStorageManagerMock, never()).destroyUserStorage(isNull(String.class),
+ eq(TEST_USER_ID), eq(StorageManager.FLAG_STORAGE_CE));
+ }
+
+ @Test
public void testDestroyUserData_De_DoesNotDestroyCe() throws Exception {
// Add file in CE storage
File systemCeDir = mUserDataPreparer.getDataSystemCeDirectory(TEST_USER_ID);
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java b/services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java
new file mode 100644
index 0000000..a0beb17
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/am/BaseBroadcastQueueTest.java
@@ -0,0 +1,259 @@
+/*
+ * 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.
+ */
+
+package com.android.server.am;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+
+import android.annotation.NonNull;
+import android.app.usage.UsageStatsManagerInternal;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.IntentFilter;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManagerInternal;
+import android.content.pm.ResolveInfo;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.TestLooperManager;
+import android.os.UserHandle;
+import android.provider.Settings;
+import android.util.SparseArray;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.server.AlarmManagerInternal;
+import com.android.server.DropBoxManagerInternal;
+import com.android.server.LocalServices;
+import com.android.server.appop.AppOpsService;
+import com.android.server.wm.ActivityTaskManagerService;
+
+import org.junit.Rule;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.io.File;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public abstract class BaseBroadcastQueueTest {
+
+ static final int USER_GUEST = 11;
+
+ static final String PACKAGE_ANDROID = "android";
+ static final String PACKAGE_PHONE = "com.android.phone";
+ static final String PACKAGE_RED = "com.example.red";
+ static final String PACKAGE_GREEN = "com.example.green";
+ static final String PACKAGE_BLUE = "com.example.blue";
+ static final String PACKAGE_YELLOW = "com.example.yellow";
+ static final String PACKAGE_ORANGE = "com.example.orange";
+
+ static final String PROCESS_SYSTEM = "system";
+
+ static final String CLASS_RED = "com.example.red.Red";
+ static final String CLASS_GREEN = "com.example.green.Green";
+ static final String CLASS_BLUE = "com.example.blue.Blue";
+ static final String CLASS_YELLOW = "com.example.yellow.Yellow";
+ static final String CLASS_ORANGE = "com.example.orange.Orange";
+
+ static final BroadcastProcessQueue.BroadcastPredicate BROADCAST_PREDICATE_ANY =
+ (r, i) -> true;
+
+ @Rule
+ public final ApplicationExitInfoTest.ServiceThreadRule
+ mServiceThreadRule = new ApplicationExitInfoTest.ServiceThreadRule();
+
+ @Mock
+ AppOpsService mAppOpsService;
+ @Mock
+ PackageManagerInternal mPackageManagerInt;
+ @Mock
+ UsageStatsManagerInternal mUsageStatsManagerInt;
+ @Mock
+ DropBoxManagerInternal mDropBoxManagerInt;
+ @Mock
+ AlarmManagerInternal mAlarmManagerInt;
+ @Mock
+ ProcessList mProcessList;
+
+ Context mContext;
+ ActivityManagerService mAms;
+ BroadcastConstants mConstants;
+ BroadcastSkipPolicy mSkipPolicy;
+ HandlerThread mHandlerThread;
+ TestLooperManager mLooper;
+ AtomicInteger mNextPid;
+
+ /**
+ * Map from PID to registered registered runtime receivers.
+ */
+ SparseArray<ReceiverList> mRegisteredReceivers = new SparseArray<>();
+
+ public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
+
+ mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ mHandlerThread = new HandlerThread(getTag());
+ mHandlerThread.start();
+ // Pause all event processing until a test chooses to resume
+ mLooper = Objects.requireNonNull(InstrumentationRegistry.getInstrumentation()
+ .acquireLooperManager(mHandlerThread.getLooper()));
+ mNextPid = new AtomicInteger(100);
+
+ LocalServices.removeServiceForTest(DropBoxManagerInternal.class);
+ LocalServices.addService(DropBoxManagerInternal.class, mDropBoxManagerInt);
+ LocalServices.removeServiceForTest(PackageManagerInternal.class);
+ LocalServices.addService(PackageManagerInternal.class, mPackageManagerInt);
+ LocalServices.removeServiceForTest(AlarmManagerInternal.class);
+ LocalServices.addService(AlarmManagerInternal.class, mAlarmManagerInt);
+ doReturn(new ComponentName("", "")).when(mPackageManagerInt).getSystemUiServiceComponent();
+ doNothing().when(mPackageManagerInt).setPackageStoppedState(any(), anyBoolean(), anyInt());
+ doAnswer((invocation) -> {
+ return getUidForPackage(invocation.getArgument(0));
+ }).when(mPackageManagerInt).getPackageUid(any(), anyLong(), eq(UserHandle.USER_SYSTEM));
+
+ final ActivityManagerService realAms = new ActivityManagerService(
+ new TestInjector(mContext), mServiceThreadRule.getThread());
+ realAms.mActivityTaskManager = new ActivityTaskManagerService(mContext);
+ realAms.mActivityTaskManager.initialize(null, null, mContext.getMainLooper());
+ realAms.mAtmInternal = spy(realAms.mActivityTaskManager.getAtmInternal());
+ realAms.mOomAdjuster = spy(realAms.mOomAdjuster);
+ realAms.mPackageManagerInt = mPackageManagerInt;
+ realAms.mUsageStatsService = mUsageStatsManagerInt;
+ realAms.mProcessesReady = true;
+ mAms = spy(realAms);
+
+ mSkipPolicy = spy(new BroadcastSkipPolicy(mAms));
+ doReturn(null).when(mSkipPolicy).shouldSkipMessage(any(), any());
+ doReturn(false).when(mSkipPolicy).disallowBackgroundStart(any());
+
+ mConstants = new BroadcastConstants(Settings.Global.BROADCAST_FG_CONSTANTS);
+ }
+
+ public void tearDown() throws Exception {
+ mHandlerThread.quit();
+ }
+
+ static int getUidForPackage(@NonNull String packageName) {
+ switch (packageName) {
+ case PACKAGE_ANDROID: return android.os.Process.SYSTEM_UID;
+ case PACKAGE_PHONE: return android.os.Process.PHONE_UID;
+ case PACKAGE_RED: return android.os.Process.FIRST_APPLICATION_UID + 1;
+ case PACKAGE_GREEN: return android.os.Process.FIRST_APPLICATION_UID + 2;
+ case PACKAGE_BLUE: return android.os.Process.FIRST_APPLICATION_UID + 3;
+ case PACKAGE_YELLOW: return android.os.Process.FIRST_APPLICATION_UID + 4;
+ case PACKAGE_ORANGE: return android.os.Process.FIRST_APPLICATION_UID + 5;
+ default: throw new IllegalArgumentException();
+ }
+ }
+
+ static int getUidForPackage(@NonNull String packageName, int userId) {
+ return UserHandle.getUid(userId, getUidForPackage(packageName));
+ }
+
+ private class TestInjector extends ActivityManagerService.Injector {
+ TestInjector(Context context) {
+ super(context);
+ }
+
+ @Override
+ public AppOpsService getAppOpsService(File recentAccessesFile, File storageFile,
+ Handler handler) {
+ return mAppOpsService;
+ }
+
+ @Override
+ public Handler getUiHandler(ActivityManagerService service) {
+ return mHandlerThread.getThreadHandler();
+ }
+
+ @Override
+ public ProcessList getProcessList(ActivityManagerService service) {
+ return mProcessList;
+ }
+ }
+
+ abstract String getTag();
+
+ static ApplicationInfo makeApplicationInfo(String packageName) {
+ return makeApplicationInfo(packageName, packageName, UserHandle.USER_SYSTEM);
+ }
+
+ static ApplicationInfo makeApplicationInfo(String packageName, String processName, int userId) {
+ final ApplicationInfo ai = new ApplicationInfo();
+ ai.packageName = packageName;
+ ai.processName = processName;
+ ai.uid = getUidForPackage(packageName, userId);
+ return ai;
+ }
+
+ static ResolveInfo withPriority(ResolveInfo info, int priority) {
+ info.priority = priority;
+ return info;
+ }
+
+ static BroadcastFilter withPriority(BroadcastFilter filter, int priority) {
+ filter.setPriority(priority);
+ return filter;
+ }
+
+ static ResolveInfo makeManifestReceiver(String packageName, String name) {
+ return makeManifestReceiver(packageName, name, UserHandle.USER_SYSTEM);
+ }
+
+ static ResolveInfo makeManifestReceiver(String packageName, String name, int userId) {
+ return makeManifestReceiver(packageName, packageName, name, userId);
+ }
+
+ static ResolveInfo makeManifestReceiver(String packageName, String processName,
+ String name, int userId) {
+ final ResolveInfo ri = new ResolveInfo();
+ ri.activityInfo = new ActivityInfo();
+ ri.activityInfo.packageName = packageName;
+ ri.activityInfo.processName = processName;
+ ri.activityInfo.name = name;
+ ri.activityInfo.applicationInfo = makeApplicationInfo(packageName, processName, userId);
+ return ri;
+ }
+
+ BroadcastFilter makeRegisteredReceiver(ProcessRecord app) {
+ return makeRegisteredReceiver(app, 0);
+ }
+
+ BroadcastFilter makeRegisteredReceiver(ProcessRecord app, int priority) {
+ final ReceiverList receiverList = mRegisteredReceivers.get(app.getPid());
+ return makeRegisteredReceiver(receiverList, priority);
+ }
+
+ static BroadcastFilter makeRegisteredReceiver(ReceiverList receiverList, int priority) {
+ final IntentFilter filter = new IntentFilter();
+ filter.setPriority(priority);
+ final BroadcastFilter res = new BroadcastFilter(filter, receiverList,
+ receiverList.app.info.packageName, null, null, null, receiverList.uid,
+ receiverList.userId, false, false, true);
+ receiverList.add(res);
+ return res;
+ }
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java b/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java
index ff04728..2378416 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java
@@ -31,17 +31,6 @@
import static com.android.server.am.BroadcastProcessQueue.REASON_CONTAINS_PRIORITIZED;
import static com.android.server.am.BroadcastProcessQueue.insertIntoRunnableList;
import static com.android.server.am.BroadcastProcessQueue.removeFromRunnableList;
-import static com.android.server.am.BroadcastQueueTest.CLASS_BLUE;
-import static com.android.server.am.BroadcastQueueTest.CLASS_GREEN;
-import static com.android.server.am.BroadcastQueueTest.CLASS_RED;
-import static com.android.server.am.BroadcastQueueTest.CLASS_YELLOW;
-import static com.android.server.am.BroadcastQueueTest.PACKAGE_BLUE;
-import static com.android.server.am.BroadcastQueueTest.PACKAGE_GREEN;
-import static com.android.server.am.BroadcastQueueTest.PACKAGE_RED;
-import static com.android.server.am.BroadcastQueueTest.PACKAGE_YELLOW;
-import static com.android.server.am.BroadcastQueueTest.getUidForPackage;
-import static com.android.server.am.BroadcastQueueTest.makeManifestReceiver;
-import static com.android.server.am.BroadcastQueueTest.withPriority;
import static com.android.server.am.BroadcastRecord.isReceiverEquals;
import static com.google.common.truth.Truth.assertThat;
@@ -74,17 +63,15 @@
import android.content.IIntentReceiver;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.pm.ApplicationInfo;
import android.content.pm.ResolveInfo;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.BundleMerger;
import android.os.DropBoxManager;
-import android.os.HandlerThread;
import android.os.Process;
import android.os.SystemClock;
-import android.os.TestLooperManager;
import android.os.UserHandle;
-import android.provider.Settings;
import android.util.IndentingPrintWriter;
import android.util.Pair;
@@ -108,11 +95,12 @@
import java.util.Objects;
@SmallTest
-public final class BroadcastQueueModernImplTest {
+public final class BroadcastQueueModernImplTest extends BaseBroadcastQueueTest {
+ private static final String TAG = "BroadcastQueueModernImplTest";
+
private static final int TEST_UID = android.os.Process.FIRST_APPLICATION_UID;
private static final int TEST_UID2 = android.os.Process.FIRST_APPLICATION_UID + 1;
- @Mock ActivityManagerService mAms;
@Mock ProcessRecord mProcess;
@Mock BroadcastProcessQueue mQueue1;
@@ -120,11 +108,6 @@
@Mock BroadcastProcessQueue mQueue3;
@Mock BroadcastProcessQueue mQueue4;
- HandlerThread mHandlerThread;
- TestLooperManager mLooper;
-
- BroadcastConstants mConstants;
- private BroadcastSkipPolicy mSkipPolicy;
BroadcastQueueModernImpl mImpl;
BroadcastProcessQueue mHead;
@@ -136,22 +119,12 @@
@Before
public void setUp() throws Exception {
- mHandlerThread = new HandlerThread(getClass().getSimpleName());
- mHandlerThread.start();
+ super.setUp();
- // Pause all event processing until a test chooses to resume
- mLooper = Objects.requireNonNull(InstrumentationRegistry.getInstrumentation()
- .acquireLooperManager(mHandlerThread.getLooper()));
-
- mConstants = new BroadcastConstants(Settings.Global.BROADCAST_FG_CONSTANTS);
mConstants.DELAY_URGENT_MILLIS = -120_000;
mConstants.DELAY_NORMAL_MILLIS = 10_000;
mConstants.DELAY_CACHED_MILLIS = 120_000;
- mSkipPolicy = spy(new BroadcastSkipPolicy(mAms));
- doReturn(null).when(mSkipPolicy).shouldSkipMessage(any(), any());
- doReturn(false).when(mSkipPolicy).disallowBackgroundStart(any());
-
final BroadcastHistory emptyHistory = new BroadcastHistory(mConstants) {
public void addBroadcastToHistoryLocked(BroadcastRecord original) {
// Ignored
@@ -169,7 +142,12 @@
@After
public void tearDown() throws Exception {
- mHandlerThread.quit();
+ super.tearDown();
+ }
+
+ @Override
+ public String getTag() {
+ return TAG;
}
/**
@@ -225,11 +203,6 @@
List.of(makeManifestReceiver(PACKAGE_GREEN, CLASS_GREEN)), false);
}
- private BroadcastRecord makeOrderedBroadcastRecord(Intent intent) {
- return makeBroadcastRecord(intent, BroadcastOptions.makeBasic(),
- List.of(makeManifestReceiver(PACKAGE_GREEN, CLASS_GREEN)), true);
- }
-
private BroadcastRecord makeBroadcastRecord(Intent intent, List receivers) {
return makeBroadcastRecord(intent, BroadcastOptions.makeBasic(), receivers, false);
}
@@ -246,8 +219,8 @@
private BroadcastRecord makeBroadcastRecord(Intent intent, BroadcastOptions options,
List receivers, IIntentReceiver resultTo, boolean ordered) {
- return new BroadcastRecord(mImpl, intent, mProcess, PACKAGE_RED, null, 21, 42, false, null,
- null, null, null, AppOpsManager.OP_NONE, options, receivers, null, resultTo,
+ return new BroadcastRecord(mImpl, intent, mProcess, PACKAGE_RED, null, 21, TEST_UID, false,
+ null, null, null, null, AppOpsManager.OP_NONE, options, receivers, null, resultTo,
Activity.RESULT_OK, null, null, ordered, false, false, UserHandle.USER_SYSTEM,
BackgroundStartPrivileges.NONE, false, null, PROCESS_STATE_UNKNOWN);
}
@@ -259,12 +232,12 @@
private void enqueueOrReplaceBroadcast(BroadcastProcessQueue queue,
BroadcastRecord record, int recordIndex, long enqueueTime) {
- queue.enqueueOrReplaceBroadcast(record, recordIndex, (r, i) -> {
- throw new UnsupportedOperationException();
- });
record.enqueueTime = enqueueTime;
record.enqueueRealTime = enqueueTime;
record.enqueueClockTime = enqueueTime;
+ queue.enqueueOrReplaceBroadcast(record, recordIndex, (r, i) -> {
+ throw new UnsupportedOperationException();
+ });
}
@Test
@@ -419,6 +392,7 @@
assertFalse(queue.isRunnable());
assertEquals(BroadcastProcessQueue.REASON_CACHED_INFINITE_DEFER,
queue.getRunnableAtReason());
+ assertTrue(queue.shouldBeDeferred());
assertEquals(ProcessList.SCHED_GROUP_UNDEFINED, queue.getPreferredSchedulingGroupLocked());
}
@@ -445,6 +419,7 @@
assertThat(cachedRunnableAt).isGreaterThan(notCachedRunnableAt);
assertTrue(queue.isRunnable());
assertEquals(BroadcastProcessQueue.REASON_CACHED, queue.getRunnableAtReason());
+ assertTrue(queue.shouldBeDeferred());
assertEquals(ProcessList.SCHED_GROUP_UNDEFINED, queue.getPreferredSchedulingGroupLocked());
}
@@ -526,11 +501,13 @@
queue.invalidateRunnableAt();
assertThat(queue.getRunnableAt()).isGreaterThan(airplaneRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_NORMAL, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
mConstants.MAX_PENDING_BROADCASTS = 1;
queue.invalidateRunnableAt();
assertThat(queue.getRunnableAt()).isAtMost(airplaneRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_MAX_PENDING, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
}
@Test
@@ -549,10 +526,12 @@
queue.setProcessAndUidState(mProcess, true, false);
assertThat(queue.getRunnableAt()).isLessThan(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_FOREGROUND, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
queue.setProcessAndUidState(mProcess, false, false);
assertThat(queue.getRunnableAt()).isGreaterThan(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_NORMAL, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
}
@Test
@@ -570,6 +549,7 @@
assertThat(queue.getRunnableAt()).isLessThan(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_TOP_PROCESS, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
doReturn(ActivityManager.PROCESS_STATE_SERVICE).when(mProcess).getSetProcState();
queue.setProcessAndUidState(mProcess, false, false);
@@ -580,6 +560,7 @@
List.of(makeMockRegisteredReceiver())), 0);
assertThat(queue.getRunnableAt()).isGreaterThan(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_NORMAL, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
}
@Test
@@ -594,16 +575,19 @@
assertThat(queue.getRunnableAt()).isGreaterThan(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_NORMAL, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
doReturn(true).when(mProcess).isPersistent();
queue.setProcessAndUidState(mProcess, false, false);
assertThat(queue.getRunnableAt()).isLessThan(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_PERSISTENT, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
doReturn(false).when(mProcess).isPersistent();
queue.setProcessAndUidState(mProcess, false, false);
assertThat(queue.getRunnableAt()).isGreaterThan(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_NORMAL, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
}
@Test
@@ -618,6 +602,31 @@
assertThat(queue.getRunnableAt()).isEqualTo(timeTickRecord.enqueueTime);
assertEquals(BroadcastProcessQueue.REASON_CORE_UID, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
+ }
+
+ @Test
+ public void testRunnableAt_freezableCoreUid() {
+ final BroadcastProcessQueue queue = new BroadcastProcessQueue(mConstants,
+ "com.android.bluetooth", Process.BLUETOOTH_UID);
+
+ // Mark the process as freezable
+ queue.setProcessAndUidState(mProcess, false, true);
+ final Intent timeTick = new Intent(Intent.ACTION_TIME_TICK);
+ final BroadcastOptions options = BroadcastOptions.makeWithDeferUntilActive(true);
+ final BroadcastRecord timeTickRecord = makeBroadcastRecord(timeTick, options,
+ List.of(makeMockRegisteredReceiver()), false);
+ enqueueOrReplaceBroadcast(queue, timeTickRecord, 0);
+
+ assertEquals(Long.MAX_VALUE, queue.getRunnableAt());
+ assertEquals(BroadcastProcessQueue.REASON_CACHED_INFINITE_DEFER,
+ queue.getRunnableAtReason());
+ assertTrue(queue.shouldBeDeferred());
+
+ queue.setProcessAndUidState(mProcess, false, false);
+ assertThat(queue.getRunnableAt()).isEqualTo(timeTickRecord.enqueueTime);
+ assertEquals(BroadcastProcessQueue.REASON_CORE_UID, queue.getRunnableAtReason());
+ assertFalse(queue.shouldBeDeferred());
}
/**
@@ -1553,6 +1562,216 @@
verifyPendingRecords(redQueue, List.of(userPresent, timeTick));
}
+ @Test
+ public void testDeliveryDeferredForCached() throws Exception {
+ final ProcessRecord greenProcess = makeProcessRecord(makeApplicationInfo(PACKAGE_GREEN));
+ final ProcessRecord redProcess = makeProcessRecord(makeApplicationInfo(PACKAGE_RED));
+
+ final Intent timeTick = new Intent(Intent.ACTION_TIME_TICK);
+ final BroadcastRecord timeTickRecord = makeBroadcastRecord(timeTick,
+ List.of(makeRegisteredReceiver(greenProcess, 0)));
+
+ final Intent batteryChanged = new Intent(Intent.ACTION_BATTERY_CHANGED);
+ final BroadcastOptions optionsBatteryChanged =
+ BroadcastOptions.makeWithDeferUntilActive(true);
+ final BroadcastRecord batteryChangedRecord = makeBroadcastRecord(batteryChanged,
+ optionsBatteryChanged,
+ List.of(makeRegisteredReceiver(greenProcess, 10),
+ makeRegisteredReceiver(redProcess, 0)),
+ false /* ordered */);
+
+ mImpl.enqueueBroadcastLocked(timeTickRecord);
+ mImpl.enqueueBroadcastLocked(batteryChangedRecord);
+
+ final BroadcastProcessQueue greenQueue = mImpl.getProcessQueue(PACKAGE_GREEN,
+ getUidForPackage(PACKAGE_GREEN));
+ final BroadcastProcessQueue redQueue = mImpl.getProcessQueue(PACKAGE_RED,
+ getUidForPackage(PACKAGE_RED));
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, greenQueue.getRunnableAtReason());
+ assertFalse(greenQueue.shouldBeDeferred());
+ assertEquals(BroadcastProcessQueue.REASON_BLOCKED, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ // Simulate process state change
+ greenQueue.setProcessAndUidState(greenProcess, false /* uidForeground */,
+ true /* processFreezable */);
+ greenQueue.updateDeferredStates(mImpl.mBroadcastConsumerDeferApply,
+ mImpl.mBroadcastConsumerDeferClear);
+
+ assertEquals(BroadcastProcessQueue.REASON_CACHED, greenQueue.getRunnableAtReason());
+ assertTrue(greenQueue.shouldBeDeferred());
+ // Once the broadcasts to green process are deferred, broadcasts to red process
+ // shouldn't be blocked anymore.
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ // All broadcasts to green process should be deferred.
+ greenQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_DEFERRED, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ redQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+
+ final Intent packageChanged = new Intent(Intent.ACTION_PACKAGE_CHANGED);
+ final BroadcastRecord packageChangedRecord = makeBroadcastRecord(packageChanged,
+ List.of(makeRegisteredReceiver(greenProcess, 0)));
+ mImpl.enqueueBroadcastLocked(packageChangedRecord);
+
+ assertEquals(BroadcastProcessQueue.REASON_CACHED, greenQueue.getRunnableAtReason());
+ assertTrue(greenQueue.shouldBeDeferred());
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ // All broadcasts to the green process, including the newly enqueued one, should be
+ // deferred.
+ greenQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_DEFERRED, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ redQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+
+ // Simulate process state change
+ greenQueue.setProcessAndUidState(greenProcess, false /* uidForeground */,
+ false /* processFreezable */);
+ greenQueue.updateDeferredStates(mImpl.mBroadcastConsumerDeferApply,
+ mImpl.mBroadcastConsumerDeferClear);
+
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, greenQueue.getRunnableAtReason());
+ assertFalse(greenQueue.shouldBeDeferred());
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ greenQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ redQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ }
+
+ @Test
+ public void testDeliveryDeferredForCached_withInfiniteDeferred() throws Exception {
+ final ProcessRecord greenProcess = makeProcessRecord(makeApplicationInfo(PACKAGE_GREEN));
+ final ProcessRecord redProcess = makeProcessRecord(makeApplicationInfo(PACKAGE_RED));
+
+ final Intent timeTick = new Intent(Intent.ACTION_TIME_TICK);
+ final BroadcastOptions optionsTimeTick = BroadcastOptions.makeWithDeferUntilActive(true);
+ final BroadcastRecord timeTickRecord = makeBroadcastRecord(timeTick, optionsTimeTick,
+ List.of(makeRegisteredReceiver(greenProcess, 0)), false /* ordered */);
+
+ final Intent batteryChanged = new Intent(Intent.ACTION_BATTERY_CHANGED);
+ final BroadcastOptions optionsBatteryChanged =
+ BroadcastOptions.makeWithDeferUntilActive(true);
+ final BroadcastRecord batteryChangedRecord = makeBroadcastRecord(batteryChanged,
+ optionsBatteryChanged,
+ List.of(makeRegisteredReceiver(greenProcess, 10),
+ makeRegisteredReceiver(redProcess, 0)),
+ false /* ordered */);
+
+ mImpl.enqueueBroadcastLocked(timeTickRecord);
+ mImpl.enqueueBroadcastLocked(batteryChangedRecord);
+
+ final BroadcastProcessQueue greenQueue = mImpl.getProcessQueue(PACKAGE_GREEN,
+ getUidForPackage(PACKAGE_GREEN));
+ final BroadcastProcessQueue redQueue = mImpl.getProcessQueue(PACKAGE_RED,
+ getUidForPackage(PACKAGE_RED));
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, greenQueue.getRunnableAtReason());
+ assertFalse(greenQueue.shouldBeDeferred());
+ assertEquals(BroadcastProcessQueue.REASON_BLOCKED, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ // Simulate process state change
+ greenQueue.setProcessAndUidState(greenProcess, false /* uidForeground */,
+ true /* processFreezable */);
+ greenQueue.updateDeferredStates(mImpl.mBroadcastConsumerDeferApply,
+ mImpl.mBroadcastConsumerDeferClear);
+
+ assertEquals(BroadcastProcessQueue.REASON_CACHED_INFINITE_DEFER,
+ greenQueue.getRunnableAtReason());
+ assertTrue(greenQueue.shouldBeDeferred());
+ // Once the broadcasts to green process are deferred, broadcasts to red process
+ // shouldn't be blocked anymore.
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ // All broadcasts to green process should be deferred.
+ greenQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_DEFERRED, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ redQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+
+ final Intent packageChanged = new Intent(Intent.ACTION_PACKAGE_CHANGED);
+ final BroadcastOptions optionsPackageChanged =
+ BroadcastOptions.makeWithDeferUntilActive(true);
+ final BroadcastRecord packageChangedRecord = makeBroadcastRecord(packageChanged,
+ optionsPackageChanged,
+ List.of(makeRegisteredReceiver(greenProcess, 0)), false /* ordered */);
+ mImpl.enqueueBroadcastLocked(packageChangedRecord);
+
+ assertEquals(BroadcastProcessQueue.REASON_CACHED_INFINITE_DEFER,
+ greenQueue.getRunnableAtReason());
+ assertTrue(greenQueue.shouldBeDeferred());
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ // All broadcasts to the green process, including the newly enqueued one, should be
+ // deferred.
+ greenQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_DEFERRED, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ redQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+
+ // Simulate process state change
+ greenQueue.setProcessAndUidState(greenProcess, false /* uidForeground */,
+ false /* processFreezable */);
+ greenQueue.updateDeferredStates(mImpl.mBroadcastConsumerDeferApply,
+ mImpl.mBroadcastConsumerDeferClear);
+
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, greenQueue.getRunnableAtReason());
+ assertFalse(greenQueue.shouldBeDeferred());
+ assertEquals(BroadcastProcessQueue.REASON_NORMAL, redQueue.getRunnableAtReason());
+ assertFalse(redQueue.shouldBeDeferred());
+
+ greenQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ redQueue.forEachMatchingBroadcast(BROADCAST_PREDICATE_ANY, (r, i) -> {
+ assertEquals("Unexpected state for " + r,
+ BroadcastRecord.DELIVERY_PENDING, r.getDeliveryState(i));
+ }, false /* andRemove */);
+ }
+
+ // TODO: Reuse BroadcastQueueTest.makeActiveProcessRecord()
+ private ProcessRecord makeProcessRecord(ApplicationInfo info) {
+ final ProcessRecord r = spy(new ProcessRecord(mAms, info, info.processName, info.uid));
+ r.setPid(mNextPid.incrementAndGet());
+ return r;
+ }
+
+ BroadcastFilter makeRegisteredReceiver(ProcessRecord app, int priority) {
+ final IIntentReceiver receiver = mock(IIntentReceiver.class);
+ final ReceiverList receiverList = new ReceiverList(mAms, app, app.getPid(), app.info.uid,
+ UserHandle.getUserId(app.info.uid), receiver);
+ return makeRegisteredReceiver(receiverList, priority);
+ }
+
private Intent createPackageChangedIntent(int uid, List<String> componentNameList) {
final Intent packageChangedIntent = new Intent(Intent.ACTION_PACKAGE_CHANGED);
packageChangedIntent.putExtra(Intent.EXTRA_UID, uid);
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java b/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java
index 73eb237..e914726 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueTest.java
@@ -62,58 +62,36 @@
import android.app.IApplicationThread;
import android.app.UidObserver;
import android.app.usage.UsageEvents.Event;
-import android.app.usage.UsageStatsManagerInternal;
import android.content.ComponentName;
-import android.content.Context;
import android.content.IIntentReceiver;
import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageManagerInternal;
-import android.content.pm.ResolveInfo;
import android.os.Binder;
import android.os.Bundle;
import android.os.DeadObjectException;
-import android.os.Handler;
-import android.os.HandlerThread;
import android.os.IBinder;
import android.os.PowerExemptionManager;
import android.os.SystemClock;
-import android.os.TestLooperManager;
import android.os.UserHandle;
-import android.provider.Settings;
import android.util.Log;
import android.util.Pair;
-import android.util.SparseArray;
import android.util.proto.ProtoOutputStream;
import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
-import com.android.server.AlarmManagerInternal;
-import com.android.server.DropBoxManagerInternal;
-import com.android.server.LocalServices;
-import com.android.server.am.ActivityManagerService.Injector;
-import com.android.server.appop.AppOpsService;
-import com.android.server.wm.ActivityTaskManagerService;
-
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.mockito.ArgumentMatcher;
import org.mockito.InOrder;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
import org.mockito.verification.VerificationMode;
-import java.io.File;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.Writer;
@@ -125,7 +103,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.UnaryOperator;
@@ -135,13 +113,9 @@
@MediumTest
@RunWith(Parameterized.class)
@SuppressWarnings("GuardedBy")
-public class BroadcastQueueTest {
+public class BroadcastQueueTest extends BaseBroadcastQueueTest {
private static final String TAG = "BroadcastQueueTest";
- @Rule
- public final ApplicationExitInfoTest.ServiceThreadRule
- mServiceThreadRule = new ApplicationExitInfoTest.ServiceThreadRule();
-
private final Impl mImpl;
private enum Impl {
@@ -149,30 +123,8 @@
MODERN,
}
- private Context mContext;
- private HandlerThread mHandlerThread;
- private TestLooperManager mLooper;
- private AtomicInteger mNextPid;
-
- @Mock
- private AppOpsService mAppOpsService;
- @Mock
- private ProcessList mProcessList;
- @Mock
- private DropBoxManagerInternal mDropBoxManagerInt;
- @Mock
- private PackageManagerInternal mPackageManagerInt;
- @Mock
- private UsageStatsManagerInternal mUsageStatsManagerInt;
- @Mock
- private AlarmManagerInternal mAlarmManagerInt;
-
- private ActivityManagerService mAms;
private BroadcastQueue mQueue;
- BroadcastConstants mConstants;
- private BroadcastSkipPolicy mSkipPolicy;
private UidObserver mUidObserver;
- private UidObserver mUidCachedStateObserver;
/**
* Desired behavior of the next
@@ -182,11 +134,6 @@
ProcessStartBehavior.SUCCESS);
/**
- * Map from PID to registered registered runtime receivers.
- */
- private SparseArray<ReceiverList> mRegisteredReceivers = new SparseArray<>();
-
- /**
* Collection of all active processes during current test run.
*/
private List<ProcessRecord> mActiveProcesses = new ArrayList<>();
@@ -207,41 +154,8 @@
@Before
public void setUp() throws Exception {
- MockitoAnnotations.initMocks(this);
+ super.setUp();
- mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-
- mHandlerThread = new HandlerThread(TAG);
- mHandlerThread.start();
-
- // Pause all event processing until a test chooses to resume
- mLooper = Objects.requireNonNull(InstrumentationRegistry.getInstrumentation()
- .acquireLooperManager(mHandlerThread.getLooper()));
-
- mNextPid = new AtomicInteger(100);
-
- LocalServices.removeServiceForTest(DropBoxManagerInternal.class);
- LocalServices.addService(DropBoxManagerInternal.class, mDropBoxManagerInt);
- LocalServices.removeServiceForTest(PackageManagerInternal.class);
- LocalServices.addService(PackageManagerInternal.class, mPackageManagerInt);
- LocalServices.removeServiceForTest(AlarmManagerInternal.class);
- LocalServices.addService(AlarmManagerInternal.class, mAlarmManagerInt);
- doReturn(new ComponentName("", "")).when(mPackageManagerInt).getSystemUiServiceComponent();
- doNothing().when(mPackageManagerInt).setPackageStoppedState(any(), anyBoolean(), anyInt());
- doAnswer((invocation) -> {
- return getUidForPackage(invocation.getArgument(0));
- }).when(mPackageManagerInt).getPackageUid(any(), anyLong(), eq(UserHandle.USER_SYSTEM));
-
- final ActivityManagerService realAms = new ActivityManagerService(
- new TestInjector(mContext), mServiceThreadRule.getThread());
- realAms.mActivityTaskManager = new ActivityTaskManagerService(mContext);
- realAms.mActivityTaskManager.initialize(null, null, mContext.getMainLooper());
- realAms.mAtmInternal = spy(realAms.mActivityTaskManager.getAtmInternal());
- realAms.mOomAdjuster = spy(realAms.mOomAdjuster);
- realAms.mPackageManagerInt = mPackageManagerInt;
- realAms.mUsageStatsService = mUsageStatsManagerInt;
- realAms.mProcessesReady = true;
- mAms = spy(realAms);
doAnswer((invocation) -> {
Log.v(TAG, "Intercepting startProcessLocked() for "
+ Arrays.toString(invocation.getArguments()));
@@ -320,21 +234,11 @@
return null;
}).when(mAms).registerUidObserver(any(), anyInt(),
eq(ActivityManager.PROCESS_STATE_TOP), any());
- doAnswer((invocation) -> {
- mUidCachedStateObserver = invocation.getArgument(0);
- return null;
- }).when(mAms).registerUidObserver(any(), anyInt(),
- eq(ActivityManager.PROCESS_STATE_LAST_ACTIVITY), any());
- mConstants = new BroadcastConstants(Settings.Global.BROADCAST_FG_CONSTANTS);
- mConstants.TIMEOUT = 100;
+ mConstants.TIMEOUT = 200;
mConstants.ALLOW_BG_ACTIVITY_START_TIMEOUT = 0;
mConstants.PENDING_COLD_START_CHECK_INTERVAL_MILLIS = 500;
- mSkipPolicy = spy(new BroadcastSkipPolicy(mAms));
- doReturn(null).when(mSkipPolicy).shouldSkipMessage(any(), any());
- doReturn(false).when(mSkipPolicy).disallowBackgroundStart(any());
-
final BroadcastHistory emptyHistory = new BroadcastHistory(mConstants) {
public void addBroadcastToHistoryLocked(BroadcastRecord original) {
// Ignored
@@ -357,7 +261,7 @@
@After
public void tearDown() throws Exception {
- mHandlerThread.quit();
+ super.tearDown();
// Verify that all processes have finished handling broadcasts
for (ProcessRecord app : mActiveProcesses) {
@@ -368,26 +272,9 @@
}
}
- private class TestInjector extends Injector {
- TestInjector(Context context) {
- super(context);
- }
-
- @Override
- public AppOpsService getAppOpsService(File recentAccessesFile, File storageFile,
- Handler handler) {
- return mAppOpsService;
- }
-
- @Override
- public Handler getUiHandler(ActivityManagerService service) {
- return mHandlerThread.getThreadHandler();
- }
-
- @Override
- public ProcessList getProcessList(ActivityManagerService service) {
- return mProcessList;
- }
+ @Override
+ public String getTag() {
+ return TAG;
}
private enum ProcessStartBehavior {
@@ -533,62 +420,6 @@
return Pair.create(app.getPid(), intent.getAction());
}
- static ApplicationInfo makeApplicationInfo(String packageName) {
- return makeApplicationInfo(packageName, packageName, UserHandle.USER_SYSTEM);
- }
-
- static ApplicationInfo makeApplicationInfo(String packageName, String processName, int userId) {
- final ApplicationInfo ai = new ApplicationInfo();
- ai.packageName = packageName;
- ai.processName = processName;
- ai.uid = getUidForPackage(packageName, userId);
- return ai;
- }
-
- static ResolveInfo withPriority(ResolveInfo info, int priority) {
- info.priority = priority;
- return info;
- }
-
- static BroadcastFilter withPriority(BroadcastFilter filter, int priority) {
- filter.setPriority(priority);
- return filter;
- }
-
- static ResolveInfo makeManifestReceiver(String packageName, String name) {
- return makeManifestReceiver(packageName, name, UserHandle.USER_SYSTEM);
- }
-
- static ResolveInfo makeManifestReceiver(String packageName, String name, int userId) {
- return makeManifestReceiver(packageName, packageName, name, userId);
- }
-
- static ResolveInfo makeManifestReceiver(String packageName, String processName, String name,
- int userId) {
- final ResolveInfo ri = new ResolveInfo();
- ri.activityInfo = new ActivityInfo();
- ri.activityInfo.packageName = packageName;
- ri.activityInfo.processName = processName;
- ri.activityInfo.name = name;
- ri.activityInfo.applicationInfo = makeApplicationInfo(packageName, processName, userId);
- return ri;
- }
-
- private BroadcastFilter makeRegisteredReceiver(ProcessRecord app) {
- return makeRegisteredReceiver(app, 0);
- }
-
- private BroadcastFilter makeRegisteredReceiver(ProcessRecord app, int priority) {
- final ReceiverList receiverList = mRegisteredReceivers.get(app.getPid());
- final IntentFilter filter = new IntentFilter();
- filter.setPriority(priority);
- final BroadcastFilter res = new BroadcastFilter(filter, receiverList,
- receiverList.app.info.packageName, null, null, null, receiverList.uid,
- receiverList.userId, false, false, true);
- receiverList.add(res);
- return res;
- }
-
private BroadcastRecord makeBroadcastRecord(Intent intent, ProcessRecord callerApp,
List<Object> receivers) {
return makeBroadcastRecord(intent, callerApp, BroadcastOptions.makeBasic(),
@@ -707,6 +538,9 @@
private void waitForIdle() throws Exception {
mLooper.release();
mQueue.waitForIdle(LOG_WRITER_INFO);
+ final CountDownLatch latch = new CountDownLatch(1);
+ mHandlerThread.getThreadHandler().post(latch::countDown);
+ latch.await();
mLooper = Objects.requireNonNull(InstrumentationRegistry.getInstrumentation()
.acquireLooperManager(mHandlerThread.getLooper()));
}
@@ -772,41 +606,6 @@
eq(userId), anyInt(), anyInt(), any());
}
- static final int USER_GUEST = 11;
-
- static final String PACKAGE_ANDROID = "android";
- static final String PACKAGE_PHONE = "com.android.phone";
- static final String PACKAGE_RED = "com.example.red";
- static final String PACKAGE_GREEN = "com.example.green";
- static final String PACKAGE_BLUE = "com.example.blue";
- static final String PACKAGE_YELLOW = "com.example.yellow";
- static final String PACKAGE_ORANGE = "com.example.orange";
-
- static final String PROCESS_SYSTEM = "system";
-
- static final String CLASS_RED = "com.example.red.Red";
- static final String CLASS_GREEN = "com.example.green.Green";
- static final String CLASS_BLUE = "com.example.blue.Blue";
- static final String CLASS_YELLOW = "com.example.yellow.Yellow";
- static final String CLASS_ORANGE = "com.example.orange.Orange";
-
- static int getUidForPackage(@NonNull String packageName) {
- switch (packageName) {
- case PACKAGE_ANDROID: return android.os.Process.SYSTEM_UID;
- case PACKAGE_PHONE: return android.os.Process.PHONE_UID;
- case PACKAGE_RED: return android.os.Process.FIRST_APPLICATION_UID + 1;
- case PACKAGE_GREEN: return android.os.Process.FIRST_APPLICATION_UID + 2;
- case PACKAGE_BLUE: return android.os.Process.FIRST_APPLICATION_UID + 3;
- case PACKAGE_YELLOW: return android.os.Process.FIRST_APPLICATION_UID + 4;
- case PACKAGE_ORANGE: return android.os.Process.FIRST_APPLICATION_UID + 5;
- default: throw new IllegalArgumentException();
- }
- }
-
- static int getUidForPackage(@NonNull String packageName, int userId) {
- return UserHandle.getUid(userId, getUidForPackage(packageName));
- }
-
/**
* Baseline verification of common debugging infrastructure, mostly to make
* sure it doesn't crash.
@@ -2342,6 +2141,7 @@
mUidObserver.onUidStateChanged(receiverGreenApp.info.uid,
ActivityManager.PROCESS_STATE_TOP, 0, ActivityManager.PROCESS_CAPABILITY_NONE);
+ waitForIdle();
final Intent airplane = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
final Intent timeTick = new Intent(Intent.ACTION_TIME_TICK);
@@ -2375,6 +2175,7 @@
mUidObserver.onUidStateChanged(receiverGreenApp.info.uid,
ActivityManager.PROCESS_STATE_TOP, 0, ActivityManager.PROCESS_CAPABILITY_NONE);
+ waitForIdle();
final Intent timeTick = new Intent(Intent.ACTION_TIME_TICK);
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
index d52b7ea..6a28009 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
@@ -27,6 +27,8 @@
import static com.google.common.truth.Truth.assertThat;
+import static junit.framework.Assert.assertEquals;
+
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
@@ -1648,4 +1650,24 @@
assertThat(mHdmiControlService.isSystemAudioActivated()).isTrue();
}
+
+ @Test
+ public void newDeviceConnectedIfOnlyOneGiveOsdNameSent() {
+ mHdmiControlService.getHdmiCecNetwork().clearDeviceList();
+ assertThat(mHdmiControlService.getHdmiCecNetwork().getDeviceInfoList(false))
+ .isEmpty();
+ HdmiCecMessage reportPhysicalAddress =
+ HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
+ ADDR_PLAYBACK_2, 0x1000, HdmiDeviceInfo.DEVICE_PLAYBACK);
+ HdmiCecMessage giveOsdName = HdmiCecMessageBuilder.buildGiveOsdNameCommand(
+ ADDR_TV, ADDR_PLAYBACK_2);
+ mNativeWrapper.onCecMessage(reportPhysicalAddress);
+ mTestLooper.dispatchAll();
+
+ // Wait until HdmiCecNetwork or NewDeviceAction is in progress
+ mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS);
+
+ // TV should only send <Give Osd Name> once
+ assertEquals(1, Collections.frequency(mNativeWrapper.getResultMessages(), giveOsdName));
+ }
}
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index c152a41..25bd14f 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -2951,11 +2951,11 @@
for(String key : bundle.keySet()) {
if (key != null) {
- final Object value = bundle.get(key);
- final Object newValue = newBundle.get(key);
if (!newBundle.containsKey(key)) {
return false;
}
+ final Object value = bundle.get(key);
+ final Object newValue = newBundle.get(key);
if (value instanceof Bundle && newValue instanceof Bundle) {
if (!areBundlesEqual((Bundle) value, (Bundle) newValue)) {
return false;
diff --git a/tests/HwAccelerationTest/OWNERS b/tests/HwAccelerationTest/OWNERS
deleted file mode 100644
index c88a9f8..0000000
--- a/tests/HwAccelerationTest/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include /libs/hwui/OWNERS
diff --git a/tests/NetworkSecurityConfigTest/OWNERS b/tests/NetworkSecurityConfigTest/OWNERS
index aa87958..90e1bed 100644
--- a/tests/NetworkSecurityConfigTest/OWNERS
+++ b/tests/NetworkSecurityConfigTest/OWNERS
@@ -1 +1,2 @@
include /services/core/java/com/android/server/net/OWNERS
+include /core/java/android/security/net/OWNERS
diff --git a/tests/SilkFX/OWNERS b/tests/SilkFX/OWNERS
deleted file mode 100644
index c88a9f8..0000000
--- a/tests/SilkFX/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-include /libs/hwui/OWNERS
diff --git a/tests/SmokeTestApps/Android.bp b/tests/SmokeTestApps/Android.bp
index 3505fe1..38ee8ac 100644
--- a/tests/SmokeTestApps/Android.bp
+++ b/tests/SmokeTestApps/Android.bp
@@ -11,4 +11,7 @@
name: "SmokeTestTriggerApps",
srcs: ["src/**/*.java"],
sdk_version: "current",
+ errorprone: {
+ enabled: false,
+ },
}
diff --git a/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt b/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt
index 1dfd5c0..d0e5626 100644
--- a/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt
+++ b/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt
@@ -93,7 +93,7 @@
}
@Test
- @RequiresFlagsEnabled(android.security.Flags.FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS)
+ @RequiresFlagsEnabled(android.security.Flags.FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS_V2)
fun grantCannotActivelyUnlockDevice() {
// On automotive, trust agents can actively unlock the device.
assumeFalse(packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE))
@@ -120,7 +120,7 @@
}
@Test
- @RequiresFlagsDisabled(android.security.Flags.FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS)
+ @RequiresFlagsDisabled(android.security.Flags.FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS_V2)
fun grantCouldCauseWrongDeviceLockedStateDueToBug() {
// On automotive, trust agents can actively unlock the device.
assumeFalse(packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE))
diff --git a/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt b/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt
index 5a8f828..0121809 100644
--- a/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt
+++ b/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt
@@ -36,7 +36,8 @@
class LockStateTrackingRule : TestRule {
private val context: Context = getApplicationContext()
private val windowManager = checkNotNull(WindowManagerGlobal.getWindowManagerService())
- private val keyguardManager = context.getSystemService(KeyguardManager::class.java) as KeyguardManager
+ private val keyguardManager =
+ context.getSystemService(KeyguardManager::class.java) as KeyguardManager
@Volatile lateinit var trustState: TrustState
private set
@@ -63,7 +64,7 @@
wait("not trusted") { trustState.trusted == false }
}
- // TODO(b/299298338) remove this when removing FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS
+ // TODO(b/299298338) remove this when removing FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS_V2
fun assertUnlockedButNotReally() {
wait("device unlocked") { !keyguardManager.isDeviceLocked }
wait("not trusted") { trustState.trusted == false }
@@ -87,7 +88,7 @@
trustGrantedMessages: MutableList<String>
) {
Log.d(TAG, "Device became trusted=$enabled")
- trustState = trustState.copy(trusted=enabled)
+ trustState = trustState.copy(trusted = enabled)
}
}
diff --git a/tests/HwAccelerationTest/.classpath b/tests/graphics/HwAccelerationTest/.classpath
similarity index 100%
rename from tests/HwAccelerationTest/.classpath
rename to tests/graphics/HwAccelerationTest/.classpath
diff --git a/tests/HwAccelerationTest/.gitignore b/tests/graphics/HwAccelerationTest/.gitignore
similarity index 100%
rename from tests/HwAccelerationTest/.gitignore
rename to tests/graphics/HwAccelerationTest/.gitignore
diff --git a/tests/HwAccelerationTest/Android.bp b/tests/graphics/HwAccelerationTest/Android.bp
similarity index 100%
rename from tests/HwAccelerationTest/Android.bp
rename to tests/graphics/HwAccelerationTest/Android.bp
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/graphics/HwAccelerationTest/AndroidManifest.xml
similarity index 98%
rename from tests/HwAccelerationTest/AndroidManifest.xml
rename to tests/graphics/HwAccelerationTest/AndroidManifest.xml
index 80c7a21..db3a992 100644
--- a/tests/HwAccelerationTest/AndroidManifest.xml
+++ b/tests/graphics/HwAccelerationTest/AndroidManifest.xml
@@ -789,6 +789,15 @@
</intent-filter>
</activity>
+ <activity android:name="BackdropBlurActivity"
+ android:label="RenderEffect/BackdropBlur"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="com.android.test.hwui.TEST"/>
+ </intent-filter>
+ </activity>
+
<activity android:name="BlurActivity"
android:label="RenderEffect/Blur"
android:exported="true">
diff --git a/tests/HwAccelerationTest/default.properties b/tests/graphics/HwAccelerationTest/default.properties
similarity index 100%
rename from tests/HwAccelerationTest/default.properties
rename to tests/graphics/HwAccelerationTest/default.properties
diff --git a/tests/HwAccelerationTest/jni/Android.bp b/tests/graphics/HwAccelerationTest/jni/Android.bp
similarity index 100%
rename from tests/HwAccelerationTest/jni/Android.bp
rename to tests/graphics/HwAccelerationTest/jni/Android.bp
diff --git a/tests/HwAccelerationTest/jni/native-lib.cpp b/tests/graphics/HwAccelerationTest/jni/native-lib.cpp
similarity index 100%
rename from tests/HwAccelerationTest/jni/native-lib.cpp
rename to tests/graphics/HwAccelerationTest/jni/native-lib.cpp
diff --git a/tests/HwAccelerationTest/res/anim/accelerate_interpolator_2.xml b/tests/graphics/HwAccelerationTest/res/anim/accelerate_interpolator_2.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/anim/accelerate_interpolator_2.xml
rename to tests/graphics/HwAccelerationTest/res/anim/accelerate_interpolator_2.xml
diff --git a/tests/HwAccelerationTest/res/anim/fade_in.xml b/tests/graphics/HwAccelerationTest/res/anim/fade_in.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/anim/fade_in.xml
rename to tests/graphics/HwAccelerationTest/res/anim/fade_in.xml
diff --git a/tests/HwAccelerationTest/res/anim/fade_out.xml b/tests/graphics/HwAccelerationTest/res/anim/fade_out.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/anim/fade_out.xml
rename to tests/graphics/HwAccelerationTest/res/anim/fade_out.xml
diff --git a/tests/HwAccelerationTest/res/anim/slide_off_left.xml b/tests/graphics/HwAccelerationTest/res/anim/slide_off_left.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/anim/slide_off_left.xml
rename to tests/graphics/HwAccelerationTest/res/anim/slide_off_left.xml
diff --git a/tests/HwAccelerationTest/res/drawable-hdpi/appwidget_background.xml b/tests/graphics/HwAccelerationTest/res/drawable-hdpi/appwidget_background.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-hdpi/appwidget_background.xml
rename to tests/graphics/HwAccelerationTest/res/drawable-hdpi/appwidget_background.xml
diff --git a/tests/HwAccelerationTest/res/drawable-hdpi/icon.png b/tests/graphics/HwAccelerationTest/res/drawable-hdpi/icon.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-hdpi/icon.png
rename to tests/graphics/HwAccelerationTest/res/drawable-hdpi/icon.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-hdpi/sunset1.jpg b/tests/graphics/HwAccelerationTest/res/drawable-hdpi/sunset1.jpg
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-hdpi/sunset1.jpg
rename to tests/graphics/HwAccelerationTest/res/drawable-hdpi/sunset1.jpg
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-hdpi/sunset2.png b/tests/graphics/HwAccelerationTest/res/drawable-hdpi/sunset2.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-hdpi/sunset2.png
rename to tests/graphics/HwAccelerationTest/res/drawable-hdpi/sunset2.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-hdpi/sunset3.png b/tests/graphics/HwAccelerationTest/res/drawable-hdpi/sunset3.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-hdpi/sunset3.png
rename to tests/graphics/HwAccelerationTest/res/drawable-hdpi/sunset3.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-hdpi/widget_header.png b/tests/graphics/HwAccelerationTest/res/drawable-hdpi/widget_header.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-hdpi/widget_header.png
rename to tests/graphics/HwAccelerationTest/res/drawable-hdpi/widget_header.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-mdpi/expander_ic_maximized.9.png b/tests/graphics/HwAccelerationTest/res/drawable-mdpi/expander_ic_maximized.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-mdpi/expander_ic_maximized.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-mdpi/expander_ic_maximized.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-mdpi/expander_ic_minimized.9.png b/tests/graphics/HwAccelerationTest/res/drawable-mdpi/expander_ic_minimized.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-mdpi/expander_ic_minimized.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-mdpi/expander_ic_minimized.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/appwidget_bg.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/appwidget_bg.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/appwidget_bg.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/appwidget_bg.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_focus.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_focus.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_focus.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_focus.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_press.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_press.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_press.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/appwidget_bg_press.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/green_gradient.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/green_gradient.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/green_gradient.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/green_gradient.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/large_photo.jpg b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/large_photo.jpg
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/large_photo.jpg
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/large_photo.jpg
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/patch.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/patch.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/patch.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/patch.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/patch2.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/patch2.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/patch2.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/patch2.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/progress_vertical_bg_holo_dark.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/progress_vertical_bg_holo_dark.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/progress_vertical_bg_holo_dark.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/progress_vertical_bg_holo_dark.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/progress_vertical_primary_holo_dark.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/progress_vertical_primary_holo_dark.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/progress_vertical_primary_holo_dark.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/progress_vertical_primary_holo_dark.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/progress_vertical_secondary_holo_dark.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/progress_vertical_secondary_holo_dark.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/progress_vertical_secondary_holo_dark.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/progress_vertical_secondary_holo_dark.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/scratches.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/scratches.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/scratches.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/scratches.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_primary_holo.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_primary_holo.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_primary_holo.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_primary_holo.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_secondary_holo.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_secondary_holo.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_secondary_holo.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_secondary_holo.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_dark.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_dark.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_dark.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_dark.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_light.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_light.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_light.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/scrubber_vertical_track_holo_light.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/spot_mask.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/spot_mask.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/spot_mask.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/spot_mask.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/very_large_photo.jpg b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/very_large_photo.jpg
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/very_large_photo.jpg
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/very_large_photo.jpg
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/weather_2.jpg b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/weather_2.jpg
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/weather_2.jpg
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/weather_2.jpg
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable-nodpi/widget_title_bg.9.png b/tests/graphics/HwAccelerationTest/res/drawable-nodpi/widget_title_bg.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable-nodpi/widget_title_bg.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable-nodpi/widget_title_bg.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/appwidget_background.xml b/tests/graphics/HwAccelerationTest/res/drawable/appwidget_background.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/appwidget_background.xml
rename to tests/graphics/HwAccelerationTest/res/drawable/appwidget_background.xml
diff --git a/tests/HwAccelerationTest/res/drawable/appwidget_bg.9.png b/tests/graphics/HwAccelerationTest/res/drawable/appwidget_bg.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/appwidget_bg.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable/appwidget_bg.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/appwidget_bg_focus.9.png b/tests/graphics/HwAccelerationTest/res/drawable/appwidget_bg_focus.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/appwidget_bg_focus.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable/appwidget_bg_focus.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/appwidget_bg_press.9.png b/tests/graphics/HwAccelerationTest/res/drawable/appwidget_bg_press.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/appwidget_bg_press.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable/appwidget_bg_press.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/btn_toggle_off.9.png b/tests/graphics/HwAccelerationTest/res/drawable/btn_toggle_off.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/btn_toggle_off.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable/btn_toggle_off.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/btn_toggle_on.9.png b/tests/graphics/HwAccelerationTest/res/drawable/btn_toggle_on.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/btn_toggle_on.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable/btn_toggle_on.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/default_wallpaper.png b/tests/graphics/HwAccelerationTest/res/drawable/default_wallpaper.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/default_wallpaper.png
rename to tests/graphics/HwAccelerationTest/res/drawable/default_wallpaper.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/gradient.xml b/tests/graphics/HwAccelerationTest/res/drawable/gradient.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/gradient.xml
rename to tests/graphics/HwAccelerationTest/res/drawable/gradient.xml
diff --git a/tests/HwAccelerationTest/res/drawable/green_gradient.9.png b/tests/graphics/HwAccelerationTest/res/drawable/green_gradient.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/green_gradient.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable/green_gradient.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/icon.png b/tests/graphics/HwAccelerationTest/res/drawable/icon.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/icon.png
rename to tests/graphics/HwAccelerationTest/res/drawable/icon.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/progress_vertical_holo_dark.xml b/tests/graphics/HwAccelerationTest/res/drawable/progress_vertical_holo_dark.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/progress_vertical_holo_dark.xml
rename to tests/graphics/HwAccelerationTest/res/drawable/progress_vertical_holo_dark.xml
diff --git a/tests/HwAccelerationTest/res/drawable/robot.png b/tests/graphics/HwAccelerationTest/res/drawable/robot.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/robot.png
rename to tests/graphics/HwAccelerationTest/res/drawable/robot.png
Binary files differ
diff --git a/tests/graphics/HwAccelerationTest/res/drawable/robot_repeated.xml b/tests/graphics/HwAccelerationTest/res/drawable/robot_repeated.xml
new file mode 100644
index 0000000..bbb15b7
--- /dev/null
+++ b/tests/graphics/HwAccelerationTest/res/drawable/robot_repeated.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+ android:src="@drawable/robot"
+ android:tileMode="repeat" android:gravity="fill" />
\ No newline at end of file
diff --git a/tests/HwAccelerationTest/res/drawable/round_rect_background.xml b/tests/graphics/HwAccelerationTest/res/drawable/round_rect_background.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/round_rect_background.xml
rename to tests/graphics/HwAccelerationTest/res/drawable/round_rect_background.xml
diff --git a/tests/HwAccelerationTest/res/drawable/scrubber_progress_vertical_holo_dark.xml b/tests/graphics/HwAccelerationTest/res/drawable/scrubber_progress_vertical_holo_dark.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/scrubber_progress_vertical_holo_dark.xml
rename to tests/graphics/HwAccelerationTest/res/drawable/scrubber_progress_vertical_holo_dark.xml
diff --git a/tests/HwAccelerationTest/res/drawable/sunset1.jpg b/tests/graphics/HwAccelerationTest/res/drawable/sunset1.jpg
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/sunset1.jpg
rename to tests/graphics/HwAccelerationTest/res/drawable/sunset1.jpg
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/sunset2.png b/tests/graphics/HwAccelerationTest/res/drawable/sunset2.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/sunset2.png
rename to tests/graphics/HwAccelerationTest/res/drawable/sunset2.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/sunset3.png b/tests/graphics/HwAccelerationTest/res/drawable/sunset3.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/sunset3.png
rename to tests/graphics/HwAccelerationTest/res/drawable/sunset3.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/widget_header.png b/tests/graphics/HwAccelerationTest/res/drawable/widget_header.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/widget_header.png
rename to tests/graphics/HwAccelerationTest/res/drawable/widget_header.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/drawable/widget_title_bg.9.png b/tests/graphics/HwAccelerationTest/res/drawable/widget_title_bg.9.png
similarity index 100%
rename from tests/HwAccelerationTest/res/drawable/widget_title_bg.9.png
rename to tests/graphics/HwAccelerationTest/res/drawable/widget_title_bg.9.png
Binary files differ
diff --git a/tests/HwAccelerationTest/res/layout/_advanced_blend.xml b/tests/graphics/HwAccelerationTest/res/layout/_advanced_blend.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/_advanced_blend.xml
rename to tests/graphics/HwAccelerationTest/res/layout/_advanced_blend.xml
diff --git a/tests/HwAccelerationTest/res/layout/_advanced_gradient.xml b/tests/graphics/HwAccelerationTest/res/layout/_advanced_gradient.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/_advanced_gradient.xml
rename to tests/graphics/HwAccelerationTest/res/layout/_advanced_gradient.xml
diff --git a/tests/HwAccelerationTest/res/layout/_layers.xml b/tests/graphics/HwAccelerationTest/res/layout/_layers.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/_layers.xml
rename to tests/graphics/HwAccelerationTest/res/layout/_layers.xml
diff --git a/tests/HwAccelerationTest/res/layout/_lines.xml b/tests/graphics/HwAccelerationTest/res/layout/_lines.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/_lines.xml
rename to tests/graphics/HwAccelerationTest/res/layout/_lines.xml
diff --git a/tests/HwAccelerationTest/res/layout/_newlayers.xml b/tests/graphics/HwAccelerationTest/res/layout/_newlayers.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/_newlayers.xml
rename to tests/graphics/HwAccelerationTest/res/layout/_newlayers.xml
diff --git a/tests/HwAccelerationTest/res/layout/_paths.xml b/tests/graphics/HwAccelerationTest/res/layout/_paths.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/_paths.xml
rename to tests/graphics/HwAccelerationTest/res/layout/_paths.xml
diff --git a/tests/HwAccelerationTest/res/layout/_shaders.xml b/tests/graphics/HwAccelerationTest/res/layout/_shaders.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/_shaders.xml
rename to tests/graphics/HwAccelerationTest/res/layout/_shaders.xml
diff --git a/tests/HwAccelerationTest/res/layout/colored_shadows_activity.xml b/tests/graphics/HwAccelerationTest/res/layout/colored_shadows_activity.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/colored_shadows_activity.xml
rename to tests/graphics/HwAccelerationTest/res/layout/colored_shadows_activity.xml
diff --git a/tests/HwAccelerationTest/res/layout/colored_shadows_row.xml b/tests/graphics/HwAccelerationTest/res/layout/colored_shadows_row.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/colored_shadows_row.xml
rename to tests/graphics/HwAccelerationTest/res/layout/colored_shadows_row.xml
diff --git a/tests/HwAccelerationTest/res/layout/date_picker.xml b/tests/graphics/HwAccelerationTest/res/layout/date_picker.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/date_picker.xml
rename to tests/graphics/HwAccelerationTest/res/layout/date_picker.xml
diff --git a/tests/HwAccelerationTest/res/layout/flipper_item.xml b/tests/graphics/HwAccelerationTest/res/layout/flipper_item.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/flipper_item.xml
rename to tests/graphics/HwAccelerationTest/res/layout/flipper_item.xml
diff --git a/tests/HwAccelerationTest/res/layout/form.xml b/tests/graphics/HwAccelerationTest/res/layout/form.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/form.xml
rename to tests/graphics/HwAccelerationTest/res/layout/form.xml
diff --git a/tests/HwAccelerationTest/res/layout/image_filter_activity.xml b/tests/graphics/HwAccelerationTest/res/layout/image_filter_activity.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/image_filter_activity.xml
rename to tests/graphics/HwAccelerationTest/res/layout/image_filter_activity.xml
diff --git a/tests/HwAccelerationTest/res/layout/labels.xml b/tests/graphics/HwAccelerationTest/res/layout/labels.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/labels.xml
rename to tests/graphics/HwAccelerationTest/res/layout/labels.xml
diff --git a/tests/HwAccelerationTest/res/layout/list_activity.xml b/tests/graphics/HwAccelerationTest/res/layout/list_activity.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/list_activity.xml
rename to tests/graphics/HwAccelerationTest/res/layout/list_activity.xml
diff --git a/tests/HwAccelerationTest/res/layout/pen_stylus.xml b/tests/graphics/HwAccelerationTest/res/layout/pen_stylus.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/pen_stylus.xml
rename to tests/graphics/HwAccelerationTest/res/layout/pen_stylus.xml
diff --git a/tests/HwAccelerationTest/res/layout/projection.xml b/tests/graphics/HwAccelerationTest/res/layout/projection.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/projection.xml
rename to tests/graphics/HwAccelerationTest/res/layout/projection.xml
diff --git a/tests/HwAccelerationTest/res/layout/projection_clipping.xml b/tests/graphics/HwAccelerationTest/res/layout/projection_clipping.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/projection_clipping.xml
rename to tests/graphics/HwAccelerationTest/res/layout/projection_clipping.xml
diff --git a/tests/HwAccelerationTest/res/layout/scrolling_stretch_surfaceview.xml b/tests/graphics/HwAccelerationTest/res/layout/scrolling_stretch_surfaceview.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/scrolling_stretch_surfaceview.xml
rename to tests/graphics/HwAccelerationTest/res/layout/scrolling_stretch_surfaceview.xml
diff --git a/tests/HwAccelerationTest/res/layout/stack.xml b/tests/graphics/HwAccelerationTest/res/layout/stack.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/stack.xml
rename to tests/graphics/HwAccelerationTest/res/layout/stack.xml
diff --git a/tests/HwAccelerationTest/res/layout/stack_item.xml b/tests/graphics/HwAccelerationTest/res/layout/stack_item.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/stack_item.xml
rename to tests/graphics/HwAccelerationTest/res/layout/stack_item.xml
diff --git a/tests/HwAccelerationTest/res/layout/stretch_layout.xml b/tests/graphics/HwAccelerationTest/res/layout/stretch_layout.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/stretch_layout.xml
rename to tests/graphics/HwAccelerationTest/res/layout/stretch_layout.xml
diff --git a/tests/HwAccelerationTest/res/layout/text_fade.xml b/tests/graphics/HwAccelerationTest/res/layout/text_fade.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/text_fade.xml
rename to tests/graphics/HwAccelerationTest/res/layout/text_fade.xml
diff --git a/tests/HwAccelerationTest/res/layout/text_large.xml b/tests/graphics/HwAccelerationTest/res/layout/text_large.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/text_large.xml
rename to tests/graphics/HwAccelerationTest/res/layout/text_large.xml
diff --git a/tests/HwAccelerationTest/res/layout/text_medium.xml b/tests/graphics/HwAccelerationTest/res/layout/text_medium.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/text_medium.xml
rename to tests/graphics/HwAccelerationTest/res/layout/text_medium.xml
diff --git a/tests/HwAccelerationTest/res/layout/text_small.xml b/tests/graphics/HwAccelerationTest/res/layout/text_small.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/text_small.xml
rename to tests/graphics/HwAccelerationTest/res/layout/text_small.xml
diff --git a/tests/HwAccelerationTest/res/layout/transforms_and_animations.xml b/tests/graphics/HwAccelerationTest/res/layout/transforms_and_animations.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/transforms_and_animations.xml
rename to tests/graphics/HwAccelerationTest/res/layout/transforms_and_animations.xml
diff --git a/tests/HwAccelerationTest/res/layout/view_layer_invalidation.xml b/tests/graphics/HwAccelerationTest/res/layout/view_layer_invalidation.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/view_layer_invalidation.xml
rename to tests/graphics/HwAccelerationTest/res/layout/view_layer_invalidation.xml
diff --git a/tests/HwAccelerationTest/res/layout/view_layers.xml b/tests/graphics/HwAccelerationTest/res/layout/view_layers.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/view_layers.xml
rename to tests/graphics/HwAccelerationTest/res/layout/view_layers.xml
diff --git a/tests/HwAccelerationTest/res/layout/view_layers_3.xml b/tests/graphics/HwAccelerationTest/res/layout/view_layers_3.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/view_layers_3.xml
rename to tests/graphics/HwAccelerationTest/res/layout/view_layers_3.xml
diff --git a/tests/HwAccelerationTest/res/layout/view_layers_4.xml b/tests/graphics/HwAccelerationTest/res/layout/view_layers_4.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/view_layers_4.xml
rename to tests/graphics/HwAccelerationTest/res/layout/view_layers_4.xml
diff --git a/tests/HwAccelerationTest/res/layout/view_layers_5.xml b/tests/graphics/HwAccelerationTest/res/layout/view_layers_5.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/view_layers_5.xml
rename to tests/graphics/HwAccelerationTest/res/layout/view_layers_5.xml
diff --git a/tests/HwAccelerationTest/res/layout/view_properties.xml b/tests/graphics/HwAccelerationTest/res/layout/view_properties.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/view_properties.xml
rename to tests/graphics/HwAccelerationTest/res/layout/view_properties.xml
diff --git a/tests/HwAccelerationTest/res/layout/view_runtime_shader.xml b/tests/graphics/HwAccelerationTest/res/layout/view_runtime_shader.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/view_runtime_shader.xml
rename to tests/graphics/HwAccelerationTest/res/layout/view_runtime_shader.xml
diff --git a/tests/HwAccelerationTest/res/layout/widget.xml b/tests/graphics/HwAccelerationTest/res/layout/widget.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/widget.xml
rename to tests/graphics/HwAccelerationTest/res/layout/widget.xml
diff --git a/tests/HwAccelerationTest/res/layout/z_ordering.xml b/tests/graphics/HwAccelerationTest/res/layout/z_ordering.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/layout/z_ordering.xml
rename to tests/graphics/HwAccelerationTest/res/layout/z_ordering.xml
diff --git a/tests/HwAccelerationTest/res/raw/colorgrid_video.mp4 b/tests/graphics/HwAccelerationTest/res/raw/colorgrid_video.mp4
similarity index 100%
rename from tests/HwAccelerationTest/res/raw/colorgrid_video.mp4
rename to tests/graphics/HwAccelerationTest/res/raw/colorgrid_video.mp4
Binary files differ
diff --git a/tests/HwAccelerationTest/res/values/strings.xml b/tests/graphics/HwAccelerationTest/res/values/strings.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/values/strings.xml
rename to tests/graphics/HwAccelerationTest/res/values/strings.xml
diff --git a/tests/HwAccelerationTest/res/values/styles.xml b/tests/graphics/HwAccelerationTest/res/values/styles.xml
similarity index 100%
rename from tests/HwAccelerationTest/res/values/styles.xml
rename to tests/graphics/HwAccelerationTest/res/values/styles.xml
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AdvancedBlendActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AdvancedGradientsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/Alpha8BitmapActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Alpha8BitmapActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/Alpha8BitmapActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Alpha8BitmapActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/AlphaLayersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AlphaLayersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/AlphaLayersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AlphaLayersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/Animated3dActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Animated3dActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/Animated3dActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Animated3dActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/AssetsAtlasActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AssetsAtlasActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/AssetsAtlasActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/AssetsAtlasActivity.java
diff --git a/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BackdropBlurActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BackdropBlurActivity.java
new file mode 100644
index 0000000..8086b29
--- /dev/null
+++ b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BackdropBlurActivity.java
@@ -0,0 +1,119 @@
+/*
+ * 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.test.hwui;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.ColorMatrix;
+import android.graphics.ColorMatrixColorFilter;
+import android.graphics.Outline;
+import android.graphics.RenderEffect;
+import android.graphics.Shader;
+import android.os.Bundle;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
+import android.view.animation.DecelerateInterpolator;
+import android.widget.FrameLayout;
+import android.widget.ScrollView;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class BackdropBlurActivity extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ final ScrollView scrollView = new ScrollView(this);
+ final FrameLayout innerFrame = new FrameLayout(this);
+ final View backgroundView = new View(this);
+ backgroundView.setBackgroundResource(R.drawable.robot_repeated);
+ innerFrame.addView(backgroundView, ViewGroup.LayoutParams.MATCH_PARENT, 10000);
+ scrollView.addView(innerFrame,
+ ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+
+ final FrameLayout contentView = new FrameLayout(this);
+ contentView.addView(scrollView,
+ ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+ contentView.addView(new BackdropBlurView(this), 300, 300);
+ setContentView(contentView);
+ }
+
+ private static class BackdropBlurView extends View {
+ private final float mBlurRadius = 60f;
+ private final float mSaturation = 1.8f;
+
+ private float mDownOffsetX;
+ private float mDownOffsetY;
+
+ BackdropBlurView(Context c) {
+ super(c);
+
+ // init RenderEffect.
+ final RenderEffect blurEffect = RenderEffect.createBlurEffect(
+ mBlurRadius, mBlurRadius,
+ null, Shader.TileMode.MIRROR // TileMode.MIRROR is better for blur.
+ );
+
+ final ColorMatrix colorMatrix = new ColorMatrix();
+ colorMatrix.setSaturation(mSaturation);
+ final RenderEffect effect = RenderEffect.createColorFilterEffect(
+ new ColorMatrixColorFilter(colorMatrix), blurEffect
+ );
+ setBackdropRenderEffect(effect);
+
+ // clip to a round outline.
+ setOutlineProvider(new ViewOutlineProvider() {
+ @Override
+ public void getOutline(View v, Outline outline) {
+ outline.setOval(0, 0, v.getWidth(), v.getHeight());
+ }
+ });
+ setClipToOutline(true);
+
+ animate().setInterpolator(new DecelerateInterpolator(2.0f));
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+
+ canvas.drawColor(0x99F0F0F0);
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ switch (event.getActionMasked()) {
+ case MotionEvent.ACTION_DOWN:
+ mDownOffsetX = event.getRawX() - getTranslationX();
+ mDownOffsetY = event.getRawY() - getTranslationY();
+ animate().scaleX(1.5f).scaleY(1.5f).start();
+ break;
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ animate().scaleX(1f).scaleY(1f).start();
+ break;
+ case MotionEvent.ACTION_MOVE:
+ setTranslationX(event.getRawX() - mDownOffsetX);
+ setTranslationY(event.getRawY() - mDownOffsetY);
+ break;
+ }
+ return true;
+ }
+ }
+}
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BigGradientActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BigGradientActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BigGradientActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BigGradientActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshLayerActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshLayerActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshLayerActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshLayerActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapMutateActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapTransitionView.kt b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapTransitionView.kt
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapTransitionView.kt
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapTransitionView.kt
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/Bitmaps3dActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Bitmaps3dActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/Bitmaps3dActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Bitmaps3dActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsAlphaActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsAlphaActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsAlphaActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsAlphaActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsRectActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsRectActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsRectActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsRectActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsSkewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsSkewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BitmapsSkewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BitmapsSkewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BlurActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BlurActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/BlurActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/BlurActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/CanvasTextureViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/CanvasTextureViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/CanvasTextureViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/CanvasTextureViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ClearActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClearActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ClearActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClearActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ClipOutlineActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipOutlineActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ClipOutlineActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipOutlineActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegion2Activity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipRegion2Activity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegion2Activity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipRegion2Activity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegion3Activity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipRegion3Activity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegion3Activity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipRegion3Activity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegionActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipRegionActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ClipRegionActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ClipRegionActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ColorBitmapActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColorBitmapActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ColorBitmapActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColorBitmapActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersMutateActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersMutateActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersMutateActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColorFiltersMutateActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ColoredRectsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColoredRectsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ColoredRectsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColoredRectsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ColoredShadowsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColoredShadowsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ColoredShadowsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ColoredShadowsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/CustomRenderer.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/CustomRenderer.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/CustomRenderer.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/CustomRenderer.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/DatePickerActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DatePickerActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/DatePickerActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DatePickerActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/DisplayListLayersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DisplayListLayersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/DisplayListLayersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DisplayListLayersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/DrawIntoHwBitmapActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DrawIntoHwBitmapActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/DrawIntoHwBitmapActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/DrawIntoHwBitmapActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/EdgeEffectStretchActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/EdgeEffectStretchActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/EdgeEffectStretchActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/EdgeEffectStretchActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/FramebufferBlendActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/FramebufferBlendActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/FramebufferBlendActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/FramebufferBlendActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/FrontBufferedLayer.kt b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/FrontBufferedLayer.kt
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/FrontBufferedLayer.kt
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/FrontBufferedLayer.kt
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GLDepthTestActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GLDepthTestActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/GLDepthTestActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GLDepthTestActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GLTextureViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GetBitmapActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GetBitmapActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/GetBitmapActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GetBitmapActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GetBitmapSurfaceViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GetBitmapSurfaceViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/GetBitmapSurfaceViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GetBitmapSurfaceViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GlyphCacheActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GlyphCacheActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/GlyphCacheActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GlyphCacheActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GradientStopsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/GradientsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/HardwareBufferRendererActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HardwareBufferRendererActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/HardwareBufferRendererActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HardwareBufferRendererActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasSurfaceViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasSurfaceViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasSurfaceViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasSurfaceViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasTextureViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasTextureViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasTextureViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HardwareCanvasTextureViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/HwTests.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HwTests.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/HwTests.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/HwTests.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/LabelsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LabelsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/LabelsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LabelsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/LayersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LayersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/LayersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LayersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/Lines2Activity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Lines2Activity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/Lines2Activity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Lines2Activity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/LinesActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LinesActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/LinesActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LinesActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/LooperAcceleration.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LooperAcceleration.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/LooperAcceleration.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/LooperAcceleration.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MarqueeActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MarqueeActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MarqueeActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MarqueeActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MatrixActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MatrixActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MatrixActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MatrixActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MaxBitmapSizeActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MaxBitmapSizeActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MaxBitmapSizeActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MaxBitmapSizeActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MeshActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MeshLargeActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MipMapActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MipMapActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MipMapActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MipMapActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MoreNinePatchesActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MoreNinePatchesActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MoreNinePatchesActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MoreNinePatchesActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MoreShadersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MovingSurfaceViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MovingSurfaceViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MovingSurfaceViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MovingSurfaceViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MultiLayersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MultiLayersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MultiLayersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MultiLayersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MultiProducerActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MultiProducerActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MultiProducerActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MultiProducerActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/MyLittleTextureView.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MyLittleTextureView.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/MyLittleTextureView.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/MyLittleTextureView.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/NewLayersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/NewLayersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/NewLayersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/NewLayersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/NinePatchesActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/NinePatchesActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/NinePatchesActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/NinePatchesActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/NoAATextActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/NoAATextActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/NoAATextActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/NoAATextActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/OpaqueActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/OpaqueActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/OpaqueActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/OpaqueActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PaintDrawFilterActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PaintDrawFilterActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PaintDrawFilterActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PaintDrawFilterActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PathDestructionActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathDestructionActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PathDestructionActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathDestructionActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PathOffsetActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathOffsetActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PathOffsetActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathOffsetActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PathOpsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathOpsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PathOpsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathOpsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PathsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PathsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PathsCacheActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PenStylusActivity.kt b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PenStylusActivity.kt
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PenStylusActivity.kt
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PenStylusActivity.kt
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PictureCaptureDemo.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PictureCaptureDemo.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PictureCaptureDemo.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PictureCaptureDemo.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PixelCopyWindow.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PixelCopyWindow.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PixelCopyWindow.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PixelCopyWindow.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PointsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PointsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PointsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PointsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PosTextActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PosTextActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PosTextActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PosTextActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/PositionListenerActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PositionListenerActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/PositionListenerActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/PositionListenerActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ProjectionActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ProjectionClippingActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/QuickRejectActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/QuickRejectActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/QuickRejectActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/QuickRejectActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/RenderEffectShaderActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RenderEffectShaderActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/RenderEffectShaderActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RenderEffectShaderActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/RenderEffectViewActivity.kt b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RenderEffectViewActivity.kt
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/RenderEffectViewActivity.kt
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RenderEffectViewActivity.kt
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ResizeActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ResizeActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ResizeActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ResizeActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RevealActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/RippleActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RippleActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/RippleActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RippleActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/Rotate3dTextActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Rotate3dTextActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/Rotate3dTextActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Rotate3dTextActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/RotationActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RotationActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/RotationActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/RotationActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ScaledPathsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ScaledPathsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ScaledPathsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ScaledPathsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ScaledTextActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ScrollingStretchSurfaceViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ScrollingStretchSurfaceViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ScrollingStretchSurfaceViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ScrollingStretchSurfaceViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ShadersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ShadersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ShadersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ShadersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ShapesActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/SimplePatchActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SimplePatchActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/SimplePatchActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SimplePatchActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/SimplePathsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SimplePathsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/SimplePathsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SimplePathsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/SingleFrameTextureViewTestActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SingleFrameTextureViewTestActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/SingleFrameTextureViewTestActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SingleFrameTextureViewTestActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SmallCircleActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/StretchShaderActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/StretchShaderActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/StretchShaderActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/StretchShaderActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/StretchySurfaceViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/StretchySurfaceViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/StretchySurfaceViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/StretchySurfaceViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/SurfaceViewAlphaActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SurfaceViewAlphaActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/SurfaceViewAlphaActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/SurfaceViewAlphaActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TJunctionActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TJunctionActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TJunctionActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TJunctionActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextFadeActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextFadeActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TextFadeActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextFadeActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextGammaActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextOnPathActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextPathActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextPathActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TextPathActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextPathActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TextureViewActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextureViewActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TextureViewActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TextureViewActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ThinPatchesActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TimeDialogActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TimeDialogActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TimeDialogActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TimeDialogActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/Transform3dActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Transform3dActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/Transform3dActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/Transform3dActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/VideoViewCaptureActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/VideoViewCaptureActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/VideoViewCaptureActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/VideoViewCaptureActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewFlipperActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewFlipperActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewFlipperActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewFlipperActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity2.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity2.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity2.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity2.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/XfermodeActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/XfermodeActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/XfermodeActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/XfermodeActivity.java
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java b/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java
similarity index 100%
rename from tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java
rename to tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java
diff --git a/tests/graphics/OWNERS b/tests/graphics/OWNERS
new file mode 100644
index 0000000..fb7fc14
--- /dev/null
+++ b/tests/graphics/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 1075130
+
+include /libs/hwui/OWNERS
diff --git a/tests/RenderThreadTest/Android.bp b/tests/graphics/RenderThreadTest/Android.bp
similarity index 100%
rename from tests/RenderThreadTest/Android.bp
rename to tests/graphics/RenderThreadTest/Android.bp
diff --git a/tests/RenderThreadTest/AndroidManifest.xml b/tests/graphics/RenderThreadTest/AndroidManifest.xml
similarity index 100%
rename from tests/RenderThreadTest/AndroidManifest.xml
rename to tests/graphics/RenderThreadTest/AndroidManifest.xml
diff --git a/tests/RenderThreadTest/res/drawable-hdpi/ic_launcher.png b/tests/graphics/RenderThreadTest/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from tests/RenderThreadTest/res/drawable-hdpi/ic_launcher.png
rename to tests/graphics/RenderThreadTest/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/tests/RenderThreadTest/res/drawable-mdpi/ic_launcher.png b/tests/graphics/RenderThreadTest/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from tests/RenderThreadTest/res/drawable-mdpi/ic_launcher.png
rename to tests/graphics/RenderThreadTest/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/tests/RenderThreadTest/res/drawable-xhdpi/ic_launcher.png b/tests/graphics/RenderThreadTest/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from tests/RenderThreadTest/res/drawable-xhdpi/ic_launcher.png
rename to tests/graphics/RenderThreadTest/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/tests/RenderThreadTest/res/drawable-xhdpi/starry_night_bg.jpg b/tests/graphics/RenderThreadTest/res/drawable-xhdpi/starry_night_bg.jpg
similarity index 100%
rename from tests/RenderThreadTest/res/drawable-xhdpi/starry_night_bg.jpg
rename to tests/graphics/RenderThreadTest/res/drawable-xhdpi/starry_night_bg.jpg
Binary files differ
diff --git a/tests/RenderThreadTest/res/layout/activity_main.xml b/tests/graphics/RenderThreadTest/res/layout/activity_main.xml
similarity index 100%
rename from tests/RenderThreadTest/res/layout/activity_main.xml
rename to tests/graphics/RenderThreadTest/res/layout/activity_main.xml
diff --git a/tests/RenderThreadTest/res/layout/activity_sub.xml b/tests/graphics/RenderThreadTest/res/layout/activity_sub.xml
similarity index 100%
rename from tests/RenderThreadTest/res/layout/activity_sub.xml
rename to tests/graphics/RenderThreadTest/res/layout/activity_sub.xml
diff --git a/tests/RenderThreadTest/res/layout/item_layout.xml b/tests/graphics/RenderThreadTest/res/layout/item_layout.xml
similarity index 100%
rename from tests/RenderThreadTest/res/layout/item_layout.xml
rename to tests/graphics/RenderThreadTest/res/layout/item_layout.xml
diff --git a/tests/RenderThreadTest/res/values/strings.xml b/tests/graphics/RenderThreadTest/res/values/strings.xml
similarity index 100%
rename from tests/RenderThreadTest/res/values/strings.xml
rename to tests/graphics/RenderThreadTest/res/values/strings.xml
diff --git a/tests/RenderThreadTest/res/values/styles.xml b/tests/graphics/RenderThreadTest/res/values/styles.xml
similarity index 100%
rename from tests/RenderThreadTest/res/values/styles.xml
rename to tests/graphics/RenderThreadTest/res/values/styles.xml
diff --git a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java b/tests/graphics/RenderThreadTest/src/com/example/renderthread/MainActivity.java
similarity index 100%
rename from tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java
rename to tests/graphics/RenderThreadTest/src/com/example/renderthread/MainActivity.java
diff --git a/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java b/tests/graphics/RenderThreadTest/src/com/example/renderthread/SubActivity.java
similarity index 100%
rename from tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java
rename to tests/graphics/RenderThreadTest/src/com/example/renderthread/SubActivity.java
diff --git a/tests/SilkFX/Android.bp b/tests/graphics/SilkFX/Android.bp
similarity index 100%
rename from tests/SilkFX/Android.bp
rename to tests/graphics/SilkFX/Android.bp
diff --git a/tests/SilkFX/AndroidManifest.xml b/tests/graphics/SilkFX/AndroidManifest.xml
similarity index 100%
rename from tests/SilkFX/AndroidManifest.xml
rename to tests/graphics/SilkFX/AndroidManifest.xml
diff --git a/tests/SilkFX/assets/gainmaps/city_night.jpg b/tests/graphics/SilkFX/assets/gainmaps/city_night.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/city_night.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/city_night.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/desert_palms.jpg b/tests/graphics/SilkFX/assets/gainmaps/desert_palms.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/desert_palms.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/desert_palms.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/desert_sunset.jpg b/tests/graphics/SilkFX/assets/gainmaps/desert_sunset.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/desert_sunset.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/desert_sunset.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/desert_wanda.jpg b/tests/graphics/SilkFX/assets/gainmaps/desert_wanda.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/desert_wanda.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/desert_wanda.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/fountain_night.jpg b/tests/graphics/SilkFX/assets/gainmaps/fountain_night.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/fountain_night.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/fountain_night.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/grand_canyon.jpg b/tests/graphics/SilkFX/assets/gainmaps/grand_canyon.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/grand_canyon.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/grand_canyon.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/lamps.jpg b/tests/graphics/SilkFX/assets/gainmaps/lamps.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/lamps.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/lamps.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/mountain_lake.jpg b/tests/graphics/SilkFX/assets/gainmaps/mountain_lake.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/mountain_lake.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/mountain_lake.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/mountains.jpg b/tests/graphics/SilkFX/assets/gainmaps/mountains.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/mountains.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/mountains.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/sunflower.jpg b/tests/graphics/SilkFX/assets/gainmaps/sunflower.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/sunflower.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/sunflower.jpg
Binary files differ
diff --git a/tests/SilkFX/assets/gainmaps/train_station_night.jpg b/tests/graphics/SilkFX/assets/gainmaps/train_station_night.jpg
similarity index 100%
rename from tests/SilkFX/assets/gainmaps/train_station_night.jpg
rename to tests/graphics/SilkFX/assets/gainmaps/train_station_night.jpg
Binary files differ
diff --git a/tests/SilkFX/res/drawable-hdpi/background1.jpeg b/tests/graphics/SilkFX/res/drawable-hdpi/background1.jpeg
similarity index 100%
rename from tests/SilkFX/res/drawable-hdpi/background1.jpeg
rename to tests/graphics/SilkFX/res/drawable-hdpi/background1.jpeg
Binary files differ
diff --git a/tests/SilkFX/res/drawable-hdpi/background2.jpeg b/tests/graphics/SilkFX/res/drawable-hdpi/background2.jpeg
similarity index 100%
rename from tests/SilkFX/res/drawable-hdpi/background2.jpeg
rename to tests/graphics/SilkFX/res/drawable-hdpi/background2.jpeg
Binary files differ
diff --git a/tests/SilkFX/res/drawable-hdpi/background3.jpeg b/tests/graphics/SilkFX/res/drawable-hdpi/background3.jpeg
similarity index 100%
rename from tests/SilkFX/res/drawable-hdpi/background3.jpeg
rename to tests/graphics/SilkFX/res/drawable-hdpi/background3.jpeg
Binary files differ
diff --git a/tests/SilkFX/res/drawable-hdpi/noise.png b/tests/graphics/SilkFX/res/drawable-hdpi/noise.png
similarity index 100%
rename from tests/SilkFX/res/drawable-hdpi/noise.png
rename to tests/graphics/SilkFX/res/drawable-hdpi/noise.png
Binary files differ
diff --git a/tests/SilkFX/res/drawable-nodpi/blue_sweep_gradient.xml b/tests/graphics/SilkFX/res/drawable-nodpi/blue_sweep_gradient.xml
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/blue_sweep_gradient.xml
rename to tests/graphics/SilkFX/res/drawable-nodpi/blue_sweep_gradient.xml
diff --git a/tests/SilkFX/res/drawable-nodpi/dark_gradient.xml b/tests/graphics/SilkFX/res/drawable-nodpi/dark_gradient.xml
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/dark_gradient.xml
rename to tests/graphics/SilkFX/res/drawable-nodpi/dark_gradient.xml
diff --git a/tests/SilkFX/res/drawable-nodpi/dark_notification.png b/tests/graphics/SilkFX/res/drawable-nodpi/dark_notification.png
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/dark_notification.png
rename to tests/graphics/SilkFX/res/drawable-nodpi/dark_notification.png
Binary files differ
diff --git a/tests/SilkFX/res/drawable-nodpi/green_sweep_gradient.xml b/tests/graphics/SilkFX/res/drawable-nodpi/green_sweep_gradient.xml
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/green_sweep_gradient.xml
rename to tests/graphics/SilkFX/res/drawable-nodpi/green_sweep_gradient.xml
diff --git a/tests/SilkFX/res/drawable-nodpi/grey_sweep_gradient.xml b/tests/graphics/SilkFX/res/drawable-nodpi/grey_sweep_gradient.xml
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/grey_sweep_gradient.xml
rename to tests/graphics/SilkFX/res/drawable-nodpi/grey_sweep_gradient.xml
diff --git a/tests/SilkFX/res/drawable-nodpi/light_gradient.xml b/tests/graphics/SilkFX/res/drawable-nodpi/light_gradient.xml
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/light_gradient.xml
rename to tests/graphics/SilkFX/res/drawable-nodpi/light_gradient.xml
diff --git a/tests/SilkFX/res/drawable-nodpi/light_notification.png b/tests/graphics/SilkFX/res/drawable-nodpi/light_notification.png
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/light_notification.png
rename to tests/graphics/SilkFX/res/drawable-nodpi/light_notification.png
Binary files differ
diff --git a/tests/SilkFX/res/drawable-nodpi/red_sweep_gradient.xml b/tests/graphics/SilkFX/res/drawable-nodpi/red_sweep_gradient.xml
similarity index 100%
rename from tests/SilkFX/res/drawable-nodpi/red_sweep_gradient.xml
rename to tests/graphics/SilkFX/res/drawable-nodpi/red_sweep_gradient.xml
diff --git a/tests/SilkFX/res/drawable/background_blur_drawable.xml b/tests/graphics/SilkFX/res/drawable/background_blur_drawable.xml
similarity index 100%
rename from tests/SilkFX/res/drawable/background_blur_drawable.xml
rename to tests/graphics/SilkFX/res/drawable/background_blur_drawable.xml
diff --git a/tests/SilkFX/res/drawable/blur_activity_background_drawable_white.xml b/tests/graphics/SilkFX/res/drawable/blur_activity_background_drawable_white.xml
similarity index 100%
rename from tests/SilkFX/res/drawable/blur_activity_background_drawable_white.xml
rename to tests/graphics/SilkFX/res/drawable/blur_activity_background_drawable_white.xml
diff --git a/tests/SilkFX/res/layout-television/activity_glass.xml b/tests/graphics/SilkFX/res/layout-television/activity_glass.xml
similarity index 100%
rename from tests/SilkFX/res/layout-television/activity_glass.xml
rename to tests/graphics/SilkFX/res/layout-television/activity_glass.xml
diff --git a/tests/SilkFX/res/layout/activity_background_blur.xml b/tests/graphics/SilkFX/res/layout/activity_background_blur.xml
similarity index 100%
rename from tests/SilkFX/res/layout/activity_background_blur.xml
rename to tests/graphics/SilkFX/res/layout/activity_background_blur.xml
diff --git a/tests/SilkFX/res/layout/activity_glass.xml b/tests/graphics/SilkFX/res/layout/activity_glass.xml
similarity index 100%
rename from tests/SilkFX/res/layout/activity_glass.xml
rename to tests/graphics/SilkFX/res/layout/activity_glass.xml
diff --git a/tests/SilkFX/res/layout/bling_notifications.xml b/tests/graphics/SilkFX/res/layout/bling_notifications.xml
similarity index 100%
rename from tests/SilkFX/res/layout/bling_notifications.xml
rename to tests/graphics/SilkFX/res/layout/bling_notifications.xml
diff --git a/tests/SilkFX/res/layout/color_grid.xml b/tests/graphics/SilkFX/res/layout/color_grid.xml
similarity index 100%
rename from tests/SilkFX/res/layout/color_grid.xml
rename to tests/graphics/SilkFX/res/layout/color_grid.xml
diff --git a/tests/SilkFX/res/layout/color_mode_controls.xml b/tests/graphics/SilkFX/res/layout/color_mode_controls.xml
similarity index 100%
rename from tests/SilkFX/res/layout/color_mode_controls.xml
rename to tests/graphics/SilkFX/res/layout/color_mode_controls.xml
diff --git a/tests/SilkFX/res/layout/common_base.xml b/tests/graphics/SilkFX/res/layout/common_base.xml
similarity index 100%
rename from tests/SilkFX/res/layout/common_base.xml
rename to tests/graphics/SilkFX/res/layout/common_base.xml
diff --git a/tests/SilkFX/res/layout/gainmap_decode_test.xml b/tests/graphics/SilkFX/res/layout/gainmap_decode_test.xml
similarity index 100%
rename from tests/SilkFX/res/layout/gainmap_decode_test.xml
rename to tests/graphics/SilkFX/res/layout/gainmap_decode_test.xml
diff --git a/tests/SilkFX/res/layout/gainmap_image.xml b/tests/graphics/SilkFX/res/layout/gainmap_image.xml
similarity index 100%
rename from tests/SilkFX/res/layout/gainmap_image.xml
rename to tests/graphics/SilkFX/res/layout/gainmap_image.xml
diff --git a/tests/SilkFX/res/layout/gainmap_metadata.xml b/tests/graphics/SilkFX/res/layout/gainmap_metadata.xml
similarity index 100%
rename from tests/SilkFX/res/layout/gainmap_metadata.xml
rename to tests/graphics/SilkFX/res/layout/gainmap_metadata.xml
diff --git a/tests/SilkFX/res/layout/gainmap_transform_test.xml b/tests/graphics/SilkFX/res/layout/gainmap_transform_test.xml
similarity index 100%
rename from tests/SilkFX/res/layout/gainmap_transform_test.xml
rename to tests/graphics/SilkFX/res/layout/gainmap_transform_test.xml
diff --git a/tests/SilkFX/res/layout/gradient_sweep.xml b/tests/graphics/SilkFX/res/layout/gradient_sweep.xml
similarity index 100%
rename from tests/SilkFX/res/layout/gradient_sweep.xml
rename to tests/graphics/SilkFX/res/layout/gradient_sweep.xml
diff --git a/tests/SilkFX/res/layout/hdr_glows.xml b/tests/graphics/SilkFX/res/layout/hdr_glows.xml
similarity index 100%
rename from tests/SilkFX/res/layout/hdr_glows.xml
rename to tests/graphics/SilkFX/res/layout/hdr_glows.xml
diff --git a/tests/SilkFX/res/layout/hdr_image_viewer.xml b/tests/graphics/SilkFX/res/layout/hdr_image_viewer.xml
similarity index 100%
rename from tests/SilkFX/res/layout/hdr_image_viewer.xml
rename to tests/graphics/SilkFX/res/layout/hdr_image_viewer.xml
diff --git a/tests/SilkFX/res/values/style.xml b/tests/graphics/SilkFX/res/values/style.xml
similarity index 100%
rename from tests/SilkFX/res/values/style.xml
rename to tests/graphics/SilkFX/res/values/style.xml
diff --git a/tests/SilkFX/src/com/android/test/silkfx/Main.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/Main.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/Main.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/Main.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/app/BaseDemoActivity.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/app/BaseDemoActivity.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/app/BaseDemoActivity.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/app/BaseDemoActivity.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/app/CommonDemoActivity.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/app/CommonDemoActivity.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/app/CommonDemoActivity.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/app/CommonDemoActivity.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/app/HdrImageViewer.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/app/HdrImageViewer.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/app/HdrImageViewer.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/app/HdrImageViewer.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/app/WindowObserver.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/app/WindowObserver.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/app/WindowObserver.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/app/WindowObserver.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/common/BaseDrawingView.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/common/BaseDrawingView.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/common/BaseDrawingView.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/common/BaseDrawingView.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/common/ColorModeControls.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/common/ColorModeControls.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/common/ColorModeControls.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/common/ColorModeControls.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/common/HDRIndicator.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/common/HDRIndicator.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/common/HDRIndicator.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/common/HDRIndicator.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/BlingyNotification.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/BlingyNotification.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/BlingyNotification.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/BlingyNotification.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/ColorGrid.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/ColorGrid.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/ColorGrid.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/ColorGrid.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapDecodeTest.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapDecodeTest.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapDecodeTest.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapDecodeTest.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapTransformsTest.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapTransformsTest.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapTransformsTest.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GainmapTransformsTest.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GlowActivity.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GlowActivity.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/GlowActivity.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GlowActivity.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GlowingCard.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GlowingCard.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/GlowingCard.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/GlowingCard.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/RadialGlow.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/RadialGlow.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/hdr/RadialGlow.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/hdr/RadialGlow.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/materials/BackgroundBlurActivity.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/materials/BackgroundBlurActivity.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/materials/BackgroundBlurActivity.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/materials/BackgroundBlurActivity.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/materials/GlassActivity.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/materials/GlassActivity.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/materials/GlassActivity.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/materials/GlassActivity.kt
diff --git a/tests/SilkFX/src/com/android/test/silkfx/materials/GlassView.kt b/tests/graphics/SilkFX/src/com/android/test/silkfx/materials/GlassView.kt
similarity index 100%
rename from tests/SilkFX/src/com/android/test/silkfx/materials/GlassView.kt
rename to tests/graphics/SilkFX/src/com/android/test/silkfx/materials/GlassView.kt
diff --git a/tests/VectorDrawableTest/Android.bp b/tests/graphics/VectorDrawableTest/Android.bp
similarity index 100%
rename from tests/VectorDrawableTest/Android.bp
rename to tests/graphics/VectorDrawableTest/Android.bp
diff --git a/tests/VectorDrawableTest/AndroidManifest.xml b/tests/graphics/VectorDrawableTest/AndroidManifest.xml
similarity index 100%
rename from tests/VectorDrawableTest/AndroidManifest.xml
rename to tests/graphics/VectorDrawableTest/AndroidManifest.xml
diff --git a/tests/VectorDrawableTest/OWNERS b/tests/graphics/VectorDrawableTest/OWNERS
similarity index 100%
rename from tests/VectorDrawableTest/OWNERS
rename to tests/graphics/VectorDrawableTest/OWNERS
diff --git a/tests/VectorDrawableTest/res/anim/alpha_animation_progress_bar.xml b/tests/graphics/VectorDrawableTest/res/anim/alpha_animation_progress_bar.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/alpha_animation_progress_bar.xml
rename to tests/graphics/VectorDrawableTest/res/anim/alpha_animation_progress_bar.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_favorite.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_favorite.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_favorite.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_favorite.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_favorite02.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_favorite02.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_favorite02.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_favorite02.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_grouping_1_01.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_grouping_1_01.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_grouping_1_01.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_grouping_1_02.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_grouping_1_02.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_grouping_1_02.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_grouping_1_02.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_scale.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_scale.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_scale.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_scale.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_translate.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_translate.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_translate.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect1_translate.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_scale.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_scale.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_scale.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_scale.xml
diff --git a/tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_translate.xml b/tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_translate.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_translate.xml
rename to tests/graphics/VectorDrawableTest/res/anim/animation_linear_progress_bar_rect2_translate.xml
diff --git a/tests/VectorDrawableTest/res/anim/blink.xml b/tests/graphics/VectorDrawableTest/res/anim/blink.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/blink.xml
rename to tests/graphics/VectorDrawableTest/res/anim/blink.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_hourglass_animation_fill_outlines.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_hourglass_animation_fill_outlines.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_hourglass_animation_fill_outlines.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_hourglass_animation_fill_outlines.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_hourglass_animation_hourglass_frame.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_hourglass_animation_hourglass_frame.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_hourglass_animation_hourglass_frame.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_hourglass_animation_hourglass_frame.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_hourglass_animation_mask_1.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_hourglass_animation_mask_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_hourglass_animation_mask_1.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_hourglass_animation_mask_1.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_arrows_1.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_arrows_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_arrows_1.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_arrows_1.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_1.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_1.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_1.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_2.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_2.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_2.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_rotate_2_portrait_v2_animation_device_2.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_cross_1.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_cross_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_cross_1.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_cross_1.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_ic_signal_airplane.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_ic_signal_airplane.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_ic_signal_airplane.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_ic_signal_airplane.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_mask_2.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_mask_2.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_mask_2.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_mask_2.xml
diff --git a/tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_path_1_1.xml b/tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_path_1_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_path_1_1.xml
rename to tests/graphics/VectorDrawableTest/res/anim/ic_signal_airplane_v2_animation_path_1_1.xml
diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation01.xml b/tests/graphics/VectorDrawableTest/res/anim/trim_path_animation01.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/trim_path_animation01.xml
rename to tests/graphics/VectorDrawableTest/res/anim/trim_path_animation01.xml
diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation02.xml b/tests/graphics/VectorDrawableTest/res/anim/trim_path_animation02.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/trim_path_animation02.xml
rename to tests/graphics/VectorDrawableTest/res/anim/trim_path_animation02.xml
diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation03.xml b/tests/graphics/VectorDrawableTest/res/anim/trim_path_animation03.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/trim_path_animation03.xml
rename to tests/graphics/VectorDrawableTest/res/anim/trim_path_animation03.xml
diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation04.xml b/tests/graphics/VectorDrawableTest/res/anim/trim_path_animation04.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/trim_path_animation04.xml
rename to tests/graphics/VectorDrawableTest/res/anim/trim_path_animation04.xml
diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation05.xml b/tests/graphics/VectorDrawableTest/res/anim/trim_path_animation05.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/trim_path_animation05.xml
rename to tests/graphics/VectorDrawableTest/res/anim/trim_path_animation05.xml
diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation06.xml b/tests/graphics/VectorDrawableTest/res/anim/trim_path_animation06.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/trim_path_animation06.xml
rename to tests/graphics/VectorDrawableTest/res/anim/trim_path_animation06.xml
diff --git a/tests/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml b/tests/graphics/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml
rename to tests/graphics/VectorDrawableTest/res/anim/trim_path_animation_progress_bar.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_linear.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_linear.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_linear_clamp.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_clamp.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_linear_clamp.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_clamp.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_linear_item.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_linear_item.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap_mirror.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap_mirror.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap_mirror.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item_overlap_mirror.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_linear_item_repeat.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item_repeat.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_linear_item_repeat.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_linear_item_repeat.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_radial.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_radial.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_radial_clamp.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_clamp.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_radial_clamp.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_clamp.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_radial_item.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_radial_item.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_radial_item_repeat.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item_repeat.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_radial_item_repeat.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item_repeat.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_radial_item_short.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item_short.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_radial_item_short.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item_short.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_radial_item_short_mirror.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item_short_mirror.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_radial_item_short_mirror.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_radial_item_short_mirror.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_sweep.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_sweep.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_sweep_clamp.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_clamp.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_sweep_clamp.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_clamp.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_sweep_item.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_sweep_item.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_sweep_item_long.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item_long.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_sweep_item_long.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item_long.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_sweep_item_long_mirror.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item_long_mirror.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_sweep_item_long_mirror.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item_long_mirror.xml
diff --git a/tests/VectorDrawableTest/res/color/fill_gradient_sweep_item_repeat.xml b/tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item_repeat.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/fill_gradient_sweep_item_repeat.xml
rename to tests/graphics/VectorDrawableTest/res/color/fill_gradient_sweep_item_repeat.xml
diff --git a/tests/VectorDrawableTest/res/color/stroke_gradient.xml b/tests/graphics/VectorDrawableTest/res/color/stroke_gradient.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/stroke_gradient.xml
rename to tests/graphics/VectorDrawableTest/res/color/stroke_gradient.xml
diff --git a/tests/VectorDrawableTest/res/color/stroke_gradient_clamp.xml b/tests/graphics/VectorDrawableTest/res/color/stroke_gradient_clamp.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/stroke_gradient_clamp.xml
rename to tests/graphics/VectorDrawableTest/res/color/stroke_gradient_clamp.xml
diff --git a/tests/VectorDrawableTest/res/color/stroke_gradient_item.xml b/tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/stroke_gradient_item.xml
rename to tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item.xml
diff --git a/tests/VectorDrawableTest/res/color/stroke_gradient_item_alpha.xml b/tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item_alpha.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/stroke_gradient_item_alpha.xml
rename to tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item_alpha.xml
diff --git a/tests/VectorDrawableTest/res/color/stroke_gradient_item_alpha_mirror.xml b/tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item_alpha_mirror.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/stroke_gradient_item_alpha_mirror.xml
rename to tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item_alpha_mirror.xml
diff --git a/tests/VectorDrawableTest/res/color/stroke_gradient_item_repeat.xml b/tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item_repeat.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/stroke_gradient_item_repeat.xml
rename to tests/graphics/VectorDrawableTest/res/color/stroke_gradient_item_repeat.xml
diff --git a/tests/VectorDrawableTest/res/color/vector_icon_fill_state_list.xml b/tests/graphics/VectorDrawableTest/res/color/vector_icon_fill_state_list.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/vector_icon_fill_state_list.xml
rename to tests/graphics/VectorDrawableTest/res/color/vector_icon_fill_state_list.xml
diff --git a/tests/VectorDrawableTest/res/color/vector_icon_fill_state_list_simple.xml b/tests/graphics/VectorDrawableTest/res/color/vector_icon_fill_state_list_simple.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/vector_icon_fill_state_list_simple.xml
rename to tests/graphics/VectorDrawableTest/res/color/vector_icon_fill_state_list_simple.xml
diff --git a/tests/VectorDrawableTest/res/color/vector_icon_stroke_state_list.xml b/tests/graphics/VectorDrawableTest/res/color/vector_icon_stroke_state_list.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/vector_icon_stroke_state_list.xml
rename to tests/graphics/VectorDrawableTest/res/color/vector_icon_stroke_state_list.xml
diff --git a/tests/VectorDrawableTest/res/color/vector_icon_stroke_state_list_simple.xml b/tests/graphics/VectorDrawableTest/res/color/vector_icon_stroke_state_list_simple.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/color/vector_icon_stroke_state_list_simple.xml
rename to tests/graphics/VectorDrawableTest/res/color/vector_icon_stroke_state_list_simple.xml
diff --git a/tests/VectorDrawableTest/res/drawable-hdpi/icon.png b/tests/graphics/VectorDrawableTest/res/drawable-hdpi/icon.png
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable-hdpi/icon.png
rename to tests/graphics/VectorDrawableTest/res/drawable-hdpi/icon.png
Binary files differ
diff --git a/tests/VectorDrawableTest/res/drawable-nodpi/bitmap_drawable01.jpg b/tests/graphics/VectorDrawableTest/res/drawable-nodpi/bitmap_drawable01.jpg
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable-nodpi/bitmap_drawable01.jpg
rename to tests/graphics/VectorDrawableTest/res/drawable-nodpi/bitmap_drawable01.jpg
Binary files differ
diff --git a/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon.xml b/tests/graphics/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon.xml
diff --git a/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon_animated.xml b/tests/graphics/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon_animated.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon_animated.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon_animated.xml
diff --git a/tests/VectorDrawableTest/res/drawable/animation_drawable_vector.xml b/tests/graphics/VectorDrawableTest/res/drawable/animation_drawable_vector.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animation_drawable_vector.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animation_drawable_vector.xml
diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml b/tests/graphics/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animation_vector_drawable01.xml
diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml b/tests/graphics/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animation_vector_drawable_favorite.xml
diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml b/tests/graphics/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animation_vector_drawable_grouping_1.xml
diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_linear_progress_bar.xml b/tests/graphics/VectorDrawableTest/res/drawable/animation_vector_linear_progress_bar.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animation_vector_linear_progress_bar.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animation_vector_linear_progress_bar.xml
diff --git a/tests/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml b/tests/graphics/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/animation_vector_progress_bar.xml
diff --git a/tests/VectorDrawableTest/res/drawable/btn_radio_on_to_off_bundle.xml b/tests/graphics/VectorDrawableTest/res/drawable/btn_radio_on_to_off_bundle.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/btn_radio_on_to_off_bundle.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/btn_radio_on_to_off_bundle.xml
diff --git a/tests/VectorDrawableTest/res/drawable/ic_hourglass.xml b/tests/graphics/VectorDrawableTest/res/drawable/ic_hourglass.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/ic_hourglass.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/ic_hourglass.xml
diff --git a/tests/VectorDrawableTest/res/drawable/ic_hourglass_animation.xml b/tests/graphics/VectorDrawableTest/res/drawable/ic_hourglass_animation.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/ic_hourglass_animation.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/ic_hourglass_animation.xml
diff --git a/tests/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2.xml b/tests/graphics/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2.xml
diff --git a/tests/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2_animation.xml b/tests/graphics/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2_animation.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2_animation.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/ic_rotate_2_portrait_v2_animation.xml
diff --git a/tests/VectorDrawableTest/res/drawable/ic_signal_airplane_v2.xml b/tests/graphics/VectorDrawableTest/res/drawable/ic_signal_airplane_v2.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/ic_signal_airplane_v2.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/ic_signal_airplane_v2.xml
diff --git a/tests/VectorDrawableTest/res/drawable/ic_signal_airplane_v2_animation.xml b/tests/graphics/VectorDrawableTest/res/drawable/ic_signal_airplane_v2_animation.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/ic_signal_airplane_v2_animation.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/ic_signal_airplane_v2_animation.xml
diff --git a/tests/VectorDrawableTest/res/drawable/icon.png b/tests/graphics/VectorDrawableTest/res/drawable/icon.png
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/icon.png
rename to tests/graphics/VectorDrawableTest/res/drawable/icon.png
Binary files differ
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_drawable04.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_drawable04.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_drawable04.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_drawable04.xml
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_drawable04_false.xml
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable01.xml
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable01_false.xml
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable02.xml
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable02_false.xml
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable03.xml
diff --git a/tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03_false.xml b/tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable03_false.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/state_animation_vector_drawable03_false.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/state_animation_vector_drawable03_false.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable01.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable01.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable01.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable01.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable02.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable02.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable02.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable02.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable03.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable03.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable03.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable03.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable04.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable04.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable04.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable04.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable05.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable05.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable05.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable05.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable06.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable06.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable06.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable06.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable07.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable07.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable07.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable07.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable08.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable08.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable08.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable08.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable09.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable09.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable09.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable09.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable10.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable10.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable10.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable10.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable11.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable11.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable11.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable11.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable12.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable12.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable12.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable12.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable13.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable13.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable13.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable13.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable14.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable14.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable14.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable14.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable15.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable15.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable15.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable15.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable16.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable16.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable16.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable16.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable17.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable17.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable17.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable17.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable18.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable18.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable18.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable18.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable19.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable19.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable19.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable19.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable20.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable20.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable20.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable20.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable21.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable21.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable21.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable21.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable22.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable22.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable22.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable22.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable23.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable23.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable23.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable23.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable24.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable24.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable24.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable24.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable25.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable25.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable25.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable25.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable26.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable26.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable26.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable26.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable27.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable27.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable27.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable27.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable28.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable28.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable28.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable28.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable29.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable29.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable29.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable29.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable30.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable30.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable30.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable30.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_favorite.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_group_clip.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_group_clip.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_group_clip.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_group_clip.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_grouping_1.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_linear_progress_bar.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_linear_progress_bar.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_linear_progress_bar.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_linear_progress_bar.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_progress_bar.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_scale0.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale0.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_scale0.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale0.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_scale1.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_scale1.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale1.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_scale2.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale2.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_scale2.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale2.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_drawable_scale3.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale3.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_drawable_scale3.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_drawable_scale3.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_create.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_create.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_create.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_create.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_delete.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_delete.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_delete.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_delete.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_filltype_evenodd.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_filltype_evenodd.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_filltype_evenodd.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_filltype_evenodd.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_filltype_nonzero.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_filltype_nonzero.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_filltype_nonzero.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_filltype_nonzero.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_gradient_1.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_1.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_gradient_1.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_1.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_gradient_1_clamp.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_1_clamp.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_gradient_1_clamp.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_1_clamp.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_gradient_2.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_2.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_gradient_2.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_2.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_gradient_2_repeat.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_2_repeat.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_gradient_2_repeat.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_2_repeat.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_gradient_3.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_3.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_gradient_3.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_3.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_gradient_3_mirror.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_3_mirror.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_gradient_3_mirror.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_gradient_3_mirror.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_heart.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_heart.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_heart.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_heart.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_schedule.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_schedule.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_schedule.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_schedule.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_settings.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_settings.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_settings.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_settings.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_state_list_simple.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_state_list_simple.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_state_list_simple.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_state_list_simple.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_icon_state_list_theme.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_icon_state_list_theme.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_icon_state_list_theme.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_icon_state_list_theme.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_test01.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_test01.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_test01.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_test01.xml
diff --git a/tests/VectorDrawableTest/res/drawable/vector_test02.xml b/tests/graphics/VectorDrawableTest/res/drawable/vector_test02.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/drawable/vector_test02.xml
rename to tests/graphics/VectorDrawableTest/res/drawable/vector_test02.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/btn_radio_to_off_mtrl_animation_interpolator_0.xml b/tests/graphics/VectorDrawableTest/res/interpolator/btn_radio_to_off_mtrl_animation_interpolator_0.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/btn_radio_to_off_mtrl_animation_interpolator_0.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/btn_radio_to_off_mtrl_animation_interpolator_0.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/custom_path_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/custom_path_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/custom_path_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml b/tests/graphics/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/custom_path_interpolator_favorite.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml b/tests/graphics/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/custom_path_interpolator_grouping_1_01.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_rotation_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_rotation_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_rotation_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_rotation_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_scalex_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_scalex_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_scalex_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_arrows_1_scalex_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_1_rotation_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_1_rotation_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_1_rotation_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_1_rotation_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_2_pathdata_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_2_pathdata_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_2_pathdata_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/ic_rotate_2_portrait_v2_device_2_pathdata_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/ic_signal_airplane_v2_path_1_1_pathdata_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/ic_signal_airplane_v2_path_1_1_pathdata_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/ic_signal_airplane_v2_path_1_1_pathdata_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/ic_signal_airplane_v2_path_1_1_pathdata_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/trim_end_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml b/tests/graphics/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml
rename to tests/graphics/VectorDrawableTest/res/interpolator/trim_start_interpolator.xml
diff --git a/tests/VectorDrawableTest/res/layout/activity_animated_vector_drawable_attr.xml b/tests/graphics/VectorDrawableTest/res/layout/activity_animated_vector_drawable_attr.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/layout/activity_animated_vector_drawable_attr.xml
rename to tests/graphics/VectorDrawableTest/res/layout/activity_animated_vector_drawable_attr.xml
diff --git a/tests/VectorDrawableTest/res/values/attrs.xml b/tests/graphics/VectorDrawableTest/res/values/attrs.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/values/attrs.xml
rename to tests/graphics/VectorDrawableTest/res/values/attrs.xml
diff --git a/tests/VectorDrawableTest/res/values/colors.xml b/tests/graphics/VectorDrawableTest/res/values/colors.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/values/colors.xml
rename to tests/graphics/VectorDrawableTest/res/values/colors.xml
diff --git a/tests/VectorDrawableTest/res/values/strings.xml b/tests/graphics/VectorDrawableTest/res/values/strings.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/values/strings.xml
rename to tests/graphics/VectorDrawableTest/res/values/strings.xml
diff --git a/tests/VectorDrawableTest/res/values/styles.xml b/tests/graphics/VectorDrawableTest/res/values/styles.xml
similarity index 100%
rename from tests/VectorDrawableTest/res/values/styles.xml
rename to tests/graphics/VectorDrawableTest/res/values/styles.xml
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedStateVectorDrawableTest.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableDupPerf.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableDupPerf.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableDupPerf.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableDupPerf.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableTest.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/BitmapDrawableDupe.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/BitmapDrawableDupe.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/BitmapDrawableDupe.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/BitmapDrawableDupe.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/BoundsCheckTest.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/BoundsCheckTest.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/BoundsCheckTest.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/BoundsCheckTest.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/ScaleDrawableTests.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorCheckbox.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorCheckbox.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorCheckbox.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorCheckbox.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawable01.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableAnimation.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableAnimation.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableAnimation.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableAnimation.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableDupPerf.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableDupPerf.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableDupPerf.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableDupPerf.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawablePerformance.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableStaticPerf.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableStaticPerf.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableStaticPerf.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableStaticPerf.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableTest.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableTest.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableTest.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorDrawableTest.java
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/VectorPathChecking.java b/tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorPathChecking.java
similarity index 100%
rename from tests/VectorDrawableTest/src/com/android/test/dynamic/VectorPathChecking.java
rename to tests/graphics/VectorDrawableTest/src/com/android/test/dynamic/VectorPathChecking.java
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index 1fb5cc0..cf4dd79 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -388,7 +388,7 @@
// Build up the rules for degrading newer attributes to older ones.
// NOTE(adamlesinski): These rules are hardcoded right now, but they should be
// generated from the attribute definitions themselves (b/62028956).
- if (const SymbolTable::Symbol* s = symm->FindById(R::attr::paddingHorizontal)) {
+ if (symm->FindById(R::attr::paddingHorizontal)) {
std::vector<ReplacementAttr> replacements{
{"paddingLeft", R::attr::paddingLeft, Attribute(android::ResTable_map::TYPE_DIMENSION)},
{"paddingRight", R::attr::paddingRight, Attribute(android::ResTable_map::TYPE_DIMENSION)},
@@ -397,7 +397,7 @@
util::make_unique<DegradeToManyRule>(std::move(replacements));
}
- if (const SymbolTable::Symbol* s = symm->FindById(R::attr::paddingVertical)) {
+ if (symm->FindById(R::attr::paddingVertical)) {
std::vector<ReplacementAttr> replacements{
{"paddingTop", R::attr::paddingTop, Attribute(android::ResTable_map::TYPE_DIMENSION)},
{"paddingBottom", R::attr::paddingBottom, Attribute(android::ResTable_map::TYPE_DIMENSION)},
@@ -406,7 +406,7 @@
util::make_unique<DegradeToManyRule>(std::move(replacements));
}
- if (const SymbolTable::Symbol* s = symm->FindById(R::attr::layout_marginHorizontal)) {
+ if (symm->FindById(R::attr::layout_marginHorizontal)) {
std::vector<ReplacementAttr> replacements{
{"layout_marginLeft", R::attr::layout_marginLeft,
Attribute(android::ResTable_map::TYPE_DIMENSION)},
@@ -417,7 +417,7 @@
util::make_unique<DegradeToManyRule>(std::move(replacements));
}
- if (const SymbolTable::Symbol* s = symm->FindById(R::attr::layout_marginVertical)) {
+ if (symm->FindById(R::attr::layout_marginVertical)) {
std::vector<ReplacementAttr> replacements{
{"layout_marginTop", R::attr::layout_marginTop,
Attribute(android::ResTable_map::TYPE_DIMENSION)},
diff --git a/tools/aapt2/link/ManifestFixer.cpp b/tools/aapt2/link/ManifestFixer.cpp
index c4f6e70..0b16e2c 100644
--- a/tools/aapt2/link/ManifestFixer.cpp
+++ b/tools/aapt2/link/ManifestFixer.cpp
@@ -338,7 +338,7 @@
}
bool has_gl_es_version = false;
- if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "glEsVersion")) {
+ if (el->FindAttribute(xml::kSchemaAndroid, "glEsVersion")) {
if (has_name) {
diag->Error(android::DiagMessage(el->line_number)
<< "cannot define both android:name and android:glEsVersion in <uses-feature>");