Merge "Make hardware buttons just wake up device"
diff --git a/Android.bp b/Android.bp
index 9493733..598f4fc 100644
--- a/Android.bp
+++ b/Android.bp
@@ -604,8 +604,9 @@
],
required: [
"framework-platform-compat-config",
- // TODO: remove gps_debug and protolog.conf.json when the build system propagates "required" properly.
+ // TODO: remove gps_debug, cec_config.xml and protolog.conf.json when the build system propagates "required" properly.
"gps_debug.conf",
+ "cec_config.xml",
"icu4j-platform-compat-config",
"libcore-platform-compat-config",
"protolog.conf.json.gz",
@@ -1334,8 +1335,6 @@
sdk_version: "module_current",
min_sdk_version: "30",
srcs: [
- "core/java/android/content/pm/BaseParceledListSlice.java",
- "core/java/android/content/pm/ParceledListSlice.java",
"core/java/android/os/HandlerExecutor.java",
"core/java/com/android/internal/util/AsyncChannel.java",
"core/java/com/android/internal/util/AsyncService.java",
@@ -1354,12 +1353,6 @@
],
}
-filegroup {
- name: "framework-wifi-util-lib-aidls",
- srcs: ["core/java/android/content/pm/ParceledListSlice.aidl"],
- path: "core/java",
-}
-
// utility classes statically linked into wifi-service
filegroup {
name: "framework-wifi-service-shared-srcs",
diff --git a/ApiDocs.bp b/ApiDocs.bp
index 7ed7ec5..3d6bdbf 100644
--- a/ApiDocs.bp
+++ b/ApiDocs.bp
@@ -67,7 +67,7 @@
":opt-net-voip-srcs",
":art.module.public.api{.public.stubs.source}",
":conscrypt.module.public.api{.public.stubs.source}",
- ":android_icu4j_public_api_files",
+ ":i18n.module.public.api{.public.stubs.source}",
"test-mock/src/**/*.java",
"test-runner/src/**/*.java",
],
diff --git a/BATTERY_STATS_OWNERS b/BATTERY_STATS_OWNERS
new file mode 100644
index 0000000..7728975
--- /dev/null
+++ b/BATTERY_STATS_OWNERS
@@ -0,0 +1,4 @@
+# OWNERS of BatteryStats related files
+bookatz@google.com
+dplotnikov@google.com
+mwachens@google.com
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..4160122
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,31 @@
+# This top-level list should remain narrowly defined as team leads; individual
+# teams are strongly encouraged to define narrower OWNERS files at deeper
+# levels within the source tree; see OWNERS.md for more details
+akulian@google.com
+dsandler@android.com
+dsandler@google.com
+hackbod@android.com
+hackbod@google.com
+jjaggi@google.com
+jsharkey@android.com
+jsharkey@google.com
+michaelwr@google.com
+nandana@google.com
+narayan@google.com
+ogunwale@google.com
+roosa@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
+yamasani@google.com
+
+# API changes are already covered by API-Review+1 (http://mdb/android-api-council)
+# via https://android.git.corp.google.com/All-Projects/+/refs/meta/config/rules.pl.
+per-file */api/*current.txt = *
+
+# Support bulk translation updates
+per-file */res*/values*/*.xml = byi@google.com, delphij@google.com
+
+per-file Android.bp = file:platform/build/soong:/OWNERS
+per-file Android.mk = file:platform/build/soong:/OWNERS
+per-file ApiDocs.bp = file:platform/build/soong:/OWNERS
+per-file StubLibraries.bp = file:platform/build/soong:/OWNERS
diff --git a/OWNERS.md b/OWNERS.md
new file mode 100644
index 0000000..601b5c64
--- /dev/null
+++ b/OWNERS.md
@@ -0,0 +1,68 @@
+# Background
+
+As general background, `OWNERS` files expedite code reviews by helping code
+authors quickly find relevant reviewers, and they also ensure that stakeholders
+are involved in code changes in their areas.
+
+The structure of `frameworks/base/` is unique among Android repositories, and
+it's evolved into a complex interleaved structure over the years. Because of
+this structure, the best place to authoritatively define `OWNERS` can vary
+wildly, but here are some common patterns:
+
+* `core/java/` contains source that is included in the base classpath, and as
+such it's where most APIs are defined:
+ * `core/java/android/app/`
+ * `core/java/android/content/`
+* `services/core/` contains most system services, and these directories
+typically have more granularity than `core/java/`, since they can be refactored
+without API changes:
+ * `services/core/java/com/android/server/net/`
+ * `services/core/java/com/android/server/wm/`
+* `services/` contains several system services that have been isolated from the
+main `services/core/` project:
+ * `services/appwidget/`
+ * `services/midi/`
+* `apex/` contains Mainline modules:
+ * `apex/jobscheduler/`
+ * `apex/permission/`
+* Finally, some teams may have dedicated top-level directories:
+ * `media/`
+ * `wifi/`
+
+# Design
+
+Area maintainers are strongly encouraged to list people in a single
+authoritative `OWNERS` file in **exactly one** location. Then, other paths
+should reference that single authoritative `OWNERS` file using an include
+directive. This approach ensures that updates are applied consistently across
+the tree, reducing maintenance burden.
+
+# Examples
+
+The exact syntax of `OWNERS` files can be difficult to get correct, so here are
+some common examples:
+
+```
+# Complete include of top-level owners from this repo
+include /ZYGOTE_OWNERS
+# Partial include of top-level owners from this repo
+per-file ZygoteFile.java = file:/ZYGOTE_OWNERS
+```
+```
+# Complete include of subdirectory owners from this repo
+include /services/core/java/com/android/server/net/OWNERS
+# Partial include of subdirectory owners from this repo
+per-file NetworkFile.java = file:/services/core/java/com/android/server/net/OWNERS
+```
+```
+# Complete include of top-level owners from another repo
+include platform/libcore:/OWNERS
+# Partial include of top-level owners from another repo
+per-file LibcoreFile.java = file:platform/libcore:/OWNERS
+```
+```
+# Complete include of subdirectory owners from another repo
+include platform/frameworks/av:/camera/OWNERS
+# Partial include of subdirectory owners from another repo
+per-file CameraFile.java = file:platform/frameworks/av:/camera/OWNERS
+```
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 380839e..12ee889 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -48,7 +48,6 @@
":opt-telephony-srcs",
":opt-net-voip-srcs",
":art.module.public.api{.public.stubs.source}",
- ":android_icu4j_public_api_files",
"**/package.html",
],
sdk_version: "core_platform",
@@ -251,6 +250,7 @@
"framework-statsd.stubs",
"framework-tethering.stubs",
"framework-wifi.stubs",
+ "i18n.module.public.api.stubs",
"private-stub-annotations-jar",
],
defaults: ["android_defaults_stubs_current"],
@@ -270,6 +270,7 @@
"framework-statsd.stubs.system",
"framework-tethering.stubs.system",
"framework-wifi.stubs.system",
+ "i18n.module.public.api.stubs",
"private-stub-annotations-jar",
],
defaults: [
@@ -305,6 +306,7 @@
"framework-statsd.stubs.system",
"framework-tethering.stubs.system",
"framework-wifi.stubs.system",
+ "i18n.module.public.api.stubs",
"private-stub-annotations-jar",
],
defaults: [
diff --git a/ZYGOTE_OWNERS b/ZYGOTE_OWNERS
new file mode 100644
index 0000000..90a185b
--- /dev/null
+++ b/ZYGOTE_OWNERS
@@ -0,0 +1,5 @@
+calin@google.com
+chriswailes@google.com
+maco@google.com
+narayan@google.com
+ngeoffray@google.com
diff --git a/apct-tests/perftests/OWNERS b/apct-tests/perftests/OWNERS
new file mode 100644
index 0000000..a060ad9
--- /dev/null
+++ b/apct-tests/perftests/OWNERS
@@ -0,0 +1,2 @@
+timmurray@google.com
+philipcuadra@google.com
diff --git a/apct-tests/perftests/autofill/OWNERS b/apct-tests/perftests/autofill/OWNERS
new file mode 100644
index 0000000..c52751d
--- /dev/null
+++ b/apct-tests/perftests/autofill/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/autofill/OWNERS
diff --git a/apct-tests/perftests/blobstore/Android.bp b/apct-tests/perftests/blobstore/Android.bp
index be5072c..be700a2 100644
--- a/apct-tests/perftests/blobstore/Android.bp
+++ b/apct-tests/perftests/blobstore/Android.bp
@@ -21,6 +21,7 @@
"androidx.annotation_annotation",
"apct-perftests-utils",
"ub-uiautomator",
+ "collector-device-lib-platform",
],
platform_apis: true,
test_suites: ["device-tests"],
diff --git a/apct-tests/perftests/blobstore/AndroidTest.xml b/apct-tests/perftests/blobstore/AndroidTest.xml
index 19456c6..58761d0 100644
--- a/apct-tests/perftests/blobstore/AndroidTest.xml
+++ b/apct-tests/perftests/blobstore/AndroidTest.xml
@@ -24,5 +24,22 @@
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.perftests.blob" />
<option name="hidden-api-checks" value="false"/>
+
+ <!-- TODO: Add PerfettoListener to automatically capture perfetto traces for each test-->
+ <!-- Listener related args for collecting the traces and waiting for the device
+ to stabilize. -->
+ <option name="device-listeners"
+ value="android.device.collectors.ProcLoadListener" />
+ <!-- Guarantee that user defined RunListeners will be running before any of the default
+ listeners defined in this runner. -->
+ <option name="instrumentation-arg" key="newRunListenerMode" value="true" />
+
+ <!-- ProcLoadListener related arguments -->
+ <!-- Wait for device last minute threshold to reach 3 with 2 minute timeout before
+ starting the test run -->
+ <option name="instrumentation-arg" key="procload-collector:per_run" value="true" />
+ <option name="instrumentation-arg" key="proc-loadavg-threshold" value="3" />
+ <option name="instrumentation-arg" key="proc-loadavg-timeout" value="120000" />
+ <option name="instrumentation-arg" key="proc-loadavg-interval" value="10000" />
</test>
</configuration>
\ No newline at end of file
diff --git a/apct-tests/perftests/blobstore/OWNERS b/apct-tests/perftests/blobstore/OWNERS
new file mode 100644
index 0000000..65bb6b8
--- /dev/null
+++ b/apct-tests/perftests/blobstore/OWNERS
@@ -0,0 +1 @@
+include /apex/blobstore/OWNERS
diff --git a/apct-tests/perftests/contentcapture/OWNERS b/apct-tests/perftests/contentcapture/OWNERS
new file mode 100644
index 0000000..a28e00a
--- /dev/null
+++ b/apct-tests/perftests/contentcapture/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/contentcapture/OWNERS
diff --git a/apct-tests/perftests/core/apps/overlay/OWNERS b/apct-tests/perftests/core/apps/overlay/OWNERS
new file mode 100644
index 0000000..afb98d4
--- /dev/null
+++ b/apct-tests/perftests/core/apps/overlay/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/content/om/OWNERS
diff --git a/apct-tests/perftests/core/src/android/accounts/OWNERS b/apct-tests/perftests/core/src/android/accounts/OWNERS
new file mode 100644
index 0000000..df1b4f4
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/accounts/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/accounts/OWNERS
diff --git a/apct-tests/perftests/core/src/android/database/OWNERS b/apct-tests/perftests/core/src/android/database/OWNERS
new file mode 100644
index 0000000..bb9a2ca
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/database/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/database/OWNERS
diff --git a/apct-tests/perftests/inputmethod/OWNERS b/apct-tests/perftests/inputmethod/OWNERS
new file mode 100644
index 0000000..5deb2ce
--- /dev/null
+++ b/apct-tests/perftests/inputmethod/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/inputmethod/OWNERS
diff --git a/apct-tests/perftests/packagemanager/OWNERS b/apct-tests/perftests/packagemanager/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/apct-tests/perftests/packagemanager/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/apct-tests/perftests/textclassifier/OWNERS b/apct-tests/perftests/textclassifier/OWNERS
new file mode 100644
index 0000000..46b3cb8
--- /dev/null
+++ b/apct-tests/perftests/textclassifier/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/textclassifier/OWNERS
diff --git a/apct-tests/perftests/windowmanager/OWNERS b/apct-tests/perftests/windowmanager/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/apct-tests/perftests/windowmanager/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/apex/appsearch/OWNERS b/apex/appsearch/OWNERS
new file mode 100644
index 0000000..ce0c212
--- /dev/null
+++ b/apex/appsearch/OWNERS
@@ -0,0 +1 @@
+sudheersai@google.com
diff --git a/apex/jobscheduler/framework/java/android/app/job/OWNERS b/apex/jobscheduler/framework/java/android/app/job/OWNERS
new file mode 100644
index 0000000..b4a45f5
--- /dev/null
+++ b/apex/jobscheduler/framework/java/android/app/job/OWNERS
@@ -0,0 +1,7 @@
+# Bug component: 330738
+
+yamasani@google.com
+omakoto@google.com
+ctate@android.com
+ctate@google.com
+kwekua@google.com
diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
index 9ea402c..99a9b97 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java
@@ -2044,7 +2044,6 @@
}
maybeRunPendingJobsLocked();
- // Don't remove JOB_EXPIRED in case one came along while processing the queue.
}
}
}
@@ -2110,6 +2109,15 @@
* as many as we can.
*/
private void queueReadyJobsForExecutionLocked() {
+ // This method will check and capture all ready jobs, so we don't need to keep any messages
+ // in the queue.
+ mHandler.removeMessages(MSG_CHECK_JOB_GREEDY);
+ // MSG_CHECK_JOB is a weaker form of _GREEDY. Since we're checking and queueing all ready
+ // jobs, we don't need to keep any MSG_CHECK_JOB messages in the queue.
+ mHandler.removeMessages(MSG_CHECK_JOB);
+ // This method will capture all expired jobs that are ready, so there's no need to keep
+ // the _EXPIRED messages in the queue.
+ mHandler.removeMessages(MSG_JOB_EXPIRED);
if (DEBUG) {
Slog.d(TAG, "queuing all ready jobs for execution:");
}
diff --git a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
index 0b0923a..dd1a0e2 100644
--- a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
+++ b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
@@ -1770,9 +1770,18 @@
final int userId = getSendingUserId();
if (Intent.ACTION_PACKAGE_ADDED.equals(action)
|| Intent.ACTION_PACKAGE_CHANGED.equals(action)) {
- clearCarrierPrivilegedApps();
- // ACTION_PACKAGE_ADDED is called even for system app downgrades.
- evaluateSystemAppException(pkgName, userId);
+ final String[] cmpList = intent.getStringArrayExtra(
+ Intent.EXTRA_CHANGED_COMPONENT_NAME_LIST);
+ // If this is PACKAGE_ADDED (cmpList == null), or if it's a whole-package
+ // enable/disable event (cmpList is just the package name itself), drop
+ // our carrier privileged app & system-app caches and let them refresh
+ if (cmpList == null
+ || (cmpList.length == 1 && pkgName.equals(cmpList[0]))) {
+ clearCarrierPrivilegedApps();
+ evaluateSystemAppException(pkgName, userId);
+ }
+ // component-level enable/disable can affect bucketing, so we always
+ // reevaluate that for any PACKAGE_CHANGED
mHandler.obtainMessage(MSG_CHECK_PACKAGE_IDLE_STATE, userId, -1, pkgName)
.sendToTarget();
}
diff --git a/apex/permission/apex_manifest.json b/apex/permission/apex_manifest.json
index 7960598..6350d54 100644
--- a/apex/permission/apex_manifest.json
+++ b/apex/permission/apex_manifest.json
@@ -1,4 +1,4 @@
{
"name": "com.android.permission",
- "version": 300000000
+ "version": 309999999
}
diff --git a/api/Android.bp b/api/Android.bp
index 5ee41b7..9417030 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -38,6 +38,7 @@
":framework-statsd{.public.api.txt}",
":framework-tethering{.public.api.txt}",
":framework-wifi{.public.api.txt}",
+ ":i18n.module.public.api{.public.api.txt}",
":non-updatable-current.txt",
],
out: ["current.txt"],
@@ -50,7 +51,10 @@
dest: "current.txt",
},
{
- targets: ["sdk", "win_sdk"],
+ targets: [
+ "sdk",
+ "win_sdk",
+ ],
dir: "apistubs/android/public/api",
dest: "android.txt",
},
@@ -72,6 +76,7 @@
":framework-statsd{.public.stubs.source}",
":framework-tethering{.public.stubs.source}",
":framework-wifi{.public.stubs.source}",
+ ":i18n.module.public.api{.public.stubs.source}",
],
out: ["current.srcjar"],
tools: ["merge_zips"],
@@ -92,6 +97,7 @@
":framework-statsd{.public.removed-api.txt}",
":framework-tethering{.public.removed-api.txt}",
":framework-wifi{.public.removed-api.txt}",
+ ":i18n.module.public.api{.public.removed-api.txt}",
":non-updatable-removed.txt",
],
out: ["removed.txt"],
@@ -130,7 +136,10 @@
dest: "system-current.txt",
},
{
- targets: ["sdk", "win_sdk"],
+ targets: [
+ "sdk",
+ "win_sdk",
+ ],
dir: "apistubs/android/system/api",
dest: "android.txt",
},
@@ -189,7 +198,10 @@
dest: "module-lib-current.txt",
},
{
- targets: ["sdk", "win_sdk"],
+ targets: [
+ "sdk",
+ "win_sdk",
+ ],
dir: "apistubs/android/module-lib/api",
dest: "android.txt",
},
diff --git a/api/OWNERS b/api/OWNERS
new file mode 100644
index 0000000..88d0b61
--- /dev/null
+++ b/api/OWNERS
@@ -0,0 +1 @@
+per-file Android.bp = file:platform/build/soong:/OWNERS
diff --git a/cmds/am/OWNERS b/cmds/am/OWNERS
new file mode 100644
index 0000000..72c0a9e
--- /dev/null
+++ b/cmds/am/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/am/OWNERS
diff --git a/cmds/appops/OWNERS b/cmds/appops/OWNERS
new file mode 100644
index 0000000..999ea0e
--- /dev/null
+++ b/cmds/appops/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/permission/OWNERS
diff --git a/cmds/backup/OWNERS b/cmds/backup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/cmds/backup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/cmds/bmgr/OWNERS b/cmds/bmgr/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/cmds/bmgr/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/cmds/bu/OWNERS b/cmds/bu/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/cmds/bu/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/cmds/dpm/OWNERS b/cmds/dpm/OWNERS
new file mode 100644
index 0000000..e95633a
--- /dev/null
+++ b/cmds/dpm/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/app/admin/OWNERS
diff --git a/cmds/ime/OWNERS b/cmds/ime/OWNERS
new file mode 100644
index 0000000..5deb2ce
--- /dev/null
+++ b/cmds/ime/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/inputmethod/OWNERS
diff --git a/cmds/incident/OWNERS b/cmds/incident/OWNERS
new file mode 100644
index 0000000..f766115
--- /dev/null
+++ b/cmds/incident/OWNERS
@@ -0,0 +1 @@
+include /cmds/incidentd/OWNERS
diff --git a/cmds/input/OWNERS b/cmds/input/OWNERS
new file mode 100644
index 0000000..d701f23
--- /dev/null
+++ b/cmds/input/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/input/OWNERS
diff --git a/cmds/locksettings/OWNERS b/cmds/locksettings/OWNERS
new file mode 100644
index 0000000..0a8dc8c
--- /dev/null
+++ b/cmds/locksettings/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/locksettings/OWNERS
diff --git a/cmds/pm/OWNERS b/cmds/pm/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/cmds/pm/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/cmds/sm/OWNERS b/cmds/sm/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/cmds/sm/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/cmds/telecom/OWNERS b/cmds/telecom/OWNERS
new file mode 100644
index 0000000..2f813e6
--- /dev/null
+++ b/cmds/telecom/OWNERS
@@ -0,0 +1 @@
+include /telecomm/OWNERS
diff --git a/cmds/uinput/OWNERS b/cmds/uinput/OWNERS
new file mode 100644
index 0000000..d701f23
--- /dev/null
+++ b/cmds/uinput/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/input/OWNERS
diff --git a/cmds/wm/OWNERS b/cmds/wm/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/cmds/wm/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/config/OWNERS b/config/OWNERS
index 3d4924d..d59c6f2 100644
--- a/config/OWNERS
+++ b/config/OWNERS
@@ -1,4 +1,7 @@
+include /ZYGOTE_OWNERS
+
# compat-team@ for changes to hiddenapi files
+
per-file hiddenapi-* = andreionea@google.com, mathewi@google.com, satayev@google.com
# Escalations:
diff --git a/core/api/OWNERS b/core/api/OWNERS
new file mode 100644
index 0000000..0b95c51
--- /dev/null
+++ b/core/api/OWNERS
@@ -0,0 +1,2 @@
+# API changes are managed via Prolog rules, not OWNERS
+*
diff --git a/core/api/current.txt b/core/api/current.txt
index 14c1dc87..92d5298 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -87,6 +87,7 @@
field public static final String GET_PACKAGE_SIZE = "android.permission.GET_PACKAGE_SIZE";
field @Deprecated public static final String GET_TASKS = "android.permission.GET_TASKS";
field public static final String GLOBAL_SEARCH = "android.permission.GLOBAL_SEARCH";
+ field public static final String HIDE_OVERLAY_WINDOWS = "android.permission.HIDE_OVERLAY_WINDOWS";
field public static final String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER";
field public static final String INSTALL_PACKAGES = "android.permission.INSTALL_PACKAGES";
field public static final String INSTALL_SHORTCUT = "com.android.launcher.permission.INSTALL_SHORTCUT";
@@ -140,6 +141,7 @@
field public static final String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
field public static final String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
field public static final String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
+ field public static final String REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE = "android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE";
field public static final String REQUEST_PASSWORD_COMPLEXITY = "android.permission.REQUEST_PASSWORD_COMPLEXITY";
field @Deprecated public static final String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
field public static final String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
@@ -165,6 +167,7 @@
field public static final String USE_BIOMETRIC = "android.permission.USE_BIOMETRIC";
field @Deprecated public static final String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT";
field public static final String USE_FULL_SCREEN_INTENT = "android.permission.USE_FULL_SCREEN_INTENT";
+ field public static final String USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER = "android.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER";
field public static final String USE_SIP = "android.permission.USE_SIP";
field public static final String VIBRATE = "android.permission.VIBRATE";
field public static final String WAKE_LOCK = "android.permission.WAKE_LOCK";
@@ -6215,6 +6218,7 @@
method public android.app.PictureInPictureParams.Builder setActions(java.util.List<android.app.RemoteAction>);
method public android.app.PictureInPictureParams.Builder setAspectRatio(android.util.Rational);
method @NonNull public android.app.PictureInPictureParams.Builder setAutoEnterEnabled(boolean);
+ method @NonNull public android.app.PictureInPictureParams.Builder setSeamlessResizeEnabled(boolean);
method public android.app.PictureInPictureParams.Builder setSourceRectHint(android.graphics.Rect);
}
@@ -6920,6 +6924,7 @@
method public int getGlobalPrivateDnsMode(@NonNull android.content.ComponentName);
method @NonNull public java.util.List<byte[]> getInstalledCaCerts(@Nullable android.content.ComponentName);
method @Nullable public java.util.List<java.lang.String> getKeepUninstalledPackages(@Nullable android.content.ComponentName);
+ method @NonNull public java.util.Set<java.util.Set<java.lang.String>> getKeyPairGrants(@NonNull String);
method public int getKeyguardDisabledFeatures(@Nullable android.content.ComponentName);
method public int getLockTaskFeatures(@NonNull android.content.ComponentName);
method @NonNull public String[] getLockTaskPackages(@NonNull android.content.ComponentName);
@@ -6937,14 +6942,14 @@
method public long getPasswordExpirationTimeout(@Nullable android.content.ComponentName);
method public int getPasswordHistoryLength(@Nullable android.content.ComponentName);
method public int getPasswordMaximumLength(int);
- method public int getPasswordMinimumLength(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumLetters(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumLowerCase(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumNonLetter(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumNumeric(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumSymbols(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumUpperCase(@Nullable android.content.ComponentName);
- method public int getPasswordQuality(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumLength(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumLetters(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumLowerCase(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumNonLetter(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumNumeric(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumSymbols(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumUpperCase(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordQuality(@Nullable android.content.ComponentName);
method @Nullable public android.app.admin.SystemUpdateInfo getPendingSystemUpdate(@NonNull android.content.ComponentName);
method public int getPermissionGrantState(@Nullable android.content.ComponentName, @NonNull String, @NonNull String);
method public int getPermissionPolicy(android.content.ComponentName);
@@ -7068,14 +7073,14 @@
method @NonNull public String[] setPackagesSuspended(@NonNull android.content.ComponentName, @NonNull String[], boolean);
method public void setPasswordExpirationTimeout(@NonNull android.content.ComponentName, long);
method public void setPasswordHistoryLength(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumLength(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumLetters(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumLowerCase(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumNonLetter(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumNumeric(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumSymbols(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumUpperCase(@NonNull android.content.ComponentName, int);
- method public void setPasswordQuality(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumLength(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumLetters(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumLowerCase(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumNonLetter(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumNumeric(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumSymbols(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumUpperCase(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordQuality(@NonNull android.content.ComponentName, int);
method public boolean setPermissionGrantState(@NonNull android.content.ComponentName, @NonNull String, @NonNull String, int);
method public void setPermissionPolicy(@NonNull android.content.ComponentName, int);
method public boolean setPermittedAccessibilityServices(@NonNull android.content.ComponentName, java.util.List<java.lang.String>);
@@ -9516,6 +9521,8 @@
method @NonNull public java.util.List<java.lang.String> getAssociations();
method public boolean hasNotificationAccess(android.content.ComponentName);
method public void requestNotificationAccess(android.content.ComponentName);
+ method @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void startObservingDevicePresence(@NonNull String) throws android.companion.DeviceNotAssociatedException;
+ method @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void stopObservingDevicePresence(@NonNull String) throws android.companion.DeviceNotAssociatedException;
field public static final String EXTRA_DEVICE = "android.companion.extra.DEVICE";
}
@@ -9536,6 +9543,9 @@
public interface DeviceFilter<D extends android.os.Parcelable> extends android.os.Parcelable {
}
+ public class DeviceNotAssociatedException extends java.lang.Exception {
+ }
+
public final class WifiDeviceFilter implements android.companion.DeviceFilter<android.net.wifi.ScanResult> {
method public int describeContents();
method public void writeToParcel(@NonNull android.os.Parcel, int);
@@ -12253,6 +12263,7 @@
field public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef";
field public static final String FEATURE_NFC_OFF_HOST_CARD_EMULATION_ESE = "android.hardware.nfc.ese";
field public static final String FEATURE_NFC_OFF_HOST_CARD_EMULATION_UICC = "android.hardware.nfc.uicc";
+ field public static final String FEATURE_OPENGLES_DEQP_LEVEL = "android.software.opengles.deqp.level";
field public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep";
field public static final String FEATURE_PC = "android.hardware.type.pc";
field public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture";
@@ -12453,6 +12464,7 @@
field public static final int PROTECTION_FLAG_SETUP = 2048; // 0x800
field @Deprecated public static final int PROTECTION_FLAG_SYSTEM = 16; // 0x10
field public static final int PROTECTION_FLAG_VERIFIER = 512; // 0x200
+ field public static final int PROTECTION_INTERNAL = 4; // 0x4
field @Deprecated public static final int PROTECTION_MASK_BASE = 15; // 0xf
field @Deprecated public static final int PROTECTION_MASK_FLAGS = 65520; // 0xfff0
field public static final int PROTECTION_NORMAL = 0; // 0x0
@@ -15275,16 +15287,11 @@
ctor public PaintFlagsDrawFilter(int, int);
}
- public final class ParcelableColorSpace extends android.graphics.ColorSpace implements android.os.Parcelable {
+ public final class ParcelableColorSpace implements android.os.Parcelable {
ctor public ParcelableColorSpace(@NonNull android.graphics.ColorSpace);
method public int describeContents();
- method @NonNull public float[] fromXyz(@NonNull float[]);
method @NonNull public android.graphics.ColorSpace getColorSpace();
- method public float getMaxValue(int);
- method public float getMinValue(int);
method public static boolean isParcelable(@NonNull android.graphics.ColorSpace);
- method public boolean isWideGamut();
- method @NonNull public float[] toXyz(@NonNull float[]);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.graphics.ParcelableColorSpace> CREATOR;
}
@@ -18520,4812 +18527,6 @@
}
-package android.icu.lang {
-
- public final class UCharacter implements android.icu.lang.UCharacterEnums.ECharacterCategory android.icu.lang.UCharacterEnums.ECharacterDirection {
- method public static int charCount(int);
- method public static int codePointAt(CharSequence, int);
- method public static int codePointAt(char[], int);
- method public static int codePointAt(char[], int, int);
- method public static int codePointBefore(CharSequence, int);
- method public static int codePointBefore(char[], int);
- method public static int codePointBefore(char[], int, int);
- method public static int codePointCount(CharSequence, int, int);
- method public static int codePointCount(char[], int, int);
- method public static int digit(int, int);
- method public static int digit(int);
- method public static int foldCase(int, boolean);
- method public static String foldCase(String, boolean);
- method public static int foldCase(int, int);
- method public static String foldCase(String, int);
- method public static char forDigit(int, int);
- method public static android.icu.util.VersionInfo getAge(int);
- method public static int getBidiPairedBracket(int);
- method public static int getCharFromExtendedName(String);
- method public static int getCharFromName(String);
- method public static int getCharFromNameAlias(String);
- method public static int getCodePoint(char, char);
- method public static int getCodePoint(char);
- method public static int getCombiningClass(int);
- method public static int getDirection(int);
- method public static byte getDirectionality(int);
- method public static String getExtendedName(int);
- method public static android.icu.util.ValueIterator getExtendedNameIterator();
- method public static int getHanNumericValue(int);
- method public static int getIntPropertyMaxValue(int);
- method public static int getIntPropertyMinValue(int);
- method public static int getIntPropertyValue(int, int);
- method public static int getMirror(int);
- method public static String getName(int);
- method public static String getName(String, String);
- method public static String getNameAlias(int);
- method public static android.icu.util.ValueIterator getNameIterator();
- method public static int getNumericValue(int);
- method public static int getPropertyEnum(CharSequence);
- method public static String getPropertyName(int, int);
- method public static int getPropertyValueEnum(int, CharSequence);
- method public static String getPropertyValueName(int, int, int);
- method public static int getType(int);
- method public static android.icu.util.RangeValueIterator getTypeIterator();
- method public static double getUnicodeNumericValue(int);
- method public static android.icu.util.VersionInfo getUnicodeVersion();
- method public static boolean hasBinaryProperty(int, int);
- method public static boolean isBMP(int);
- method public static boolean isBaseForm(int);
- method public static boolean isDefined(int);
- method public static boolean isDigit(int);
- method public static boolean isHighSurrogate(char);
- method public static boolean isISOControl(int);
- method public static boolean isIdentifierIgnorable(int);
- method public static boolean isJavaIdentifierPart(int);
- method public static boolean isJavaIdentifierStart(int);
- method public static boolean isLegal(int);
- method public static boolean isLegal(String);
- method public static boolean isLetter(int);
- method public static boolean isLetterOrDigit(int);
- method public static boolean isLowSurrogate(char);
- method public static boolean isLowerCase(int);
- method public static boolean isMirrored(int);
- method public static boolean isPrintable(int);
- method public static boolean isSpaceChar(int);
- method public static boolean isSupplementary(int);
- method public static boolean isSupplementaryCodePoint(int);
- method public static boolean isSurrogatePair(char, char);
- method public static boolean isTitleCase(int);
- method public static boolean isUAlphabetic(int);
- method public static boolean isULowercase(int);
- method public static boolean isUUppercase(int);
- method public static boolean isUWhiteSpace(int);
- method public static boolean isUnicodeIdentifierPart(int);
- method public static boolean isUnicodeIdentifierStart(int);
- method public static boolean isUpperCase(int);
- method public static boolean isValidCodePoint(int);
- method public static boolean isWhitespace(int);
- method public static int offsetByCodePoints(CharSequence, int, int);
- method public static int offsetByCodePoints(char[], int, int, int, int);
- method public static int toChars(int, char[], int);
- method public static char[] toChars(int);
- method public static int toCodePoint(char, char);
- method public static int toLowerCase(int);
- method public static String toLowerCase(String);
- method public static String toLowerCase(java.util.Locale, String);
- method public static String toLowerCase(android.icu.util.ULocale, String);
- method public static String toString(int);
- method public static int toTitleCase(int);
- method public static String toTitleCase(String, android.icu.text.BreakIterator);
- method public static String toTitleCase(java.util.Locale, String, android.icu.text.BreakIterator);
- method public static String toTitleCase(android.icu.util.ULocale, String, android.icu.text.BreakIterator);
- method public static String toTitleCase(android.icu.util.ULocale, String, android.icu.text.BreakIterator, int);
- method public static String toTitleCase(java.util.Locale, String, android.icu.text.BreakIterator, int);
- method public static int toUpperCase(int);
- method public static String toUpperCase(String);
- method public static String toUpperCase(java.util.Locale, String);
- method public static String toUpperCase(android.icu.util.ULocale, String);
- field public static final int FOLD_CASE_DEFAULT = 0; // 0x0
- field public static final int FOLD_CASE_EXCLUDE_SPECIAL_I = 1; // 0x1
- field public static final int MAX_CODE_POINT = 1114111; // 0x10ffff
- field public static final char MAX_HIGH_SURROGATE = 56319; // 0xdbff '\udbff'
- field public static final char MAX_LOW_SURROGATE = 57343; // 0xdfff '\udfff'
- field public static final int MAX_RADIX = 36; // 0x24
- field public static final char MAX_SURROGATE = 57343; // 0xdfff '\udfff'
- field public static final int MAX_VALUE = 1114111; // 0x10ffff
- field public static final int MIN_CODE_POINT = 0; // 0x0
- field public static final char MIN_HIGH_SURROGATE = 55296; // 0xd800 '\ud800'
- field public static final char MIN_LOW_SURROGATE = 56320; // 0xdc00 '\udc00'
- field public static final int MIN_RADIX = 2; // 0x2
- field public static final int MIN_SUPPLEMENTARY_CODE_POINT = 65536; // 0x10000
- field public static final char MIN_SURROGATE = 55296; // 0xd800 '\ud800'
- field public static final int MIN_VALUE = 0; // 0x0
- field public static final double NO_NUMERIC_VALUE = -1.23456789E8;
- field public static final int REPLACEMENT_CHAR = 65533; // 0xfffd
- field public static final int SUPPLEMENTARY_MIN_VALUE = 65536; // 0x10000
- field public static final int TITLECASE_NO_BREAK_ADJUSTMENT = 512; // 0x200
- field public static final int TITLECASE_NO_LOWERCASE = 256; // 0x100
- }
-
- public static interface UCharacter.BidiPairedBracketType {
- field public static final int CLOSE = 2; // 0x2
- field public static final int NONE = 0; // 0x0
- field public static final int OPEN = 1; // 0x1
- }
-
- public static interface UCharacter.DecompositionType {
- field public static final int CANONICAL = 1; // 0x1
- field public static final int CIRCLE = 3; // 0x3
- field public static final int COMPAT = 2; // 0x2
- field public static final int FINAL = 4; // 0x4
- field public static final int FONT = 5; // 0x5
- field public static final int FRACTION = 6; // 0x6
- field public static final int INITIAL = 7; // 0x7
- field public static final int ISOLATED = 8; // 0x8
- field public static final int MEDIAL = 9; // 0x9
- field public static final int NARROW = 10; // 0xa
- field public static final int NOBREAK = 11; // 0xb
- field public static final int NONE = 0; // 0x0
- field public static final int SMALL = 12; // 0xc
- field public static final int SQUARE = 13; // 0xd
- field public static final int SUB = 14; // 0xe
- field public static final int SUPER = 15; // 0xf
- field public static final int VERTICAL = 16; // 0x10
- field public static final int WIDE = 17; // 0x11
- }
-
- public static interface UCharacter.EastAsianWidth {
- field public static final int AMBIGUOUS = 1; // 0x1
- field public static final int FULLWIDTH = 3; // 0x3
- field public static final int HALFWIDTH = 2; // 0x2
- field public static final int NARROW = 4; // 0x4
- field public static final int NEUTRAL = 0; // 0x0
- field public static final int WIDE = 5; // 0x5
- }
-
- public static interface UCharacter.GraphemeClusterBreak {
- field public static final int CONTROL = 1; // 0x1
- field public static final int CR = 2; // 0x2
- field public static final int EXTEND = 3; // 0x3
- field public static final int E_BASE = 13; // 0xd
- field public static final int E_BASE_GAZ = 14; // 0xe
- field public static final int E_MODIFIER = 15; // 0xf
- field public static final int GLUE_AFTER_ZWJ = 16; // 0x10
- field public static final int L = 4; // 0x4
- field public static final int LF = 5; // 0x5
- field public static final int LV = 6; // 0x6
- field public static final int LVT = 7; // 0x7
- field public static final int OTHER = 0; // 0x0
- field public static final int PREPEND = 11; // 0xb
- field public static final int REGIONAL_INDICATOR = 12; // 0xc
- field public static final int SPACING_MARK = 10; // 0xa
- field public static final int T = 8; // 0x8
- field public static final int V = 9; // 0x9
- field public static final int ZWJ = 17; // 0x11
- }
-
- public static interface UCharacter.HangulSyllableType {
- field public static final int LEADING_JAMO = 1; // 0x1
- field public static final int LVT_SYLLABLE = 5; // 0x5
- field public static final int LV_SYLLABLE = 4; // 0x4
- field public static final int NOT_APPLICABLE = 0; // 0x0
- field public static final int TRAILING_JAMO = 3; // 0x3
- field public static final int VOWEL_JAMO = 2; // 0x2
- }
-
- public static interface UCharacter.IndicPositionalCategory {
- field public static final int BOTTOM = 1; // 0x1
- field public static final int BOTTOM_AND_LEFT = 2; // 0x2
- field public static final int BOTTOM_AND_RIGHT = 3; // 0x3
- field public static final int LEFT = 4; // 0x4
- field public static final int LEFT_AND_RIGHT = 5; // 0x5
- field public static final int NA = 0; // 0x0
- field public static final int OVERSTRUCK = 6; // 0x6
- field public static final int RIGHT = 7; // 0x7
- field public static final int TOP = 8; // 0x8
- field public static final int TOP_AND_BOTTOM = 9; // 0x9
- field public static final int TOP_AND_BOTTOM_AND_LEFT = 15; // 0xf
- field public static final int TOP_AND_BOTTOM_AND_RIGHT = 10; // 0xa
- field public static final int TOP_AND_LEFT = 11; // 0xb
- field public static final int TOP_AND_LEFT_AND_RIGHT = 12; // 0xc
- field public static final int TOP_AND_RIGHT = 13; // 0xd
- field public static final int VISUAL_ORDER_LEFT = 14; // 0xe
- }
-
- public static interface UCharacter.IndicSyllabicCategory {
- field public static final int AVAGRAHA = 1; // 0x1
- field public static final int BINDU = 2; // 0x2
- field public static final int BRAHMI_JOINING_NUMBER = 3; // 0x3
- field public static final int CANTILLATION_MARK = 4; // 0x4
- field public static final int CONSONANT = 5; // 0x5
- field public static final int CONSONANT_DEAD = 6; // 0x6
- field public static final int CONSONANT_FINAL = 7; // 0x7
- field public static final int CONSONANT_HEAD_LETTER = 8; // 0x8
- field public static final int CONSONANT_INITIAL_POSTFIXED = 9; // 0x9
- field public static final int CONSONANT_KILLER = 10; // 0xa
- field public static final int CONSONANT_MEDIAL = 11; // 0xb
- field public static final int CONSONANT_PLACEHOLDER = 12; // 0xc
- field public static final int CONSONANT_PRECEDING_REPHA = 13; // 0xd
- field public static final int CONSONANT_PREFIXED = 14; // 0xe
- field public static final int CONSONANT_SUBJOINED = 15; // 0xf
- field public static final int CONSONANT_SUCCEEDING_REPHA = 16; // 0x10
- field public static final int CONSONANT_WITH_STACKER = 17; // 0x11
- field public static final int GEMINATION_MARK = 18; // 0x12
- field public static final int INVISIBLE_STACKER = 19; // 0x13
- field public static final int JOINER = 20; // 0x14
- field public static final int MODIFYING_LETTER = 21; // 0x15
- field public static final int NON_JOINER = 22; // 0x16
- field public static final int NUKTA = 23; // 0x17
- field public static final int NUMBER = 24; // 0x18
- field public static final int NUMBER_JOINER = 25; // 0x19
- field public static final int OTHER = 0; // 0x0
- field public static final int PURE_KILLER = 26; // 0x1a
- field public static final int REGISTER_SHIFTER = 27; // 0x1b
- field public static final int SYLLABLE_MODIFIER = 28; // 0x1c
- field public static final int TONE_LETTER = 29; // 0x1d
- field public static final int TONE_MARK = 30; // 0x1e
- field public static final int VIRAMA = 31; // 0x1f
- field public static final int VISARGA = 32; // 0x20
- field public static final int VOWEL = 33; // 0x21
- field public static final int VOWEL_DEPENDENT = 34; // 0x22
- field public static final int VOWEL_INDEPENDENT = 35; // 0x23
- }
-
- public static interface UCharacter.JoiningGroup {
- field public static final int AFRICAN_FEH = 86; // 0x56
- field public static final int AFRICAN_NOON = 87; // 0x57
- field public static final int AFRICAN_QAF = 88; // 0x58
- field public static final int AIN = 1; // 0x1
- field public static final int ALAPH = 2; // 0x2
- field public static final int ALEF = 3; // 0x3
- field public static final int BEH = 4; // 0x4
- field public static final int BETH = 5; // 0x5
- field public static final int BURUSHASKI_YEH_BARREE = 54; // 0x36
- field public static final int DAL = 6; // 0x6
- field public static final int DALATH_RISH = 7; // 0x7
- field public static final int E = 8; // 0x8
- field public static final int FARSI_YEH = 55; // 0x37
- field public static final int FE = 51; // 0x33
- field public static final int FEH = 9; // 0x9
- field public static final int FINAL_SEMKATH = 10; // 0xa
- field public static final int GAF = 11; // 0xb
- field public static final int GAMAL = 12; // 0xc
- field public static final int HAH = 13; // 0xd
- field public static final int HAMZA_ON_HEH_GOAL = 14; // 0xe
- field public static final int HANIFI_ROHINGYA_KINNA_YA = 100; // 0x64
- field public static final int HANIFI_ROHINGYA_PA = 101; // 0x65
- field public static final int HE = 15; // 0xf
- field public static final int HEH = 16; // 0x10
- field public static final int HEH_GOAL = 17; // 0x11
- field public static final int HETH = 18; // 0x12
- field public static final int KAF = 19; // 0x13
- field public static final int KAPH = 20; // 0x14
- field public static final int KHAPH = 52; // 0x34
- field public static final int KNOTTED_HEH = 21; // 0x15
- field public static final int LAM = 22; // 0x16
- field public static final int LAMADH = 23; // 0x17
- field public static final int MALAYALAM_BHA = 89; // 0x59
- field public static final int MALAYALAM_JA = 90; // 0x5a
- field public static final int MALAYALAM_LLA = 91; // 0x5b
- field public static final int MALAYALAM_LLLA = 92; // 0x5c
- field public static final int MALAYALAM_NGA = 93; // 0x5d
- field public static final int MALAYALAM_NNA = 94; // 0x5e
- field public static final int MALAYALAM_NNNA = 95; // 0x5f
- field public static final int MALAYALAM_NYA = 96; // 0x60
- field public static final int MALAYALAM_RA = 97; // 0x61
- field public static final int MALAYALAM_SSA = 98; // 0x62
- field public static final int MALAYALAM_TTA = 99; // 0x63
- field public static final int MANICHAEAN_ALEPH = 58; // 0x3a
- field public static final int MANICHAEAN_AYIN = 59; // 0x3b
- field public static final int MANICHAEAN_BETH = 60; // 0x3c
- field public static final int MANICHAEAN_DALETH = 61; // 0x3d
- field public static final int MANICHAEAN_DHAMEDH = 62; // 0x3e
- field public static final int MANICHAEAN_FIVE = 63; // 0x3f
- field public static final int MANICHAEAN_GIMEL = 64; // 0x40
- field public static final int MANICHAEAN_HETH = 65; // 0x41
- field public static final int MANICHAEAN_HUNDRED = 66; // 0x42
- field public static final int MANICHAEAN_KAPH = 67; // 0x43
- field public static final int MANICHAEAN_LAMEDH = 68; // 0x44
- field public static final int MANICHAEAN_MEM = 69; // 0x45
- field public static final int MANICHAEAN_NUN = 70; // 0x46
- field public static final int MANICHAEAN_ONE = 71; // 0x47
- field public static final int MANICHAEAN_PE = 72; // 0x48
- field public static final int MANICHAEAN_QOPH = 73; // 0x49
- field public static final int MANICHAEAN_RESH = 74; // 0x4a
- field public static final int MANICHAEAN_SADHE = 75; // 0x4b
- field public static final int MANICHAEAN_SAMEKH = 76; // 0x4c
- field public static final int MANICHAEAN_TAW = 77; // 0x4d
- field public static final int MANICHAEAN_TEN = 78; // 0x4e
- field public static final int MANICHAEAN_TETH = 79; // 0x4f
- field public static final int MANICHAEAN_THAMEDH = 80; // 0x50
- field public static final int MANICHAEAN_TWENTY = 81; // 0x51
- field public static final int MANICHAEAN_WAW = 82; // 0x52
- field public static final int MANICHAEAN_YODH = 83; // 0x53
- field public static final int MANICHAEAN_ZAYIN = 84; // 0x54
- field public static final int MEEM = 24; // 0x18
- field public static final int MIM = 25; // 0x19
- field public static final int NOON = 26; // 0x1a
- field public static final int NO_JOINING_GROUP = 0; // 0x0
- field public static final int NUN = 27; // 0x1b
- field public static final int NYA = 56; // 0x38
- field public static final int PE = 28; // 0x1c
- field public static final int QAF = 29; // 0x1d
- field public static final int QAPH = 30; // 0x1e
- field public static final int REH = 31; // 0x1f
- field public static final int REVERSED_PE = 32; // 0x20
- field public static final int ROHINGYA_YEH = 57; // 0x39
- field public static final int SAD = 33; // 0x21
- field public static final int SADHE = 34; // 0x22
- field public static final int SEEN = 35; // 0x23
- field public static final int SEMKATH = 36; // 0x24
- field public static final int SHIN = 37; // 0x25
- field public static final int STRAIGHT_WAW = 85; // 0x55
- field public static final int SWASH_KAF = 38; // 0x26
- field public static final int SYRIAC_WAW = 39; // 0x27
- field public static final int TAH = 40; // 0x28
- field public static final int TAW = 41; // 0x29
- field public static final int TEH_MARBUTA = 42; // 0x2a
- field public static final int TEH_MARBUTA_GOAL = 14; // 0xe
- field public static final int TETH = 43; // 0x2b
- field public static final int WAW = 44; // 0x2c
- field public static final int YEH = 45; // 0x2d
- field public static final int YEH_BARREE = 46; // 0x2e
- field public static final int YEH_WITH_TAIL = 47; // 0x2f
- field public static final int YUDH = 48; // 0x30
- field public static final int YUDH_HE = 49; // 0x31
- field public static final int ZAIN = 50; // 0x32
- field public static final int ZHAIN = 53; // 0x35
- }
-
- public static interface UCharacter.JoiningType {
- field public static final int DUAL_JOINING = 2; // 0x2
- field public static final int JOIN_CAUSING = 1; // 0x1
- field public static final int LEFT_JOINING = 3; // 0x3
- field public static final int NON_JOINING = 0; // 0x0
- field public static final int RIGHT_JOINING = 4; // 0x4
- field public static final int TRANSPARENT = 5; // 0x5
- }
-
- public static interface UCharacter.LineBreak {
- field public static final int ALPHABETIC = 2; // 0x2
- field public static final int AMBIGUOUS = 1; // 0x1
- field public static final int BREAK_AFTER = 4; // 0x4
- field public static final int BREAK_BEFORE = 5; // 0x5
- field public static final int BREAK_BOTH = 3; // 0x3
- field public static final int BREAK_SYMBOLS = 27; // 0x1b
- field public static final int CARRIAGE_RETURN = 10; // 0xa
- field public static final int CLOSE_PARENTHESIS = 36; // 0x24
- field public static final int CLOSE_PUNCTUATION = 8; // 0x8
- field public static final int COMBINING_MARK = 9; // 0x9
- field public static final int COMPLEX_CONTEXT = 24; // 0x18
- field public static final int CONDITIONAL_JAPANESE_STARTER = 37; // 0x25
- field public static final int CONTINGENT_BREAK = 7; // 0x7
- field public static final int EXCLAMATION = 11; // 0xb
- field public static final int E_BASE = 40; // 0x28
- field public static final int E_MODIFIER = 41; // 0x29
- field public static final int GLUE = 12; // 0xc
- field public static final int H2 = 31; // 0x1f
- field public static final int H3 = 32; // 0x20
- field public static final int HEBREW_LETTER = 38; // 0x26
- field public static final int HYPHEN = 13; // 0xd
- field public static final int IDEOGRAPHIC = 14; // 0xe
- field public static final int INFIX_NUMERIC = 16; // 0x10
- field public static final int INSEPARABLE = 15; // 0xf
- field public static final int INSEPERABLE = 15; // 0xf
- field public static final int JL = 33; // 0x21
- field public static final int JT = 34; // 0x22
- field public static final int JV = 35; // 0x23
- field public static final int LINE_FEED = 17; // 0x11
- field public static final int MANDATORY_BREAK = 6; // 0x6
- field public static final int NEXT_LINE = 29; // 0x1d
- field public static final int NONSTARTER = 18; // 0x12
- field public static final int NUMERIC = 19; // 0x13
- field public static final int OPEN_PUNCTUATION = 20; // 0x14
- field public static final int POSTFIX_NUMERIC = 21; // 0x15
- field public static final int PREFIX_NUMERIC = 22; // 0x16
- field public static final int QUOTATION = 23; // 0x17
- field public static final int REGIONAL_INDICATOR = 39; // 0x27
- field public static final int SPACE = 26; // 0x1a
- field public static final int SURROGATE = 25; // 0x19
- field public static final int UNKNOWN = 0; // 0x0
- field public static final int WORD_JOINER = 30; // 0x1e
- field public static final int ZWJ = 42; // 0x2a
- field public static final int ZWSPACE = 28; // 0x1c
- }
-
- public static interface UCharacter.NumericType {
- field public static final int DECIMAL = 1; // 0x1
- field public static final int DIGIT = 2; // 0x2
- field public static final int NONE = 0; // 0x0
- field public static final int NUMERIC = 3; // 0x3
- }
-
- public static interface UCharacter.SentenceBreak {
- field public static final int ATERM = 1; // 0x1
- field public static final int CLOSE = 2; // 0x2
- field public static final int CR = 11; // 0xb
- field public static final int EXTEND = 12; // 0xc
- field public static final int FORMAT = 3; // 0x3
- field public static final int LF = 13; // 0xd
- field public static final int LOWER = 4; // 0x4
- field public static final int NUMERIC = 5; // 0x5
- field public static final int OLETTER = 6; // 0x6
- field public static final int OTHER = 0; // 0x0
- field public static final int SCONTINUE = 14; // 0xe
- field public static final int SEP = 7; // 0x7
- field public static final int SP = 8; // 0x8
- field public static final int STERM = 9; // 0x9
- field public static final int UPPER = 10; // 0xa
- }
-
- public static final class UCharacter.UnicodeBlock extends java.lang.Character.Subset {
- method public static android.icu.lang.UCharacter.UnicodeBlock forName(String);
- method public int getID();
- method public static android.icu.lang.UCharacter.UnicodeBlock getInstance(int);
- method public static android.icu.lang.UCharacter.UnicodeBlock of(int);
- field public static final android.icu.lang.UCharacter.UnicodeBlock ADLAM;
- field public static final int ADLAM_ID = 263; // 0x107
- field public static final android.icu.lang.UCharacter.UnicodeBlock AEGEAN_NUMBERS;
- field public static final int AEGEAN_NUMBERS_ID = 119; // 0x77
- field public static final android.icu.lang.UCharacter.UnicodeBlock AHOM;
- field public static final int AHOM_ID = 253; // 0xfd
- field public static final android.icu.lang.UCharacter.UnicodeBlock ALCHEMICAL_SYMBOLS;
- field public static final int ALCHEMICAL_SYMBOLS_ID = 208; // 0xd0
- field public static final android.icu.lang.UCharacter.UnicodeBlock ALPHABETIC_PRESENTATION_FORMS;
- field public static final int ALPHABETIC_PRESENTATION_FORMS_ID = 80; // 0x50
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANATOLIAN_HIEROGLYPHS;
- field public static final int ANATOLIAN_HIEROGLYPHS_ID = 254; // 0xfe
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION;
- field public static final int ANCIENT_GREEK_MUSICAL_NOTATION_ID = 126; // 0x7e
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_GREEK_NUMBERS;
- field public static final int ANCIENT_GREEK_NUMBERS_ID = 127; // 0x7f
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_SYMBOLS;
- field public static final int ANCIENT_SYMBOLS_ID = 165; // 0xa5
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_EXTENDED_A;
- field public static final int ARABIC_EXTENDED_A_ID = 210; // 0xd2
- field public static final int ARABIC_ID = 12; // 0xc
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS;
- field public static final int ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_ID = 211; // 0xd3
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_PRESENTATION_FORMS_A;
- field public static final int ARABIC_PRESENTATION_FORMS_A_ID = 81; // 0x51
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_PRESENTATION_FORMS_B;
- field public static final int ARABIC_PRESENTATION_FORMS_B_ID = 85; // 0x55
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_SUPPLEMENT;
- field public static final int ARABIC_SUPPLEMENT_ID = 128; // 0x80
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARMENIAN;
- field public static final int ARMENIAN_ID = 10; // 0xa
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARROWS;
- field public static final int ARROWS_ID = 46; // 0x2e
- field public static final android.icu.lang.UCharacter.UnicodeBlock AVESTAN;
- field public static final int AVESTAN_ID = 188; // 0xbc
- field public static final android.icu.lang.UCharacter.UnicodeBlock BALINESE;
- field public static final int BALINESE_ID = 147; // 0x93
- field public static final android.icu.lang.UCharacter.UnicodeBlock BAMUM;
- field public static final int BAMUM_ID = 177; // 0xb1
- field public static final android.icu.lang.UCharacter.UnicodeBlock BAMUM_SUPPLEMENT;
- field public static final int BAMUM_SUPPLEMENT_ID = 202; // 0xca
- field public static final android.icu.lang.UCharacter.UnicodeBlock BASIC_LATIN;
- field public static final int BASIC_LATIN_ID = 1; // 0x1
- field public static final android.icu.lang.UCharacter.UnicodeBlock BASSA_VAH;
- field public static final int BASSA_VAH_ID = 221; // 0xdd
- field public static final android.icu.lang.UCharacter.UnicodeBlock BATAK;
- field public static final int BATAK_ID = 199; // 0xc7
- field public static final android.icu.lang.UCharacter.UnicodeBlock BENGALI;
- field public static final int BENGALI_ID = 16; // 0x10
- field public static final android.icu.lang.UCharacter.UnicodeBlock BHAIKSUKI;
- field public static final int BHAIKSUKI_ID = 264; // 0x108
- field public static final android.icu.lang.UCharacter.UnicodeBlock BLOCK_ELEMENTS;
- field public static final int BLOCK_ELEMENTS_ID = 53; // 0x35
- field public static final android.icu.lang.UCharacter.UnicodeBlock BOPOMOFO;
- field public static final android.icu.lang.UCharacter.UnicodeBlock BOPOMOFO_EXTENDED;
- field public static final int BOPOMOFO_EXTENDED_ID = 67; // 0x43
- field public static final int BOPOMOFO_ID = 64; // 0x40
- field public static final android.icu.lang.UCharacter.UnicodeBlock BOX_DRAWING;
- field public static final int BOX_DRAWING_ID = 52; // 0x34
- field public static final android.icu.lang.UCharacter.UnicodeBlock BRAHMI;
- field public static final int BRAHMI_ID = 201; // 0xc9
- field public static final android.icu.lang.UCharacter.UnicodeBlock BRAILLE_PATTERNS;
- field public static final int BRAILLE_PATTERNS_ID = 57; // 0x39
- field public static final android.icu.lang.UCharacter.UnicodeBlock BUGINESE;
- field public static final int BUGINESE_ID = 129; // 0x81
- field public static final android.icu.lang.UCharacter.UnicodeBlock BUHID;
- field public static final int BUHID_ID = 100; // 0x64
- field public static final android.icu.lang.UCharacter.UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS;
- field public static final int BYZANTINE_MUSICAL_SYMBOLS_ID = 91; // 0x5b
- field public static final android.icu.lang.UCharacter.UnicodeBlock CARIAN;
- field public static final int CARIAN_ID = 168; // 0xa8
- field public static final android.icu.lang.UCharacter.UnicodeBlock CAUCASIAN_ALBANIAN;
- field public static final int CAUCASIAN_ALBANIAN_ID = 222; // 0xde
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHAKMA;
- field public static final int CHAKMA_ID = 212; // 0xd4
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHAM;
- field public static final int CHAM_ID = 164; // 0xa4
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHEROKEE;
- field public static final int CHEROKEE_ID = 32; // 0x20
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHEROKEE_SUPPLEMENT;
- field public static final int CHEROKEE_SUPPLEMENT_ID = 255; // 0xff
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHESS_SYMBOLS;
- field public static final int CHESS_SYMBOLS_ID = 281; // 0x119
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHORASMIAN;
- field public static final int CHORASMIAN_ID = 301; // 0x12d
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_FORMS;
- field public static final int CJK_COMPATIBILITY_FORMS_ID = 83; // 0x53
- field public static final int CJK_COMPATIBILITY_ID = 69; // 0x45
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS;
- field public static final int CJK_COMPATIBILITY_IDEOGRAPHS_ID = 79; // 0x4f
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT;
- field public static final int CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_ID = 95; // 0x5f
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_RADICALS_SUPPLEMENT;
- field public static final int CJK_RADICALS_SUPPLEMENT_ID = 58; // 0x3a
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_STROKES;
- field public static final int CJK_STROKES_ID = 130; // 0x82
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION;
- field public static final int CJK_SYMBOLS_AND_PUNCTUATION_ID = 61; // 0x3d
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_ID = 70; // 0x46
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_ID = 94; // 0x5e
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_ID = 197; // 0xc5
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_ID = 209; // 0xd1
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E_ID = 256; // 0x100
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F_ID = 274; // 0x112
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_G;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_G_ID = 302; // 0x12e
- field public static final int CJK_UNIFIED_IDEOGRAPHS_ID = 71; // 0x47
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS_EXTENDED;
- field public static final int COMBINING_DIACRITICAL_MARKS_EXTENDED_ID = 224; // 0xe0
- field public static final int COMBINING_DIACRITICAL_MARKS_ID = 7; // 0x7
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT;
- field public static final int COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_ID = 131; // 0x83
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_HALF_MARKS;
- field public static final int COMBINING_HALF_MARKS_ID = 82; // 0x52
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS;
- field public static final int COMBINING_MARKS_FOR_SYMBOLS_ID = 43; // 0x2b
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMMON_INDIC_NUMBER_FORMS;
- field public static final int COMMON_INDIC_NUMBER_FORMS_ID = 178; // 0xb2
- field public static final android.icu.lang.UCharacter.UnicodeBlock CONTROL_PICTURES;
- field public static final int CONTROL_PICTURES_ID = 49; // 0x31
- field public static final android.icu.lang.UCharacter.UnicodeBlock COPTIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock COPTIC_EPACT_NUMBERS;
- field public static final int COPTIC_EPACT_NUMBERS_ID = 223; // 0xdf
- field public static final int COPTIC_ID = 132; // 0x84
- field public static final android.icu.lang.UCharacter.UnicodeBlock COUNTING_ROD_NUMERALS;
- field public static final int COUNTING_ROD_NUMERALS_ID = 154; // 0x9a
- field public static final android.icu.lang.UCharacter.UnicodeBlock CUNEIFORM;
- field public static final int CUNEIFORM_ID = 152; // 0x98
- field public static final android.icu.lang.UCharacter.UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION;
- field public static final int CUNEIFORM_NUMBERS_AND_PUNCTUATION_ID = 153; // 0x99
- field public static final android.icu.lang.UCharacter.UnicodeBlock CURRENCY_SYMBOLS;
- field public static final int CURRENCY_SYMBOLS_ID = 42; // 0x2a
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYPRIOT_SYLLABARY;
- field public static final int CYPRIOT_SYLLABARY_ID = 123; // 0x7b
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_A;
- field public static final int CYRILLIC_EXTENDED_A_ID = 158; // 0x9e
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_B;
- field public static final int CYRILLIC_EXTENDED_B_ID = 160; // 0xa0
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_C;
- field public static final int CYRILLIC_EXTENDED_C_ID = 265; // 0x109
- field public static final int CYRILLIC_ID = 9; // 0x9
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_SUPPLEMENT;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_SUPPLEMENTARY;
- field public static final int CYRILLIC_SUPPLEMENTARY_ID = 97; // 0x61
- field public static final int CYRILLIC_SUPPLEMENT_ID = 97; // 0x61
- field public static final android.icu.lang.UCharacter.UnicodeBlock DESERET;
- field public static final int DESERET_ID = 90; // 0x5a
- field public static final android.icu.lang.UCharacter.UnicodeBlock DEVANAGARI;
- field public static final android.icu.lang.UCharacter.UnicodeBlock DEVANAGARI_EXTENDED;
- field public static final int DEVANAGARI_EXTENDED_ID = 179; // 0xb3
- field public static final int DEVANAGARI_ID = 15; // 0xf
- field public static final android.icu.lang.UCharacter.UnicodeBlock DINGBATS;
- field public static final int DINGBATS_ID = 56; // 0x38
- field public static final android.icu.lang.UCharacter.UnicodeBlock DIVES_AKURU;
- field public static final int DIVES_AKURU_ID = 303; // 0x12f
- field public static final android.icu.lang.UCharacter.UnicodeBlock DOGRA;
- field public static final int DOGRA_ID = 282; // 0x11a
- field public static final android.icu.lang.UCharacter.UnicodeBlock DOMINO_TILES;
- field public static final int DOMINO_TILES_ID = 171; // 0xab
- field public static final android.icu.lang.UCharacter.UnicodeBlock DUPLOYAN;
- field public static final int DUPLOYAN_ID = 225; // 0xe1
- field public static final android.icu.lang.UCharacter.UnicodeBlock EARLY_DYNASTIC_CUNEIFORM;
- field public static final int EARLY_DYNASTIC_CUNEIFORM_ID = 257; // 0x101
- field public static final android.icu.lang.UCharacter.UnicodeBlock EGYPTIAN_HIEROGLYPHS;
- field public static final int EGYPTIAN_HIEROGLYPHS_ID = 194; // 0xc2
- field public static final android.icu.lang.UCharacter.UnicodeBlock EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS;
- field public static final int EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS_ID = 292; // 0x124
- field public static final android.icu.lang.UCharacter.UnicodeBlock ELBASAN;
- field public static final int ELBASAN_ID = 226; // 0xe2
- field public static final android.icu.lang.UCharacter.UnicodeBlock ELYMAIC;
- field public static final int ELYMAIC_ID = 293; // 0x125
- field public static final android.icu.lang.UCharacter.UnicodeBlock EMOTICONS;
- field public static final int EMOTICONS_ID = 206; // 0xce
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_ALPHANUMERICS;
- field public static final int ENCLOSED_ALPHANUMERICS_ID = 51; // 0x33
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_ALPHANUMERIC_SUPPLEMENT;
- field public static final int ENCLOSED_ALPHANUMERIC_SUPPLEMENT_ID = 195; // 0xc3
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS;
- field public static final int ENCLOSED_CJK_LETTERS_AND_MONTHS_ID = 68; // 0x44
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_IDEOGRAPHIC_SUPPLEMENT;
- field public static final int ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_ID = 196; // 0xc4
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_EXTENDED;
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_EXTENDED_A;
- field public static final int ETHIOPIC_EXTENDED_A_ID = 200; // 0xc8
- field public static final int ETHIOPIC_EXTENDED_ID = 133; // 0x85
- field public static final int ETHIOPIC_ID = 31; // 0x1f
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_SUPPLEMENT;
- field public static final int ETHIOPIC_SUPPLEMENT_ID = 134; // 0x86
- field public static final android.icu.lang.UCharacter.UnicodeBlock GENERAL_PUNCTUATION;
- field public static final int GENERAL_PUNCTUATION_ID = 40; // 0x28
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEOMETRIC_SHAPES;
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEOMETRIC_SHAPES_EXTENDED;
- field public static final int GEOMETRIC_SHAPES_EXTENDED_ID = 227; // 0xe3
- field public static final int GEOMETRIC_SHAPES_ID = 54; // 0x36
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN;
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN_EXTENDED;
- field public static final int GEORGIAN_EXTENDED_ID = 283; // 0x11b
- field public static final int GEORGIAN_ID = 29; // 0x1d
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN_SUPPLEMENT;
- field public static final int GEORGIAN_SUPPLEMENT_ID = 135; // 0x87
- field public static final android.icu.lang.UCharacter.UnicodeBlock GLAGOLITIC;
- field public static final int GLAGOLITIC_ID = 136; // 0x88
- field public static final android.icu.lang.UCharacter.UnicodeBlock GLAGOLITIC_SUPPLEMENT;
- field public static final int GLAGOLITIC_SUPPLEMENT_ID = 266; // 0x10a
- field public static final android.icu.lang.UCharacter.UnicodeBlock GOTHIC;
- field public static final int GOTHIC_ID = 89; // 0x59
- field public static final android.icu.lang.UCharacter.UnicodeBlock GRANTHA;
- field public static final int GRANTHA_ID = 228; // 0xe4
- field public static final android.icu.lang.UCharacter.UnicodeBlock GREEK;
- field public static final android.icu.lang.UCharacter.UnicodeBlock GREEK_EXTENDED;
- field public static final int GREEK_EXTENDED_ID = 39; // 0x27
- field public static final int GREEK_ID = 8; // 0x8
- field public static final android.icu.lang.UCharacter.UnicodeBlock GUJARATI;
- field public static final int GUJARATI_ID = 18; // 0x12
- field public static final android.icu.lang.UCharacter.UnicodeBlock GUNJALA_GONDI;
- field public static final int GUNJALA_GONDI_ID = 284; // 0x11c
- field public static final android.icu.lang.UCharacter.UnicodeBlock GURMUKHI;
- field public static final int GURMUKHI_ID = 17; // 0x11
- field public static final android.icu.lang.UCharacter.UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS;
- field public static final int HALFWIDTH_AND_FULLWIDTH_FORMS_ID = 87; // 0x57
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_COMPATIBILITY_JAMO;
- field public static final int HANGUL_COMPATIBILITY_JAMO_ID = 65; // 0x41
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO;
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO_EXTENDED_A;
- field public static final int HANGUL_JAMO_EXTENDED_A_ID = 180; // 0xb4
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO_EXTENDED_B;
- field public static final int HANGUL_JAMO_EXTENDED_B_ID = 185; // 0xb9
- field public static final int HANGUL_JAMO_ID = 30; // 0x1e
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_SYLLABLES;
- field public static final int HANGUL_SYLLABLES_ID = 74; // 0x4a
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANIFI_ROHINGYA;
- field public static final int HANIFI_ROHINGYA_ID = 285; // 0x11d
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANUNOO;
- field public static final int HANUNOO_ID = 99; // 0x63
- field public static final android.icu.lang.UCharacter.UnicodeBlock HATRAN;
- field public static final int HATRAN_ID = 258; // 0x102
- field public static final android.icu.lang.UCharacter.UnicodeBlock HEBREW;
- field public static final int HEBREW_ID = 11; // 0xb
- field public static final android.icu.lang.UCharacter.UnicodeBlock HIGH_PRIVATE_USE_SURROGATES;
- field public static final int HIGH_PRIVATE_USE_SURROGATES_ID = 76; // 0x4c
- field public static final android.icu.lang.UCharacter.UnicodeBlock HIGH_SURROGATES;
- field public static final int HIGH_SURROGATES_ID = 75; // 0x4b
- field public static final android.icu.lang.UCharacter.UnicodeBlock HIRAGANA;
- field public static final int HIRAGANA_ID = 62; // 0x3e
- field public static final android.icu.lang.UCharacter.UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS;
- field public static final int IDEOGRAPHIC_DESCRIPTION_CHARACTERS_ID = 60; // 0x3c
- field public static final android.icu.lang.UCharacter.UnicodeBlock IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION;
- field public static final int IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION_ID = 267; // 0x10b
- field public static final android.icu.lang.UCharacter.UnicodeBlock IMPERIAL_ARAMAIC;
- field public static final int IMPERIAL_ARAMAIC_ID = 186; // 0xba
- field public static final android.icu.lang.UCharacter.UnicodeBlock INDIC_SIYAQ_NUMBERS;
- field public static final int INDIC_SIYAQ_NUMBERS_ID = 286; // 0x11e
- field public static final android.icu.lang.UCharacter.UnicodeBlock INSCRIPTIONAL_PAHLAVI;
- field public static final int INSCRIPTIONAL_PAHLAVI_ID = 190; // 0xbe
- field public static final android.icu.lang.UCharacter.UnicodeBlock INSCRIPTIONAL_PARTHIAN;
- field public static final int INSCRIPTIONAL_PARTHIAN_ID = 189; // 0xbd
- field public static final android.icu.lang.UCharacter.UnicodeBlock INVALID_CODE;
- field public static final int INVALID_CODE_ID = -1; // 0xffffffff
- field public static final android.icu.lang.UCharacter.UnicodeBlock IPA_EXTENSIONS;
- field public static final int IPA_EXTENSIONS_ID = 5; // 0x5
- field public static final android.icu.lang.UCharacter.UnicodeBlock JAVANESE;
- field public static final int JAVANESE_ID = 181; // 0xb5
- field public static final android.icu.lang.UCharacter.UnicodeBlock KAITHI;
- field public static final int KAITHI_ID = 193; // 0xc1
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANA_EXTENDED_A;
- field public static final int KANA_EXTENDED_A_ID = 275; // 0x113
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANA_SUPPLEMENT;
- field public static final int KANA_SUPPLEMENT_ID = 203; // 0xcb
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANBUN;
- field public static final int KANBUN_ID = 66; // 0x42
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANGXI_RADICALS;
- field public static final int KANGXI_RADICALS_ID = 59; // 0x3b
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANNADA;
- field public static final int KANNADA_ID = 22; // 0x16
- field public static final android.icu.lang.UCharacter.UnicodeBlock KATAKANA;
- field public static final int KATAKANA_ID = 63; // 0x3f
- field public static final android.icu.lang.UCharacter.UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS;
- field public static final int KATAKANA_PHONETIC_EXTENSIONS_ID = 107; // 0x6b
- field public static final android.icu.lang.UCharacter.UnicodeBlock KAYAH_LI;
- field public static final int KAYAH_LI_ID = 162; // 0xa2
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHAROSHTHI;
- field public static final int KHAROSHTHI_ID = 137; // 0x89
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHITAN_SMALL_SCRIPT;
- field public static final int KHITAN_SMALL_SCRIPT_ID = 304; // 0x130
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHMER;
- field public static final int KHMER_ID = 36; // 0x24
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHMER_SYMBOLS;
- field public static final int KHMER_SYMBOLS_ID = 113; // 0x71
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHOJKI;
- field public static final int KHOJKI_ID = 229; // 0xe5
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHUDAWADI;
- field public static final int KHUDAWADI_ID = 230; // 0xe6
- field public static final android.icu.lang.UCharacter.UnicodeBlock LAO;
- field public static final int LAO_ID = 26; // 0x1a
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_1_SUPPLEMENT;
- field public static final int LATIN_1_SUPPLEMENT_ID = 2; // 0x2
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_A;
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_ADDITIONAL;
- field public static final int LATIN_EXTENDED_ADDITIONAL_ID = 38; // 0x26
- field public static final int LATIN_EXTENDED_A_ID = 3; // 0x3
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_B;
- field public static final int LATIN_EXTENDED_B_ID = 4; // 0x4
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_C;
- field public static final int LATIN_EXTENDED_C_ID = 148; // 0x94
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_D;
- field public static final int LATIN_EXTENDED_D_ID = 149; // 0x95
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_E;
- field public static final int LATIN_EXTENDED_E_ID = 231; // 0xe7
- field public static final android.icu.lang.UCharacter.UnicodeBlock LEPCHA;
- field public static final int LEPCHA_ID = 156; // 0x9c
- field public static final android.icu.lang.UCharacter.UnicodeBlock LETTERLIKE_SYMBOLS;
- field public static final int LETTERLIKE_SYMBOLS_ID = 44; // 0x2c
- field public static final android.icu.lang.UCharacter.UnicodeBlock LIMBU;
- field public static final int LIMBU_ID = 111; // 0x6f
- field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_A;
- field public static final int LINEAR_A_ID = 232; // 0xe8
- field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_B_IDEOGRAMS;
- field public static final int LINEAR_B_IDEOGRAMS_ID = 118; // 0x76
- field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_B_SYLLABARY;
- field public static final int LINEAR_B_SYLLABARY_ID = 117; // 0x75
- field public static final android.icu.lang.UCharacter.UnicodeBlock LISU;
- field public static final int LISU_ID = 176; // 0xb0
- field public static final android.icu.lang.UCharacter.UnicodeBlock LISU_SUPPLEMENT;
- field public static final int LISU_SUPPLEMENT_ID = 305; // 0x131
- field public static final android.icu.lang.UCharacter.UnicodeBlock LOW_SURROGATES;
- field public static final int LOW_SURROGATES_ID = 77; // 0x4d
- field public static final android.icu.lang.UCharacter.UnicodeBlock LYCIAN;
- field public static final int LYCIAN_ID = 167; // 0xa7
- field public static final android.icu.lang.UCharacter.UnicodeBlock LYDIAN;
- field public static final int LYDIAN_ID = 169; // 0xa9
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAHAJANI;
- field public static final int MAHAJANI_ID = 233; // 0xe9
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAHJONG_TILES;
- field public static final int MAHJONG_TILES_ID = 170; // 0xaa
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAKASAR;
- field public static final int MAKASAR_ID = 287; // 0x11f
- field public static final android.icu.lang.UCharacter.UnicodeBlock MALAYALAM;
- field public static final int MALAYALAM_ID = 23; // 0x17
- field public static final android.icu.lang.UCharacter.UnicodeBlock MANDAIC;
- field public static final int MANDAIC_ID = 198; // 0xc6
- field public static final android.icu.lang.UCharacter.UnicodeBlock MANICHAEAN;
- field public static final int MANICHAEAN_ID = 234; // 0xea
- field public static final android.icu.lang.UCharacter.UnicodeBlock MARCHEN;
- field public static final int MARCHEN_ID = 268; // 0x10c
- field public static final android.icu.lang.UCharacter.UnicodeBlock MASARAM_GONDI;
- field public static final int MASARAM_GONDI_ID = 276; // 0x114
- field public static final android.icu.lang.UCharacter.UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS;
- field public static final int MATHEMATICAL_ALPHANUMERIC_SYMBOLS_ID = 93; // 0x5d
- field public static final android.icu.lang.UCharacter.UnicodeBlock MATHEMATICAL_OPERATORS;
- field public static final int MATHEMATICAL_OPERATORS_ID = 47; // 0x2f
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAYAN_NUMERALS;
- field public static final int MAYAN_NUMERALS_ID = 288; // 0x120
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEDEFAIDRIN;
- field public static final int MEDEFAIDRIN_ID = 289; // 0x121
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEETEI_MAYEK;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEETEI_MAYEK_EXTENSIONS;
- field public static final int MEETEI_MAYEK_EXTENSIONS_ID = 213; // 0xd5
- field public static final int MEETEI_MAYEK_ID = 184; // 0xb8
- field public static final android.icu.lang.UCharacter.UnicodeBlock MENDE_KIKAKUI;
- field public static final int MENDE_KIKAKUI_ID = 235; // 0xeb
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEROITIC_CURSIVE;
- field public static final int MEROITIC_CURSIVE_ID = 214; // 0xd6
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEROITIC_HIEROGLYPHS;
- field public static final int MEROITIC_HIEROGLYPHS_ID = 215; // 0xd7
- field public static final android.icu.lang.UCharacter.UnicodeBlock MIAO;
- field public static final int MIAO_ID = 216; // 0xd8
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A;
- field public static final int MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_ID = 102; // 0x66
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B;
- field public static final int MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_ID = 105; // 0x69
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS;
- field public static final int MISCELLANEOUS_SYMBOLS_AND_ARROWS_ID = 115; // 0x73
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS;
- field public static final int MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_ID = 205; // 0xcd
- field public static final int MISCELLANEOUS_SYMBOLS_ID = 55; // 0x37
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_TECHNICAL;
- field public static final int MISCELLANEOUS_TECHNICAL_ID = 48; // 0x30
- field public static final android.icu.lang.UCharacter.UnicodeBlock MODI;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MODIFIER_TONE_LETTERS;
- field public static final int MODIFIER_TONE_LETTERS_ID = 138; // 0x8a
- field public static final int MODI_ID = 236; // 0xec
- field public static final android.icu.lang.UCharacter.UnicodeBlock MONGOLIAN;
- field public static final int MONGOLIAN_ID = 37; // 0x25
- field public static final android.icu.lang.UCharacter.UnicodeBlock MONGOLIAN_SUPPLEMENT;
- field public static final int MONGOLIAN_SUPPLEMENT_ID = 269; // 0x10d
- field public static final android.icu.lang.UCharacter.UnicodeBlock MRO;
- field public static final int MRO_ID = 237; // 0xed
- field public static final android.icu.lang.UCharacter.UnicodeBlock MULTANI;
- field public static final int MULTANI_ID = 259; // 0x103
- field public static final android.icu.lang.UCharacter.UnicodeBlock MUSICAL_SYMBOLS;
- field public static final int MUSICAL_SYMBOLS_ID = 92; // 0x5c
- field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR_EXTENDED_A;
- field public static final int MYANMAR_EXTENDED_A_ID = 182; // 0xb6
- field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR_EXTENDED_B;
- field public static final int MYANMAR_EXTENDED_B_ID = 238; // 0xee
- field public static final int MYANMAR_ID = 28; // 0x1c
- field public static final android.icu.lang.UCharacter.UnicodeBlock NABATAEAN;
- field public static final int NABATAEAN_ID = 239; // 0xef
- field public static final android.icu.lang.UCharacter.UnicodeBlock NANDINAGARI;
- field public static final int NANDINAGARI_ID = 294; // 0x126
- field public static final android.icu.lang.UCharacter.UnicodeBlock NEWA;
- field public static final int NEWA_ID = 270; // 0x10e
- field public static final android.icu.lang.UCharacter.UnicodeBlock NEW_TAI_LUE;
- field public static final int NEW_TAI_LUE_ID = 139; // 0x8b
- field public static final android.icu.lang.UCharacter.UnicodeBlock NKO;
- field public static final int NKO_ID = 146; // 0x92
- field public static final android.icu.lang.UCharacter.UnicodeBlock NO_BLOCK;
- field public static final android.icu.lang.UCharacter.UnicodeBlock NUMBER_FORMS;
- field public static final int NUMBER_FORMS_ID = 45; // 0x2d
- field public static final android.icu.lang.UCharacter.UnicodeBlock NUSHU;
- field public static final int NUSHU_ID = 277; // 0x115
- field public static final android.icu.lang.UCharacter.UnicodeBlock NYIAKENG_PUACHUE_HMONG;
- field public static final int NYIAKENG_PUACHUE_HMONG_ID = 295; // 0x127
- field public static final android.icu.lang.UCharacter.UnicodeBlock OGHAM;
- field public static final int OGHAM_ID = 34; // 0x22
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_HUNGARIAN;
- field public static final int OLD_HUNGARIAN_ID = 260; // 0x104
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_ITALIC;
- field public static final int OLD_ITALIC_ID = 88; // 0x58
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_NORTH_ARABIAN;
- field public static final int OLD_NORTH_ARABIAN_ID = 240; // 0xf0
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_PERMIC;
- field public static final int OLD_PERMIC_ID = 241; // 0xf1
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_PERSIAN;
- field public static final int OLD_PERSIAN_ID = 140; // 0x8c
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_SOGDIAN;
- field public static final int OLD_SOGDIAN_ID = 290; // 0x122
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_SOUTH_ARABIAN;
- field public static final int OLD_SOUTH_ARABIAN_ID = 187; // 0xbb
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_TURKIC;
- field public static final int OLD_TURKIC_ID = 191; // 0xbf
- field public static final android.icu.lang.UCharacter.UnicodeBlock OL_CHIKI;
- field public static final int OL_CHIKI_ID = 157; // 0x9d
- field public static final android.icu.lang.UCharacter.UnicodeBlock OPTICAL_CHARACTER_RECOGNITION;
- field public static final int OPTICAL_CHARACTER_RECOGNITION_ID = 50; // 0x32
- field public static final android.icu.lang.UCharacter.UnicodeBlock ORIYA;
- field public static final int ORIYA_ID = 19; // 0x13
- field public static final android.icu.lang.UCharacter.UnicodeBlock ORNAMENTAL_DINGBATS;
- field public static final int ORNAMENTAL_DINGBATS_ID = 242; // 0xf2
- field public static final android.icu.lang.UCharacter.UnicodeBlock OSAGE;
- field public static final int OSAGE_ID = 271; // 0x10f
- field public static final android.icu.lang.UCharacter.UnicodeBlock OSMANYA;
- field public static final int OSMANYA_ID = 122; // 0x7a
- field public static final android.icu.lang.UCharacter.UnicodeBlock OTTOMAN_SIYAQ_NUMBERS;
- field public static final int OTTOMAN_SIYAQ_NUMBERS_ID = 296; // 0x128
- field public static final android.icu.lang.UCharacter.UnicodeBlock PAHAWH_HMONG;
- field public static final int PAHAWH_HMONG_ID = 243; // 0xf3
- field public static final android.icu.lang.UCharacter.UnicodeBlock PALMYRENE;
- field public static final int PALMYRENE_ID = 244; // 0xf4
- field public static final android.icu.lang.UCharacter.UnicodeBlock PAU_CIN_HAU;
- field public static final int PAU_CIN_HAU_ID = 245; // 0xf5
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHAGS_PA;
- field public static final int PHAGS_PA_ID = 150; // 0x96
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHAISTOS_DISC;
- field public static final int PHAISTOS_DISC_ID = 166; // 0xa6
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHOENICIAN;
- field public static final int PHOENICIAN_ID = 151; // 0x97
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHONETIC_EXTENSIONS;
- field public static final int PHONETIC_EXTENSIONS_ID = 114; // 0x72
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT;
- field public static final int PHONETIC_EXTENSIONS_SUPPLEMENT_ID = 141; // 0x8d
- field public static final android.icu.lang.UCharacter.UnicodeBlock PLAYING_CARDS;
- field public static final int PLAYING_CARDS_ID = 204; // 0xcc
- field public static final android.icu.lang.UCharacter.UnicodeBlock PRIVATE_USE;
- field public static final android.icu.lang.UCharacter.UnicodeBlock PRIVATE_USE_AREA;
- field public static final int PRIVATE_USE_AREA_ID = 78; // 0x4e
- field public static final int PRIVATE_USE_ID = 78; // 0x4e
- field public static final android.icu.lang.UCharacter.UnicodeBlock PSALTER_PAHLAVI;
- field public static final int PSALTER_PAHLAVI_ID = 246; // 0xf6
- field public static final android.icu.lang.UCharacter.UnicodeBlock REJANG;
- field public static final int REJANG_ID = 163; // 0xa3
- field public static final android.icu.lang.UCharacter.UnicodeBlock RUMI_NUMERAL_SYMBOLS;
- field public static final int RUMI_NUMERAL_SYMBOLS_ID = 192; // 0xc0
- field public static final android.icu.lang.UCharacter.UnicodeBlock RUNIC;
- field public static final int RUNIC_ID = 35; // 0x23
- field public static final android.icu.lang.UCharacter.UnicodeBlock SAMARITAN;
- field public static final int SAMARITAN_ID = 172; // 0xac
- field public static final android.icu.lang.UCharacter.UnicodeBlock SAURASHTRA;
- field public static final int SAURASHTRA_ID = 161; // 0xa1
- field public static final android.icu.lang.UCharacter.UnicodeBlock SHARADA;
- field public static final int SHARADA_ID = 217; // 0xd9
- field public static final android.icu.lang.UCharacter.UnicodeBlock SHAVIAN;
- field public static final int SHAVIAN_ID = 121; // 0x79
- field public static final android.icu.lang.UCharacter.UnicodeBlock SHORTHAND_FORMAT_CONTROLS;
- field public static final int SHORTHAND_FORMAT_CONTROLS_ID = 247; // 0xf7
- field public static final android.icu.lang.UCharacter.UnicodeBlock SIDDHAM;
- field public static final int SIDDHAM_ID = 248; // 0xf8
- field public static final android.icu.lang.UCharacter.UnicodeBlock SINHALA;
- field public static final android.icu.lang.UCharacter.UnicodeBlock SINHALA_ARCHAIC_NUMBERS;
- field public static final int SINHALA_ARCHAIC_NUMBERS_ID = 249; // 0xf9
- field public static final int SINHALA_ID = 24; // 0x18
- field public static final android.icu.lang.UCharacter.UnicodeBlock SMALL_FORM_VARIANTS;
- field public static final int SMALL_FORM_VARIANTS_ID = 84; // 0x54
- field public static final android.icu.lang.UCharacter.UnicodeBlock SMALL_KANA_EXTENSION;
- field public static final int SMALL_KANA_EXTENSION_ID = 297; // 0x129
- field public static final android.icu.lang.UCharacter.UnicodeBlock SOGDIAN;
- field public static final int SOGDIAN_ID = 291; // 0x123
- field public static final android.icu.lang.UCharacter.UnicodeBlock SORA_SOMPENG;
- field public static final int SORA_SOMPENG_ID = 218; // 0xda
- field public static final android.icu.lang.UCharacter.UnicodeBlock SOYOMBO;
- field public static final int SOYOMBO_ID = 278; // 0x116
- field public static final android.icu.lang.UCharacter.UnicodeBlock SPACING_MODIFIER_LETTERS;
- field public static final int SPACING_MODIFIER_LETTERS_ID = 6; // 0x6
- field public static final android.icu.lang.UCharacter.UnicodeBlock SPECIALS;
- field public static final int SPECIALS_ID = 86; // 0x56
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUNDANESE;
- field public static final int SUNDANESE_ID = 155; // 0x9b
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUNDANESE_SUPPLEMENT;
- field public static final int SUNDANESE_SUPPLEMENT_ID = 219; // 0xdb
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS;
- field public static final int SUPERSCRIPTS_AND_SUBSCRIPTS_ID = 41; // 0x29
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_A;
- field public static final int SUPPLEMENTAL_ARROWS_A_ID = 103; // 0x67
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_B;
- field public static final int SUPPLEMENTAL_ARROWS_B_ID = 104; // 0x68
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_C;
- field public static final int SUPPLEMENTAL_ARROWS_C_ID = 250; // 0xfa
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS;
- field public static final int SUPPLEMENTAL_MATHEMATICAL_OPERATORS_ID = 106; // 0x6a
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_PUNCTUATION;
- field public static final int SUPPLEMENTAL_PUNCTUATION_ID = 142; // 0x8e
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS;
- field public static final int SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS_ID = 261; // 0x105
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A;
- field public static final int SUPPLEMENTARY_PRIVATE_USE_AREA_A_ID = 109; // 0x6d
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B;
- field public static final int SUPPLEMENTARY_PRIVATE_USE_AREA_B_ID = 110; // 0x6e
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUTTON_SIGNWRITING;
- field public static final int SUTTON_SIGNWRITING_ID = 262; // 0x106
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYLOTI_NAGRI;
- field public static final int SYLOTI_NAGRI_ID = 143; // 0x8f
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A;
- field public static final int SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A_ID = 298; // 0x12a
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYMBOLS_FOR_LEGACY_COMPUTING;
- field public static final int SYMBOLS_FOR_LEGACY_COMPUTING_ID = 306; // 0x132
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYRIAC;
- field public static final int SYRIAC_ID = 13; // 0xd
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYRIAC_SUPPLEMENT;
- field public static final int SYRIAC_SUPPLEMENT_ID = 279; // 0x117
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAGALOG;
- field public static final int TAGALOG_ID = 98; // 0x62
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAGBANWA;
- field public static final int TAGBANWA_ID = 101; // 0x65
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAGS;
- field public static final int TAGS_ID = 96; // 0x60
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_LE;
- field public static final int TAI_LE_ID = 112; // 0x70
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_THAM;
- field public static final int TAI_THAM_ID = 174; // 0xae
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_VIET;
- field public static final int TAI_VIET_ID = 183; // 0xb7
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_XUAN_JING_SYMBOLS;
- field public static final int TAI_XUAN_JING_SYMBOLS_ID = 124; // 0x7c
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAKRI;
- field public static final int TAKRI_ID = 220; // 0xdc
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAMIL;
- field public static final int TAMIL_ID = 20; // 0x14
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAMIL_SUPPLEMENT;
- field public static final int TAMIL_SUPPLEMENT_ID = 299; // 0x12b
- field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT;
- field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT_COMPONENTS;
- field public static final int TANGUT_COMPONENTS_ID = 273; // 0x111
- field public static final int TANGUT_ID = 272; // 0x110
- field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT_SUPPLEMENT;
- field public static final int TANGUT_SUPPLEMENT_ID = 307; // 0x133
- field public static final android.icu.lang.UCharacter.UnicodeBlock TELUGU;
- field public static final int TELUGU_ID = 21; // 0x15
- field public static final android.icu.lang.UCharacter.UnicodeBlock THAANA;
- field public static final int THAANA_ID = 14; // 0xe
- field public static final android.icu.lang.UCharacter.UnicodeBlock THAI;
- field public static final int THAI_ID = 25; // 0x19
- field public static final android.icu.lang.UCharacter.UnicodeBlock TIBETAN;
- field public static final int TIBETAN_ID = 27; // 0x1b
- field public static final android.icu.lang.UCharacter.UnicodeBlock TIFINAGH;
- field public static final int TIFINAGH_ID = 144; // 0x90
- field public static final android.icu.lang.UCharacter.UnicodeBlock TIRHUTA;
- field public static final int TIRHUTA_ID = 251; // 0xfb
- field public static final android.icu.lang.UCharacter.UnicodeBlock TRANSPORT_AND_MAP_SYMBOLS;
- field public static final int TRANSPORT_AND_MAP_SYMBOLS_ID = 207; // 0xcf
- field public static final android.icu.lang.UCharacter.UnicodeBlock UGARITIC;
- field public static final int UGARITIC_ID = 120; // 0x78
- field public static final android.icu.lang.UCharacter.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED;
- field public static final int UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_ID = 173; // 0xad
- field public static final int UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_ID = 33; // 0x21
- field public static final android.icu.lang.UCharacter.UnicodeBlock VAI;
- field public static final int VAI_ID = 159; // 0x9f
- field public static final android.icu.lang.UCharacter.UnicodeBlock VARIATION_SELECTORS;
- field public static final int VARIATION_SELECTORS_ID = 108; // 0x6c
- field public static final android.icu.lang.UCharacter.UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT;
- field public static final int VARIATION_SELECTORS_SUPPLEMENT_ID = 125; // 0x7d
- field public static final android.icu.lang.UCharacter.UnicodeBlock VEDIC_EXTENSIONS;
- field public static final int VEDIC_EXTENSIONS_ID = 175; // 0xaf
- field public static final android.icu.lang.UCharacter.UnicodeBlock VERTICAL_FORMS;
- field public static final int VERTICAL_FORMS_ID = 145; // 0x91
- field public static final android.icu.lang.UCharacter.UnicodeBlock WANCHO;
- field public static final int WANCHO_ID = 300; // 0x12c
- field public static final android.icu.lang.UCharacter.UnicodeBlock WARANG_CITI;
- field public static final int WARANG_CITI_ID = 252; // 0xfc
- field public static final android.icu.lang.UCharacter.UnicodeBlock YEZIDI;
- field public static final int YEZIDI_ID = 308; // 0x134
- field public static final android.icu.lang.UCharacter.UnicodeBlock YIJING_HEXAGRAM_SYMBOLS;
- field public static final int YIJING_HEXAGRAM_SYMBOLS_ID = 116; // 0x74
- field public static final android.icu.lang.UCharacter.UnicodeBlock YI_RADICALS;
- field public static final int YI_RADICALS_ID = 73; // 0x49
- field public static final android.icu.lang.UCharacter.UnicodeBlock YI_SYLLABLES;
- field public static final int YI_SYLLABLES_ID = 72; // 0x48
- field public static final android.icu.lang.UCharacter.UnicodeBlock ZANABAZAR_SQUARE;
- field public static final int ZANABAZAR_SQUARE_ID = 280; // 0x118
- }
-
- public static interface UCharacter.VerticalOrientation {
- field public static final int ROTATED = 0; // 0x0
- field public static final int TRANSFORMED_ROTATED = 1; // 0x1
- field public static final int TRANSFORMED_UPRIGHT = 2; // 0x2
- field public static final int UPRIGHT = 3; // 0x3
- }
-
- public static interface UCharacter.WordBreak {
- field public static final int ALETTER = 1; // 0x1
- field public static final int CR = 8; // 0x8
- field public static final int DOUBLE_QUOTE = 16; // 0x10
- field public static final int EXTEND = 9; // 0x9
- field public static final int EXTENDNUMLET = 7; // 0x7
- field public static final int E_BASE = 17; // 0x11
- field public static final int E_BASE_GAZ = 18; // 0x12
- field public static final int E_MODIFIER = 19; // 0x13
- field public static final int FORMAT = 2; // 0x2
- field public static final int GLUE_AFTER_ZWJ = 20; // 0x14
- field public static final int HEBREW_LETTER = 14; // 0xe
- field public static final int KATAKANA = 3; // 0x3
- field public static final int LF = 10; // 0xa
- field public static final int MIDLETTER = 4; // 0x4
- field public static final int MIDNUM = 5; // 0x5
- field public static final int MIDNUMLET = 11; // 0xb
- field public static final int NEWLINE = 12; // 0xc
- field public static final int NUMERIC = 6; // 0x6
- field public static final int OTHER = 0; // 0x0
- field public static final int REGIONAL_INDICATOR = 13; // 0xd
- field public static final int SINGLE_QUOTE = 15; // 0xf
- field public static final int WSEGSPACE = 22; // 0x16
- field public static final int ZWJ = 21; // 0x15
- }
-
- public final class UCharacterCategory implements android.icu.lang.UCharacterEnums.ECharacterCategory {
- method public static String toString(int);
- }
-
- public final class UCharacterDirection implements android.icu.lang.UCharacterEnums.ECharacterDirection {
- method public static String toString(int);
- }
-
- public class UCharacterEnums {
- }
-
- public static interface UCharacterEnums.ECharacterCategory {
- field public static final byte COMBINING_SPACING_MARK = 8; // 0x8
- field public static final byte CONNECTOR_PUNCTUATION = 22; // 0x16
- field public static final byte CONTROL = 15; // 0xf
- field public static final byte CURRENCY_SYMBOL = 25; // 0x19
- field public static final byte DASH_PUNCTUATION = 19; // 0x13
- field public static final byte DECIMAL_DIGIT_NUMBER = 9; // 0x9
- field public static final byte ENCLOSING_MARK = 7; // 0x7
- field public static final byte END_PUNCTUATION = 21; // 0x15
- field public static final byte FINAL_PUNCTUATION = 29; // 0x1d
- field public static final byte FINAL_QUOTE_PUNCTUATION = 29; // 0x1d
- field public static final byte FORMAT = 16; // 0x10
- field public static final byte GENERAL_OTHER_TYPES = 0; // 0x0
- field public static final byte INITIAL_PUNCTUATION = 28; // 0x1c
- field public static final byte INITIAL_QUOTE_PUNCTUATION = 28; // 0x1c
- field public static final byte LETTER_NUMBER = 10; // 0xa
- field public static final byte LINE_SEPARATOR = 13; // 0xd
- field public static final byte LOWERCASE_LETTER = 2; // 0x2
- field public static final byte MATH_SYMBOL = 24; // 0x18
- field public static final byte MODIFIER_LETTER = 4; // 0x4
- field public static final byte MODIFIER_SYMBOL = 26; // 0x1a
- field public static final byte NON_SPACING_MARK = 6; // 0x6
- field public static final byte OTHER_LETTER = 5; // 0x5
- field public static final byte OTHER_NUMBER = 11; // 0xb
- field public static final byte OTHER_PUNCTUATION = 23; // 0x17
- field public static final byte OTHER_SYMBOL = 27; // 0x1b
- field public static final byte PARAGRAPH_SEPARATOR = 14; // 0xe
- field public static final byte PRIVATE_USE = 17; // 0x11
- field public static final byte SPACE_SEPARATOR = 12; // 0xc
- field public static final byte START_PUNCTUATION = 20; // 0x14
- field public static final byte SURROGATE = 18; // 0x12
- field public static final byte TITLECASE_LETTER = 3; // 0x3
- field public static final byte UNASSIGNED = 0; // 0x0
- field public static final byte UPPERCASE_LETTER = 1; // 0x1
- }
-
- public static interface UCharacterEnums.ECharacterDirection {
- field public static final int ARABIC_NUMBER = 5; // 0x5
- field public static final int BLOCK_SEPARATOR = 7; // 0x7
- field public static final int BOUNDARY_NEUTRAL = 18; // 0x12
- field public static final int COMMON_NUMBER_SEPARATOR = 6; // 0x6
- field public static final byte DIRECTIONALITY_ARABIC_NUMBER = 5; // 0x5
- field public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = 18; // 0x12
- field public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = 6; // 0x6
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = 2; // 0x2
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = 3; // 0x3
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = 4; // 0x4
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = 0; // 0x0
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = 11; // 0xb
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = 12; // 0xc
- field public static final byte DIRECTIONALITY_NONSPACING_MARK = 17; // 0x11
- field public static final byte DIRECTIONALITY_OTHER_NEUTRALS = 10; // 0xa
- field public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = 7; // 0x7
- field public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 16; // 0x10
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = 1; // 0x1
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = 13; // 0xd
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = 14; // 0xe
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = 15; // 0xf
- field public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = 8; // 0x8
- field public static final byte DIRECTIONALITY_UNDEFINED = -1; // 0xffffffff
- field public static final byte DIRECTIONALITY_WHITESPACE = 9; // 0x9
- field public static final int DIR_NON_SPACING_MARK = 17; // 0x11
- field public static final int EUROPEAN_NUMBER = 2; // 0x2
- field public static final int EUROPEAN_NUMBER_SEPARATOR = 3; // 0x3
- field public static final int EUROPEAN_NUMBER_TERMINATOR = 4; // 0x4
- field public static final byte FIRST_STRONG_ISOLATE = 19; // 0x13
- field public static final int LEFT_TO_RIGHT = 0; // 0x0
- field public static final int LEFT_TO_RIGHT_EMBEDDING = 11; // 0xb
- field public static final byte LEFT_TO_RIGHT_ISOLATE = 20; // 0x14
- field public static final int LEFT_TO_RIGHT_OVERRIDE = 12; // 0xc
- field public static final int OTHER_NEUTRAL = 10; // 0xa
- field public static final int POP_DIRECTIONAL_FORMAT = 16; // 0x10
- field public static final byte POP_DIRECTIONAL_ISOLATE = 22; // 0x16
- field public static final int RIGHT_TO_LEFT = 1; // 0x1
- field public static final int RIGHT_TO_LEFT_ARABIC = 13; // 0xd
- field public static final int RIGHT_TO_LEFT_EMBEDDING = 14; // 0xe
- field public static final byte RIGHT_TO_LEFT_ISOLATE = 21; // 0x15
- field public static final int RIGHT_TO_LEFT_OVERRIDE = 15; // 0xf
- field public static final int SEGMENT_SEPARATOR = 8; // 0x8
- field public static final int WHITE_SPACE_NEUTRAL = 9; // 0x9
- }
-
- public interface UProperty {
- field public static final int AGE = 16384; // 0x4000
- field public static final int ALPHABETIC = 0; // 0x0
- field public static final int ASCII_HEX_DIGIT = 1; // 0x1
- field public static final int BIDI_CLASS = 4096; // 0x1000
- field public static final int BIDI_CONTROL = 2; // 0x2
- field public static final int BIDI_MIRRORED = 3; // 0x3
- field public static final int BIDI_MIRRORING_GLYPH = 16385; // 0x4001
- field public static final int BIDI_PAIRED_BRACKET = 16397; // 0x400d
- field public static final int BIDI_PAIRED_BRACKET_TYPE = 4117; // 0x1015
- field public static final int BINARY_START = 0; // 0x0
- field public static final int BLOCK = 4097; // 0x1001
- field public static final int CANONICAL_COMBINING_CLASS = 4098; // 0x1002
- field public static final int CASED = 49; // 0x31
- field public static final int CASE_FOLDING = 16386; // 0x4002
- field public static final int CASE_IGNORABLE = 50; // 0x32
- field public static final int CASE_SENSITIVE = 34; // 0x22
- field public static final int CHANGES_WHEN_CASEFOLDED = 54; // 0x36
- field public static final int CHANGES_WHEN_CASEMAPPED = 55; // 0x37
- field public static final int CHANGES_WHEN_LOWERCASED = 51; // 0x33
- field public static final int CHANGES_WHEN_NFKC_CASEFOLDED = 56; // 0x38
- field public static final int CHANGES_WHEN_TITLECASED = 53; // 0x35
- field public static final int CHANGES_WHEN_UPPERCASED = 52; // 0x34
- field public static final int DASH = 4; // 0x4
- field public static final int DECOMPOSITION_TYPE = 4099; // 0x1003
- field public static final int DEFAULT_IGNORABLE_CODE_POINT = 5; // 0x5
- field public static final int DEPRECATED = 6; // 0x6
- field public static final int DIACRITIC = 7; // 0x7
- field public static final int DOUBLE_START = 12288; // 0x3000
- field public static final int EAST_ASIAN_WIDTH = 4100; // 0x1004
- field public static final int EMOJI = 57; // 0x39
- field public static final int EMOJI_COMPONENT = 61; // 0x3d
- field public static final int EMOJI_MODIFIER = 59; // 0x3b
- field public static final int EMOJI_MODIFIER_BASE = 60; // 0x3c
- field public static final int EMOJI_PRESENTATION = 58; // 0x3a
- field public static final int EXTENDED_PICTOGRAPHIC = 64; // 0x40
- field public static final int EXTENDER = 8; // 0x8
- field public static final int FULL_COMPOSITION_EXCLUSION = 9; // 0x9
- field public static final int GENERAL_CATEGORY = 4101; // 0x1005
- field public static final int GENERAL_CATEGORY_MASK = 8192; // 0x2000
- field public static final int GRAPHEME_BASE = 10; // 0xa
- field public static final int GRAPHEME_CLUSTER_BREAK = 4114; // 0x1012
- field public static final int GRAPHEME_EXTEND = 11; // 0xb
- field public static final int GRAPHEME_LINK = 12; // 0xc
- field public static final int HANGUL_SYLLABLE_TYPE = 4107; // 0x100b
- field public static final int HEX_DIGIT = 13; // 0xd
- field public static final int HYPHEN = 14; // 0xe
- field public static final int IDEOGRAPHIC = 17; // 0x11
- field public static final int IDS_BINARY_OPERATOR = 18; // 0x12
- field public static final int IDS_TRINARY_OPERATOR = 19; // 0x13
- field public static final int ID_CONTINUE = 15; // 0xf
- field public static final int ID_START = 16; // 0x10
- field public static final int INDIC_POSITIONAL_CATEGORY = 4118; // 0x1016
- field public static final int INDIC_SYLLABIC_CATEGORY = 4119; // 0x1017
- field public static final int INT_START = 4096; // 0x1000
- field public static final int JOINING_GROUP = 4102; // 0x1006
- field public static final int JOINING_TYPE = 4103; // 0x1007
- field public static final int JOIN_CONTROL = 20; // 0x14
- field public static final int LEAD_CANONICAL_COMBINING_CLASS = 4112; // 0x1010
- field public static final int LINE_BREAK = 4104; // 0x1008
- field public static final int LOGICAL_ORDER_EXCEPTION = 21; // 0x15
- field public static final int LOWERCASE = 22; // 0x16
- field public static final int LOWERCASE_MAPPING = 16388; // 0x4004
- field public static final int MASK_START = 8192; // 0x2000
- field public static final int MATH = 23; // 0x17
- field public static final int NAME = 16389; // 0x4005
- field public static final int NFC_INERT = 39; // 0x27
- field public static final int NFC_QUICK_CHECK = 4110; // 0x100e
- field public static final int NFD_INERT = 37; // 0x25
- field public static final int NFD_QUICK_CHECK = 4108; // 0x100c
- field public static final int NFKC_INERT = 40; // 0x28
- field public static final int NFKC_QUICK_CHECK = 4111; // 0x100f
- field public static final int NFKD_INERT = 38; // 0x26
- field public static final int NFKD_QUICK_CHECK = 4109; // 0x100d
- field public static final int NONCHARACTER_CODE_POINT = 24; // 0x18
- field public static final int NUMERIC_TYPE = 4105; // 0x1009
- field public static final int NUMERIC_VALUE = 12288; // 0x3000
- field public static final int OTHER_PROPERTY_START = 28672; // 0x7000
- field public static final int PATTERN_SYNTAX = 42; // 0x2a
- field public static final int PATTERN_WHITE_SPACE = 43; // 0x2b
- field public static final int POSIX_ALNUM = 44; // 0x2c
- field public static final int POSIX_BLANK = 45; // 0x2d
- field public static final int POSIX_GRAPH = 46; // 0x2e
- field public static final int POSIX_PRINT = 47; // 0x2f
- field public static final int POSIX_XDIGIT = 48; // 0x30
- field public static final int PREPENDED_CONCATENATION_MARK = 63; // 0x3f
- field public static final int QUOTATION_MARK = 25; // 0x19
- field public static final int RADICAL = 26; // 0x1a
- field public static final int REGIONAL_INDICATOR = 62; // 0x3e
- field public static final int SCRIPT = 4106; // 0x100a
- field public static final int SCRIPT_EXTENSIONS = 28672; // 0x7000
- field public static final int SEGMENT_STARTER = 41; // 0x29
- field public static final int SENTENCE_BREAK = 4115; // 0x1013
- field public static final int SIMPLE_CASE_FOLDING = 16390; // 0x4006
- field public static final int SIMPLE_LOWERCASE_MAPPING = 16391; // 0x4007
- field public static final int SIMPLE_TITLECASE_MAPPING = 16392; // 0x4008
- field public static final int SIMPLE_UPPERCASE_MAPPING = 16393; // 0x4009
- field public static final int SOFT_DOTTED = 27; // 0x1b
- field public static final int STRING_START = 16384; // 0x4000
- field public static final int S_TERM = 35; // 0x23
- field public static final int TERMINAL_PUNCTUATION = 28; // 0x1c
- field public static final int TITLECASE_MAPPING = 16394; // 0x400a
- field public static final int TRAIL_CANONICAL_COMBINING_CLASS = 4113; // 0x1011
- field public static final int UNIFIED_IDEOGRAPH = 29; // 0x1d
- field public static final int UPPERCASE = 30; // 0x1e
- field public static final int UPPERCASE_MAPPING = 16396; // 0x400c
- field public static final int VARIATION_SELECTOR = 36; // 0x24
- field public static final int VERTICAL_ORIENTATION = 4120; // 0x1018
- field public static final int WHITE_SPACE = 31; // 0x1f
- field public static final int WORD_BREAK = 4116; // 0x1014
- field public static final int XID_CONTINUE = 32; // 0x20
- field public static final int XID_START = 33; // 0x21
- }
-
- public static interface UProperty.NameChoice {
- field public static final int LONG = 1; // 0x1
- field public static final int SHORT = 0; // 0x0
- }
-
- public final class UScript {
- method public static boolean breaksBetweenLetters(int);
- method public static int[] getCode(java.util.Locale);
- method public static int[] getCode(android.icu.util.ULocale);
- method public static int[] getCode(String);
- method public static int getCodeFromName(String);
- method public static String getName(int);
- method public static String getSampleString(int);
- method public static int getScript(int);
- method public static int getScriptExtensions(int, java.util.BitSet);
- method public static String getShortName(int);
- method public static android.icu.lang.UScript.ScriptUsage getUsage(int);
- method public static boolean hasScript(int, int);
- method public static boolean isCased(int);
- method public static boolean isRightToLeft(int);
- field public static final int ADLAM = 167; // 0xa7
- field public static final int AFAKA = 147; // 0x93
- field public static final int AHOM = 161; // 0xa1
- field public static final int ANATOLIAN_HIEROGLYPHS = 156; // 0x9c
- field public static final int ARABIC = 2; // 0x2
- field public static final int ARMENIAN = 3; // 0x3
- field public static final int AVESTAN = 117; // 0x75
- field public static final int BALINESE = 62; // 0x3e
- field public static final int BAMUM = 130; // 0x82
- field public static final int BASSA_VAH = 134; // 0x86
- field public static final int BATAK = 63; // 0x3f
- field public static final int BENGALI = 4; // 0x4
- field public static final int BHAIKSUKI = 168; // 0xa8
- field public static final int BLISSYMBOLS = 64; // 0x40
- field public static final int BOOK_PAHLAVI = 124; // 0x7c
- field public static final int BOPOMOFO = 5; // 0x5
- field public static final int BRAHMI = 65; // 0x41
- field public static final int BRAILLE = 46; // 0x2e
- field public static final int BUGINESE = 55; // 0x37
- field public static final int BUHID = 44; // 0x2c
- field public static final int CANADIAN_ABORIGINAL = 40; // 0x28
- field public static final int CARIAN = 104; // 0x68
- field public static final int CAUCASIAN_ALBANIAN = 159; // 0x9f
- field public static final int CHAKMA = 118; // 0x76
- field public static final int CHAM = 66; // 0x42
- field public static final int CHEROKEE = 6; // 0x6
- field public static final int CHORASMIAN = 189; // 0xbd
- field public static final int CIRTH = 67; // 0x43
- field public static final int COMMON = 0; // 0x0
- field public static final int COPTIC = 7; // 0x7
- field public static final int CUNEIFORM = 101; // 0x65
- field public static final int CYPRIOT = 47; // 0x2f
- field public static final int CYRILLIC = 8; // 0x8
- field public static final int DEMOTIC_EGYPTIAN = 69; // 0x45
- field public static final int DESERET = 9; // 0x9
- field public static final int DEVANAGARI = 10; // 0xa
- field public static final int DIVES_AKURU = 190; // 0xbe
- field public static final int DOGRA = 178; // 0xb2
- field public static final int DUPLOYAN = 135; // 0x87
- field public static final int EASTERN_SYRIAC = 97; // 0x61
- field public static final int EGYPTIAN_HIEROGLYPHS = 71; // 0x47
- field public static final int ELBASAN = 136; // 0x88
- field public static final int ELYMAIC = 185; // 0xb9
- field public static final int ESTRANGELO_SYRIAC = 95; // 0x5f
- field public static final int ETHIOPIC = 11; // 0xb
- field public static final int GEORGIAN = 12; // 0xc
- field public static final int GLAGOLITIC = 56; // 0x38
- field public static final int GOTHIC = 13; // 0xd
- field public static final int GRANTHA = 137; // 0x89
- field public static final int GREEK = 14; // 0xe
- field public static final int GUJARATI = 15; // 0xf
- field public static final int GUNJALA_GONDI = 179; // 0xb3
- field public static final int GURMUKHI = 16; // 0x10
- field public static final int HAN = 17; // 0x11
- field public static final int HANGUL = 18; // 0x12
- field public static final int HANIFI_ROHINGYA = 182; // 0xb6
- field public static final int HANUNOO = 43; // 0x2b
- field public static final int HAN_WITH_BOPOMOFO = 172; // 0xac
- field public static final int HARAPPAN_INDUS = 77; // 0x4d
- field public static final int HATRAN = 162; // 0xa2
- field public static final int HEBREW = 19; // 0x13
- field public static final int HIERATIC_EGYPTIAN = 70; // 0x46
- field public static final int HIRAGANA = 20; // 0x14
- field public static final int IMPERIAL_ARAMAIC = 116; // 0x74
- field public static final int INHERITED = 1; // 0x1
- field public static final int INSCRIPTIONAL_PAHLAVI = 122; // 0x7a
- field public static final int INSCRIPTIONAL_PARTHIAN = 125; // 0x7d
- field public static final int INVALID_CODE = -1; // 0xffffffff
- field public static final int JAMO = 173; // 0xad
- field public static final int JAPANESE = 105; // 0x69
- field public static final int JAVANESE = 78; // 0x4e
- field public static final int JURCHEN = 148; // 0x94
- field public static final int KAITHI = 120; // 0x78
- field public static final int KANNADA = 21; // 0x15
- field public static final int KATAKANA = 22; // 0x16
- field public static final int KATAKANA_OR_HIRAGANA = 54; // 0x36
- field public static final int KAYAH_LI = 79; // 0x4f
- field public static final int KHAROSHTHI = 57; // 0x39
- field public static final int KHITAN_SMALL_SCRIPT = 191; // 0xbf
- field public static final int KHMER = 23; // 0x17
- field public static final int KHOJKI = 157; // 0x9d
- field public static final int KHUDAWADI = 145; // 0x91
- field public static final int KHUTSURI = 72; // 0x48
- field public static final int KOREAN = 119; // 0x77
- field public static final int KPELLE = 138; // 0x8a
- field public static final int LANNA = 106; // 0x6a
- field public static final int LAO = 24; // 0x18
- field public static final int LATIN = 25; // 0x19
- field public static final int LATIN_FRAKTUR = 80; // 0x50
- field public static final int LATIN_GAELIC = 81; // 0x51
- field public static final int LEPCHA = 82; // 0x52
- field public static final int LIMBU = 48; // 0x30
- field public static final int LINEAR_A = 83; // 0x53
- field public static final int LINEAR_B = 49; // 0x31
- field public static final int LISU = 131; // 0x83
- field public static final int LOMA = 139; // 0x8b
- field public static final int LYCIAN = 107; // 0x6b
- field public static final int LYDIAN = 108; // 0x6c
- field public static final int MAHAJANI = 160; // 0xa0
- field public static final int MAKASAR = 180; // 0xb4
- field public static final int MALAYALAM = 26; // 0x1a
- field public static final int MANDAEAN = 84; // 0x54
- field public static final int MANDAIC = 84; // 0x54
- field public static final int MANICHAEAN = 121; // 0x79
- field public static final int MARCHEN = 169; // 0xa9
- field public static final int MASARAM_GONDI = 175; // 0xaf
- field public static final int MATHEMATICAL_NOTATION = 128; // 0x80
- field public static final int MAYAN_HIEROGLYPHS = 85; // 0x55
- field public static final int MEDEFAIDRIN = 181; // 0xb5
- field public static final int MEITEI_MAYEK = 115; // 0x73
- field public static final int MENDE = 140; // 0x8c
- field public static final int MEROITIC = 86; // 0x56
- field public static final int MEROITIC_CURSIVE = 141; // 0x8d
- field public static final int MEROITIC_HIEROGLYPHS = 86; // 0x56
- field public static final int MIAO = 92; // 0x5c
- field public static final int MODI = 163; // 0xa3
- field public static final int MONGOLIAN = 27; // 0x1b
- field public static final int MOON = 114; // 0x72
- field public static final int MRO = 149; // 0x95
- field public static final int MULTANI = 164; // 0xa4
- field public static final int MYANMAR = 28; // 0x1c
- field public static final int NABATAEAN = 143; // 0x8f
- field public static final int NAKHI_GEBA = 132; // 0x84
- field public static final int NANDINAGARI = 187; // 0xbb
- field public static final int NEWA = 170; // 0xaa
- field public static final int NEW_TAI_LUE = 59; // 0x3b
- field public static final int NKO = 87; // 0x57
- field public static final int NUSHU = 150; // 0x96
- field public static final int NYIAKENG_PUACHUE_HMONG = 186; // 0xba
- field public static final int OGHAM = 29; // 0x1d
- field public static final int OLD_CHURCH_SLAVONIC_CYRILLIC = 68; // 0x44
- field public static final int OLD_HUNGARIAN = 76; // 0x4c
- field public static final int OLD_ITALIC = 30; // 0x1e
- field public static final int OLD_NORTH_ARABIAN = 142; // 0x8e
- field public static final int OLD_PERMIC = 89; // 0x59
- field public static final int OLD_PERSIAN = 61; // 0x3d
- field public static final int OLD_SOGDIAN = 184; // 0xb8
- field public static final int OLD_SOUTH_ARABIAN = 133; // 0x85
- field public static final int OL_CHIKI = 109; // 0x6d
- field public static final int ORIYA = 31; // 0x1f
- field public static final int ORKHON = 88; // 0x58
- field public static final int OSAGE = 171; // 0xab
- field public static final int OSMANYA = 50; // 0x32
- field public static final int PAHAWH_HMONG = 75; // 0x4b
- field public static final int PALMYRENE = 144; // 0x90
- field public static final int PAU_CIN_HAU = 165; // 0xa5
- field public static final int PHAGS_PA = 90; // 0x5a
- field public static final int PHOENICIAN = 91; // 0x5b
- field public static final int PHONETIC_POLLARD = 92; // 0x5c
- field public static final int PSALTER_PAHLAVI = 123; // 0x7b
- field public static final int REJANG = 110; // 0x6e
- field public static final int RONGORONGO = 93; // 0x5d
- field public static final int RUNIC = 32; // 0x20
- field public static final int SAMARITAN = 126; // 0x7e
- field public static final int SARATI = 94; // 0x5e
- field public static final int SAURASHTRA = 111; // 0x6f
- field public static final int SHARADA = 151; // 0x97
- field public static final int SHAVIAN = 51; // 0x33
- field public static final int SIDDHAM = 166; // 0xa6
- field public static final int SIGN_WRITING = 112; // 0x70
- field public static final int SIMPLIFIED_HAN = 73; // 0x49
- field public static final int SINDHI = 145; // 0x91
- field public static final int SINHALA = 33; // 0x21
- field public static final int SOGDIAN = 183; // 0xb7
- field public static final int SORA_SOMPENG = 152; // 0x98
- field public static final int SOYOMBO = 176; // 0xb0
- field public static final int SUNDANESE = 113; // 0x71
- field public static final int SYLOTI_NAGRI = 58; // 0x3a
- field public static final int SYMBOLS = 129; // 0x81
- field public static final int SYMBOLS_EMOJI = 174; // 0xae
- field public static final int SYRIAC = 34; // 0x22
- field public static final int TAGALOG = 42; // 0x2a
- field public static final int TAGBANWA = 45; // 0x2d
- field public static final int TAI_LE = 52; // 0x34
- field public static final int TAI_VIET = 127; // 0x7f
- field public static final int TAKRI = 153; // 0x99
- field public static final int TAMIL = 35; // 0x23
- field public static final int TANGUT = 154; // 0x9a
- field public static final int TELUGU = 36; // 0x24
- field public static final int TENGWAR = 98; // 0x62
- field public static final int THAANA = 37; // 0x25
- field public static final int THAI = 38; // 0x26
- field public static final int TIBETAN = 39; // 0x27
- field public static final int TIFINAGH = 60; // 0x3c
- field public static final int TIRHUTA = 158; // 0x9e
- field public static final int TRADITIONAL_HAN = 74; // 0x4a
- field public static final int UCAS = 40; // 0x28
- field public static final int UGARITIC = 53; // 0x35
- field public static final int UNKNOWN = 103; // 0x67
- field public static final int UNWRITTEN_LANGUAGES = 102; // 0x66
- field public static final int VAI = 99; // 0x63
- field public static final int VISIBLE_SPEECH = 100; // 0x64
- field public static final int WANCHO = 188; // 0xbc
- field public static final int WARANG_CITI = 146; // 0x92
- field public static final int WESTERN_SYRIAC = 96; // 0x60
- field public static final int WOLEAI = 155; // 0x9b
- field public static final int YEZIDI = 192; // 0xc0
- field public static final int YI = 41; // 0x29
- field public static final int ZANABAZAR_SQUARE = 177; // 0xb1
- }
-
- public enum UScript.ScriptUsage {
- enum_constant public static final android.icu.lang.UScript.ScriptUsage ASPIRATIONAL;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage EXCLUDED;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage LIMITED_USE;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage NOT_ENCODED;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage RECOMMENDED;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage UNKNOWN;
- }
-
-}
-
-package android.icu.math {
-
- public class BigDecimal extends java.lang.Number implements java.lang.Comparable<android.icu.math.BigDecimal> java.io.Serializable {
- ctor public BigDecimal(java.math.BigDecimal);
- ctor public BigDecimal(java.math.BigInteger);
- ctor public BigDecimal(java.math.BigInteger, int);
- ctor public BigDecimal(char[]);
- ctor public BigDecimal(char[], int, int);
- ctor public BigDecimal(double);
- ctor public BigDecimal(int);
- ctor public BigDecimal(long);
- ctor public BigDecimal(String);
- method public android.icu.math.BigDecimal abs();
- method public android.icu.math.BigDecimal abs(android.icu.math.MathContext);
- method public android.icu.math.BigDecimal add(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal add(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public byte byteValueExact();
- method public int compareTo(android.icu.math.BigDecimal);
- method public int compareTo(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, int);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, int, int);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal divideInteger(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal divideInteger(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public double doubleValue();
- method public float floatValue();
- method public String format(int, int);
- method public String format(int, int, int, int, int, int);
- method public int intValue();
- method public int intValueExact();
- method public long longValue();
- method public long longValueExact();
- method public android.icu.math.BigDecimal max(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal max(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal min(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal min(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal movePointLeft(int);
- method public android.icu.math.BigDecimal movePointRight(int);
- method public android.icu.math.BigDecimal multiply(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal multiply(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal negate();
- method public android.icu.math.BigDecimal negate(android.icu.math.MathContext);
- method public android.icu.math.BigDecimal plus();
- method public android.icu.math.BigDecimal plus(android.icu.math.MathContext);
- method public android.icu.math.BigDecimal pow(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal pow(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal remainder(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal remainder(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public int scale();
- method public android.icu.math.BigDecimal setScale(int);
- method public android.icu.math.BigDecimal setScale(int, int);
- method public short shortValueExact();
- method public int signum();
- method public android.icu.math.BigDecimal subtract(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal subtract(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public java.math.BigDecimal toBigDecimal();
- method public java.math.BigInteger toBigInteger();
- method public java.math.BigInteger toBigIntegerExact();
- method public char[] toCharArray();
- method public java.math.BigInteger unscaledValue();
- method public static android.icu.math.BigDecimal valueOf(double);
- method public static android.icu.math.BigDecimal valueOf(long);
- method public static android.icu.math.BigDecimal valueOf(long, int);
- field public static final android.icu.math.BigDecimal ONE;
- field public static final int ROUND_CEILING = 2; // 0x2
- field public static final int ROUND_DOWN = 1; // 0x1
- field public static final int ROUND_FLOOR = 3; // 0x3
- field public static final int ROUND_HALF_DOWN = 5; // 0x5
- field public static final int ROUND_HALF_EVEN = 6; // 0x6
- field public static final int ROUND_HALF_UP = 4; // 0x4
- field public static final int ROUND_UNNECESSARY = 7; // 0x7
- field public static final int ROUND_UP = 0; // 0x0
- field public static final android.icu.math.BigDecimal TEN;
- field public static final android.icu.math.BigDecimal ZERO;
- }
-
- public final class MathContext implements java.io.Serializable {
- ctor public MathContext(int);
- ctor public MathContext(int, int);
- ctor public MathContext(int, int, boolean);
- ctor public MathContext(int, int, boolean, int);
- method public int getDigits();
- method public int getForm();
- method public boolean getLostDigits();
- method public int getRoundingMode();
- field public static final android.icu.math.MathContext DEFAULT;
- field public static final int ENGINEERING = 2; // 0x2
- field public static final int PLAIN = 0; // 0x0
- field public static final int ROUND_CEILING = 2; // 0x2
- field public static final int ROUND_DOWN = 1; // 0x1
- field public static final int ROUND_FLOOR = 3; // 0x3
- field public static final int ROUND_HALF_DOWN = 5; // 0x5
- field public static final int ROUND_HALF_EVEN = 6; // 0x6
- field public static final int ROUND_HALF_UP = 4; // 0x4
- field public static final int ROUND_UNNECESSARY = 7; // 0x7
- field public static final int ROUND_UP = 0; // 0x0
- field public static final int SCIENTIFIC = 1; // 0x1
- }
-
-}
-
-package android.icu.number {
-
- public class CompactNotation extends android.icu.number.Notation {
- }
-
- public abstract class CurrencyPrecision extends android.icu.number.Precision {
- method public android.icu.number.Precision withCurrency(android.icu.util.Currency);
- }
-
- public class FormattedNumber implements java.lang.CharSequence {
- method public char charAt(int);
- method public int length();
- method public CharSequence subSequence(int, int);
- method public java.math.BigDecimal toBigDecimal();
- method public java.text.AttributedCharacterIterator toCharacterIterator();
- }
-
- public class FormattedNumberRange implements java.lang.CharSequence {
- method public char charAt(int);
- method public java.math.BigDecimal getFirstBigDecimal();
- method public android.icu.number.NumberRangeFormatter.RangeIdentityResult getIdentityResult();
- method public java.math.BigDecimal getSecondBigDecimal();
- method public int length();
- method public CharSequence subSequence(int, int);
- method public java.text.AttributedCharacterIterator toCharacterIterator();
- }
-
- public abstract class FractionPrecision extends android.icu.number.Precision {
- method public android.icu.number.Precision withMaxDigits(int);
- method public android.icu.number.Precision withMinDigits(int);
- }
-
- public class IntegerWidth {
- method public android.icu.number.IntegerWidth truncateAt(int);
- method public static android.icu.number.IntegerWidth zeroFillTo(int);
- }
-
- public class LocalizedNumberFormatter extends android.icu.number.NumberFormatterSettings<android.icu.number.LocalizedNumberFormatter> {
- method public android.icu.number.FormattedNumber format(long);
- method public android.icu.number.FormattedNumber format(double);
- method public android.icu.number.FormattedNumber format(Number);
- method public android.icu.number.FormattedNumber format(android.icu.util.Measure);
- method public java.text.Format toFormat();
- }
-
- public class LocalizedNumberRangeFormatter extends android.icu.number.NumberRangeFormatterSettings<android.icu.number.LocalizedNumberRangeFormatter> {
- method public android.icu.number.FormattedNumberRange formatRange(int, int);
- method public android.icu.number.FormattedNumberRange formatRange(double, double);
- method public android.icu.number.FormattedNumberRange formatRange(Number, Number);
- }
-
- public class Notation {
- method public static android.icu.number.CompactNotation compactLong();
- method public static android.icu.number.CompactNotation compactShort();
- method public static android.icu.number.ScientificNotation engineering();
- method public static android.icu.number.ScientificNotation scientific();
- method public static android.icu.number.SimpleNotation simple();
- }
-
- public final class NumberFormatter {
- method public static android.icu.number.UnlocalizedNumberFormatter with();
- method public static android.icu.number.LocalizedNumberFormatter withLocale(java.util.Locale);
- method public static android.icu.number.LocalizedNumberFormatter withLocale(android.icu.util.ULocale);
- }
-
- public enum NumberFormatter.DecimalSeparatorDisplay {
- enum_constant public static final android.icu.number.NumberFormatter.DecimalSeparatorDisplay ALWAYS;
- enum_constant public static final android.icu.number.NumberFormatter.DecimalSeparatorDisplay AUTO;
- }
-
- public enum NumberFormatter.GroupingStrategy {
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy AUTO;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy MIN2;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy OFF;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy ON_ALIGNED;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy THOUSANDS;
- }
-
- public enum NumberFormatter.SignDisplay {
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ACCOUNTING;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ACCOUNTING_ALWAYS;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ACCOUNTING_EXCEPT_ZERO;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ALWAYS;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay AUTO;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay EXCEPT_ZERO;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay NEVER;
- }
-
- public enum NumberFormatter.UnitWidth {
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth FULL_NAME;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth HIDDEN;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth ISO_CODE;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth NARROW;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth SHORT;
- }
-
- public abstract class NumberFormatterSettings<T extends android.icu.number.NumberFormatterSettings<?>> {
- method public T decimal(android.icu.number.NumberFormatter.DecimalSeparatorDisplay);
- method public T grouping(android.icu.number.NumberFormatter.GroupingStrategy);
- method public T integerWidth(android.icu.number.IntegerWidth);
- method public T notation(android.icu.number.Notation);
- method public T perUnit(android.icu.util.MeasureUnit);
- method public T precision(android.icu.number.Precision);
- method public T roundingMode(java.math.RoundingMode);
- method public T scale(android.icu.number.Scale);
- method public T sign(android.icu.number.NumberFormatter.SignDisplay);
- method public T symbols(android.icu.text.DecimalFormatSymbols);
- method public T symbols(android.icu.text.NumberingSystem);
- method public T unit(android.icu.util.MeasureUnit);
- method public T unitWidth(android.icu.number.NumberFormatter.UnitWidth);
- }
-
- public abstract class NumberRangeFormatter {
- method public static android.icu.number.UnlocalizedNumberRangeFormatter with();
- method public static android.icu.number.LocalizedNumberRangeFormatter withLocale(java.util.Locale);
- method public static android.icu.number.LocalizedNumberRangeFormatter withLocale(android.icu.util.ULocale);
- }
-
- public enum NumberRangeFormatter.RangeCollapse {
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse ALL;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse AUTO;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse NONE;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse UNIT;
- }
-
- public enum NumberRangeFormatter.RangeIdentityFallback {
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback APPROXIMATELY;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback APPROXIMATELY_OR_SINGLE_VALUE;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback RANGE;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback SINGLE_VALUE;
- }
-
- public enum NumberRangeFormatter.RangeIdentityResult {
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityResult EQUAL_AFTER_ROUNDING;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityResult EQUAL_BEFORE_ROUNDING;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityResult NOT_EQUAL;
- }
-
- public abstract class NumberRangeFormatterSettings<T extends android.icu.number.NumberRangeFormatterSettings<?>> {
- method public T collapse(android.icu.number.NumberRangeFormatter.RangeCollapse);
- method public T identityFallback(android.icu.number.NumberRangeFormatter.RangeIdentityFallback);
- method public T numberFormatterBoth(android.icu.number.UnlocalizedNumberFormatter);
- method public T numberFormatterFirst(android.icu.number.UnlocalizedNumberFormatter);
- method public T numberFormatterSecond(android.icu.number.UnlocalizedNumberFormatter);
- }
-
- public abstract class Precision {
- method public static android.icu.number.CurrencyPrecision currency(android.icu.util.Currency.CurrencyUsage);
- method public static android.icu.number.FractionPrecision fixedFraction(int);
- method public static android.icu.number.Precision fixedSignificantDigits(int);
- method public static android.icu.number.Precision increment(java.math.BigDecimal);
- method public static android.icu.number.FractionPrecision integer();
- method public static android.icu.number.FractionPrecision maxFraction(int);
- method public static android.icu.number.Precision maxSignificantDigits(int);
- method public static android.icu.number.FractionPrecision minFraction(int);
- method public static android.icu.number.FractionPrecision minMaxFraction(int, int);
- method public static android.icu.number.Precision minMaxSignificantDigits(int, int);
- method public static android.icu.number.Precision minSignificantDigits(int);
- method public static android.icu.number.Precision unlimited();
- }
-
- public class Scale {
- method public static android.icu.number.Scale byBigDecimal(java.math.BigDecimal);
- method public static android.icu.number.Scale byDouble(double);
- method public static android.icu.number.Scale byDoubleAndPowerOfTen(double, int);
- method public static android.icu.number.Scale none();
- method public static android.icu.number.Scale powerOfTen(int);
- }
-
- public class ScientificNotation extends android.icu.number.Notation {
- method public android.icu.number.ScientificNotation withExponentSignDisplay(android.icu.number.NumberFormatter.SignDisplay);
- method public android.icu.number.ScientificNotation withMinExponentDigits(int);
- }
-
- public class SimpleNotation extends android.icu.number.Notation {
- }
-
- public class UnlocalizedNumberFormatter extends android.icu.number.NumberFormatterSettings<android.icu.number.UnlocalizedNumberFormatter> {
- method public android.icu.number.LocalizedNumberFormatter locale(java.util.Locale);
- method public android.icu.number.LocalizedNumberFormatter locale(android.icu.util.ULocale);
- }
-
- public class UnlocalizedNumberRangeFormatter extends android.icu.number.NumberRangeFormatterSettings<android.icu.number.UnlocalizedNumberRangeFormatter> {
- method public android.icu.number.LocalizedNumberRangeFormatter locale(java.util.Locale);
- method public android.icu.number.LocalizedNumberRangeFormatter locale(android.icu.util.ULocale);
- }
-
-}
-
-package android.icu.text {
-
- public final class AlphabeticIndex<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Bucket<V>> {
- ctor public AlphabeticIndex(android.icu.util.ULocale);
- ctor public AlphabeticIndex(java.util.Locale);
- ctor public AlphabeticIndex(android.icu.text.RuleBasedCollator);
- method public android.icu.text.AlphabeticIndex<V> addLabels(android.icu.text.UnicodeSet);
- method public android.icu.text.AlphabeticIndex<V> addLabels(android.icu.util.ULocale...);
- method public android.icu.text.AlphabeticIndex<V> addLabels(java.util.Locale...);
- method public android.icu.text.AlphabeticIndex<V> addRecord(CharSequence, V);
- method public android.icu.text.AlphabeticIndex.ImmutableIndex<V> buildImmutableIndex();
- method public android.icu.text.AlphabeticIndex<V> clearRecords();
- method public int getBucketCount();
- method public int getBucketIndex(CharSequence);
- method public java.util.List<java.lang.String> getBucketLabels();
- method public android.icu.text.RuleBasedCollator getCollator();
- method public String getInflowLabel();
- method public int getMaxLabelCount();
- method public String getOverflowLabel();
- method public int getRecordCount();
- method public String getUnderflowLabel();
- method public java.util.Iterator<android.icu.text.AlphabeticIndex.Bucket<V>> iterator();
- method public android.icu.text.AlphabeticIndex<V> setInflowLabel(String);
- method public android.icu.text.AlphabeticIndex<V> setMaxLabelCount(int);
- method public android.icu.text.AlphabeticIndex<V> setOverflowLabel(String);
- method public android.icu.text.AlphabeticIndex<V> setUnderflowLabel(String);
- }
-
- public static class AlphabeticIndex.Bucket<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Record<V>> {
- method public String getLabel();
- method public android.icu.text.AlphabeticIndex.Bucket.LabelType getLabelType();
- method public java.util.Iterator<android.icu.text.AlphabeticIndex.Record<V>> iterator();
- method public int size();
- }
-
- public enum AlphabeticIndex.Bucket.LabelType {
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType INFLOW;
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType NORMAL;
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType OVERFLOW;
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType UNDERFLOW;
- }
-
- public static final class AlphabeticIndex.ImmutableIndex<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Bucket<V>> {
- method public android.icu.text.AlphabeticIndex.Bucket<V> getBucket(int);
- method public int getBucketCount();
- method public int getBucketIndex(CharSequence);
- method public java.util.Iterator<android.icu.text.AlphabeticIndex.Bucket<V>> iterator();
- }
-
- public static class AlphabeticIndex.Record<V> {
- method public V getData();
- method public CharSequence getName();
- }
-
- public class Bidi {
- ctor public Bidi();
- ctor public Bidi(int, int);
- ctor public Bidi(String, int);
- ctor public Bidi(java.text.AttributedCharacterIterator);
- ctor public Bidi(char[], int, byte[], int, int, int);
- method public boolean baseIsLeftToRight();
- method public int countParagraphs();
- method public int countRuns();
- method public android.icu.text.Bidi createLineBidi(int, int);
- method public static byte getBaseDirection(CharSequence);
- method public int getBaseLevel();
- method public android.icu.text.BidiClassifier getCustomClassifier();
- method public int getCustomizedClass(int);
- method public byte getDirection();
- method public int getLength();
- method public byte getLevelAt(int);
- method public byte[] getLevels();
- method public int getLogicalIndex(int);
- method public int[] getLogicalMap();
- method public android.icu.text.BidiRun getLogicalRun(int);
- method public byte getParaLevel();
- method public android.icu.text.BidiRun getParagraph(int);
- method public android.icu.text.BidiRun getParagraphByIndex(int);
- method public int getParagraphIndex(int);
- method public int getProcessedLength();
- method public int getReorderingMode();
- method public int getReorderingOptions();
- method public int getResultLength();
- method public int getRunCount();
- method public int getRunLevel(int);
- method public int getRunLimit(int);
- method public int getRunStart(int);
- method public char[] getText();
- method public String getTextAsString();
- method public int getVisualIndex(int);
- method public int[] getVisualMap();
- method public android.icu.text.BidiRun getVisualRun(int);
- method public static int[] invertMap(int[]);
- method public boolean isInverse();
- method public boolean isLeftToRight();
- method public boolean isMixed();
- method public boolean isOrderParagraphsLTR();
- method public boolean isRightToLeft();
- method public void orderParagraphsLTR(boolean);
- method public static int[] reorderLogical(byte[]);
- method public static int[] reorderVisual(byte[]);
- method public static void reorderVisually(byte[], int, Object[], int, int);
- method public static boolean requiresBidi(char[], int, int);
- method public void setContext(String, String);
- method public void setCustomClassifier(android.icu.text.BidiClassifier);
- method public void setInverse(boolean);
- method public android.icu.text.Bidi setLine(int, int);
- method public void setPara(String, byte, byte[]);
- method public void setPara(char[], byte, byte[]);
- method public void setPara(java.text.AttributedCharacterIterator);
- method public void setReorderingMode(int);
- method public void setReorderingOptions(int);
- method public String writeReordered(int);
- method public static String writeReverse(String, int);
- field public static final int DIRECTION_DEFAULT_LEFT_TO_RIGHT = 126; // 0x7e
- field public static final int DIRECTION_DEFAULT_RIGHT_TO_LEFT = 127; // 0x7f
- field public static final int DIRECTION_LEFT_TO_RIGHT = 0; // 0x0
- field public static final int DIRECTION_RIGHT_TO_LEFT = 1; // 0x1
- field public static final short DO_MIRRORING = 2; // 0x2
- field public static final short INSERT_LRM_FOR_NUMERIC = 4; // 0x4
- field public static final short KEEP_BASE_COMBINING = 1; // 0x1
- field public static final byte LEVEL_DEFAULT_LTR = 126; // 0x7e
- field public static final byte LEVEL_DEFAULT_RTL = 127; // 0x7f
- field public static final byte LEVEL_OVERRIDE = -128; // 0xffffff80
- field public static final byte LTR = 0; // 0x0
- field public static final int MAP_NOWHERE = -1; // 0xffffffff
- field public static final byte MAX_EXPLICIT_LEVEL = 125; // 0x7d
- field public static final byte MIXED = 2; // 0x2
- field public static final byte NEUTRAL = 3; // 0x3
- field public static final int OPTION_DEFAULT = 0; // 0x0
- field public static final int OPTION_INSERT_MARKS = 1; // 0x1
- field public static final int OPTION_REMOVE_CONTROLS = 2; // 0x2
- field public static final int OPTION_STREAMING = 4; // 0x4
- field public static final short OUTPUT_REVERSE = 16; // 0x10
- field public static final short REMOVE_BIDI_CONTROLS = 8; // 0x8
- field public static final short REORDER_DEFAULT = 0; // 0x0
- field public static final short REORDER_GROUP_NUMBERS_WITH_R = 2; // 0x2
- field public static final short REORDER_INVERSE_FOR_NUMBERS_SPECIAL = 6; // 0x6
- field public static final short REORDER_INVERSE_LIKE_DIRECT = 5; // 0x5
- field public static final short REORDER_INVERSE_NUMBERS_AS_L = 4; // 0x4
- field public static final short REORDER_NUMBERS_SPECIAL = 1; // 0x1
- field public static final short REORDER_RUNS_ONLY = 3; // 0x3
- field public static final byte RTL = 1; // 0x1
- }
-
- public class BidiClassifier {
- ctor public BidiClassifier(Object);
- method public int classify(int);
- method public Object getContext();
- method public void setContext(Object);
- }
-
- public class BidiRun {
- method public byte getDirection();
- method public byte getEmbeddingLevel();
- method public int getLength();
- method public int getLimit();
- method public int getStart();
- method public boolean isEvenRun();
- method public boolean isOddRun();
- }
-
- public abstract class BreakIterator implements java.lang.Cloneable {
- ctor protected BreakIterator();
- method public Object clone();
- method public abstract int current();
- method public abstract int first();
- method public abstract int following(int);
- method public static java.util.Locale[] getAvailableLocales();
- method public static android.icu.text.BreakIterator getCharacterInstance();
- method public static android.icu.text.BreakIterator getCharacterInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getCharacterInstance(android.icu.util.ULocale);
- method public static android.icu.text.BreakIterator getLineInstance();
- method public static android.icu.text.BreakIterator getLineInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getLineInstance(android.icu.util.ULocale);
- method public int getRuleStatus();
- method public int getRuleStatusVec(int[]);
- method public static android.icu.text.BreakIterator getSentenceInstance();
- method public static android.icu.text.BreakIterator getSentenceInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getSentenceInstance(android.icu.util.ULocale);
- method public abstract java.text.CharacterIterator getText();
- method @Deprecated public static android.icu.text.BreakIterator getTitleInstance();
- method @Deprecated public static android.icu.text.BreakIterator getTitleInstance(java.util.Locale);
- method @Deprecated public static android.icu.text.BreakIterator getTitleInstance(android.icu.util.ULocale);
- method public static android.icu.text.BreakIterator getWordInstance();
- method public static android.icu.text.BreakIterator getWordInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getWordInstance(android.icu.util.ULocale);
- method public boolean isBoundary(int);
- method public abstract int last();
- method public abstract int next(int);
- method public abstract int next();
- method public int preceding(int);
- method public abstract int previous();
- method public void setText(String);
- method public void setText(CharSequence);
- method public abstract void setText(java.text.CharacterIterator);
- field public static final int DONE = -1; // 0xffffffff
- field public static final int KIND_CHARACTER = 0; // 0x0
- field public static final int KIND_LINE = 2; // 0x2
- field public static final int KIND_SENTENCE = 3; // 0x3
- field @Deprecated public static final int KIND_TITLE = 4; // 0x4
- field public static final int KIND_WORD = 1; // 0x1
- field public static final int WORD_IDEO = 400; // 0x190
- field public static final int WORD_IDEO_LIMIT = 500; // 0x1f4
- field public static final int WORD_KANA = 300; // 0x12c
- field public static final int WORD_KANA_LIMIT = 400; // 0x190
- field public static final int WORD_LETTER = 200; // 0xc8
- field public static final int WORD_LETTER_LIMIT = 300; // 0x12c
- field public static final int WORD_NONE = 0; // 0x0
- field public static final int WORD_NONE_LIMIT = 100; // 0x64
- field public static final int WORD_NUMBER = 100; // 0x64
- field public static final int WORD_NUMBER_LIMIT = 200; // 0xc8
- }
-
- public abstract class CaseMap {
- method public static android.icu.text.CaseMap.Fold fold();
- method public abstract android.icu.text.CaseMap omitUnchangedText();
- method public static android.icu.text.CaseMap.Lower toLower();
- method public static android.icu.text.CaseMap.Title toTitle();
- method public static android.icu.text.CaseMap.Upper toUpper();
- }
-
- public static final class CaseMap.Fold extends android.icu.text.CaseMap {
- method public String apply(CharSequence);
- method public <A extends java.lang.Appendable> A apply(CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Fold omitUnchangedText();
- method public android.icu.text.CaseMap.Fold turkic();
- }
-
- public static final class CaseMap.Lower extends android.icu.text.CaseMap {
- method public String apply(java.util.Locale, CharSequence);
- method public <A extends java.lang.Appendable> A apply(java.util.Locale, CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Lower omitUnchangedText();
- }
-
- public static final class CaseMap.Title extends android.icu.text.CaseMap {
- method public android.icu.text.CaseMap.Title adjustToCased();
- method public String apply(java.util.Locale, android.icu.text.BreakIterator, CharSequence);
- method public <A extends java.lang.Appendable> A apply(java.util.Locale, android.icu.text.BreakIterator, CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Title noBreakAdjustment();
- method public android.icu.text.CaseMap.Title noLowercase();
- method public android.icu.text.CaseMap.Title omitUnchangedText();
- method public android.icu.text.CaseMap.Title sentences();
- method public android.icu.text.CaseMap.Title wholeString();
- }
-
- public static final class CaseMap.Upper extends android.icu.text.CaseMap {
- method public String apply(java.util.Locale, CharSequence);
- method public <A extends java.lang.Appendable> A apply(java.util.Locale, CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Upper omitUnchangedText();
- }
-
- public final class CollationElementIterator {
- method public int getMaxExpansion(int);
- method public int getOffset();
- method public int next();
- method public int previous();
- method public static int primaryOrder(int);
- method public void reset();
- method public static int secondaryOrder(int);
- method public void setOffset(int);
- method public void setText(String);
- method public void setText(android.icu.text.UCharacterIterator);
- method public void setText(java.text.CharacterIterator);
- method public static int tertiaryOrder(int);
- field public static final int IGNORABLE = 0; // 0x0
- field public static final int NULLORDER = -1; // 0xffffffff
- }
-
- public final class CollationKey implements java.lang.Comparable<android.icu.text.CollationKey> {
- ctor public CollationKey(String, byte[]);
- method public int compareTo(android.icu.text.CollationKey);
- method public boolean equals(android.icu.text.CollationKey);
- method public android.icu.text.CollationKey getBound(int, int);
- method public String getSourceString();
- method public android.icu.text.CollationKey merge(android.icu.text.CollationKey);
- method public byte[] toByteArray();
- }
-
- public static final class CollationKey.BoundMode {
- field public static final int LOWER = 0; // 0x0
- field public static final int UPPER = 1; // 0x1
- field public static final int UPPER_LONG = 2; // 0x2
- }
-
- public abstract class Collator implements java.lang.Cloneable java.util.Comparator<java.lang.Object> android.icu.util.Freezable<android.icu.text.Collator> {
- ctor protected Collator();
- method public Object clone() throws java.lang.CloneNotSupportedException;
- method public android.icu.text.Collator cloneAsThawed();
- method public abstract int compare(String, String);
- method public int compare(Object, Object);
- method public boolean equals(String, String);
- method public android.icu.text.Collator freeze();
- method public static java.util.Locale[] getAvailableLocales();
- method public static final android.icu.util.ULocale[] getAvailableULocales();
- method public abstract android.icu.text.CollationKey getCollationKey(String);
- method public int getDecomposition();
- method public static String getDisplayName(java.util.Locale, java.util.Locale);
- method public static String getDisplayName(android.icu.util.ULocale, android.icu.util.ULocale);
- method public static String getDisplayName(java.util.Locale);
- method public static String getDisplayName(android.icu.util.ULocale);
- method public static int[] getEquivalentReorderCodes(int);
- method public static final android.icu.util.ULocale getFunctionalEquivalent(String, android.icu.util.ULocale, boolean[]);
- method public static final android.icu.util.ULocale getFunctionalEquivalent(String, android.icu.util.ULocale);
- method public static final android.icu.text.Collator getInstance();
- method public static final android.icu.text.Collator getInstance(android.icu.util.ULocale);
- method public static final android.icu.text.Collator getInstance(java.util.Locale);
- method public static final String[] getKeywordValues(String);
- method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
- method public static final String[] getKeywords();
- method public int getMaxVariable();
- method public int[] getReorderCodes();
- method public int getStrength();
- method public android.icu.text.UnicodeSet getTailoredSet();
- method public abstract android.icu.util.VersionInfo getUCAVersion();
- method public abstract int getVariableTop();
- method public abstract android.icu.util.VersionInfo getVersion();
- method public boolean isFrozen();
- method public void setDecomposition(int);
- method public android.icu.text.Collator setMaxVariable(int);
- method public void setReorderCodes(int...);
- method public void setStrength(int);
- field public static final int CANONICAL_DECOMPOSITION = 17; // 0x11
- field public static final int FULL_DECOMPOSITION = 15; // 0xf
- field public static final int IDENTICAL = 15; // 0xf
- field public static final int NO_DECOMPOSITION = 16; // 0x10
- field public static final int PRIMARY = 0; // 0x0
- field public static final int QUATERNARY = 3; // 0x3
- field public static final int SECONDARY = 1; // 0x1
- field public static final int TERTIARY = 2; // 0x2
- }
-
- public static interface Collator.ReorderCodes {
- field public static final int CURRENCY = 4099; // 0x1003
- field public static final int DEFAULT = -1; // 0xffffffff
- field public static final int DIGIT = 4100; // 0x1004
- field public static final int FIRST = 4096; // 0x1000
- field public static final int NONE = 103; // 0x67
- field public static final int OTHERS = 103; // 0x67
- field public static final int PUNCTUATION = 4097; // 0x1001
- field public static final int SPACE = 4096; // 0x1000
- field public static final int SYMBOL = 4098; // 0x1002
- }
-
- public class CompactDecimalFormat extends android.icu.text.DecimalFormat {
- method public static android.icu.text.CompactDecimalFormat getInstance(android.icu.util.ULocale, android.icu.text.CompactDecimalFormat.CompactStyle);
- method public static android.icu.text.CompactDecimalFormat getInstance(java.util.Locale, android.icu.text.CompactDecimalFormat.CompactStyle);
- }
-
- public enum CompactDecimalFormat.CompactStyle {
- enum_constant public static final android.icu.text.CompactDecimalFormat.CompactStyle LONG;
- enum_constant public static final android.icu.text.CompactDecimalFormat.CompactStyle SHORT;
- }
-
- public class CurrencyPluralInfo implements java.lang.Cloneable java.io.Serializable {
- ctor public CurrencyPluralInfo();
- ctor public CurrencyPluralInfo(java.util.Locale);
- ctor public CurrencyPluralInfo(android.icu.util.ULocale);
- method public Object clone();
- method public String getCurrencyPluralPattern(String);
- method public static android.icu.text.CurrencyPluralInfo getInstance();
- method public static android.icu.text.CurrencyPluralInfo getInstance(java.util.Locale);
- method public static android.icu.text.CurrencyPluralInfo getInstance(android.icu.util.ULocale);
- method public android.icu.util.ULocale getLocale();
- method public android.icu.text.PluralRules getPluralRules();
- method public void setCurrencyPluralPattern(String, String);
- method public void setLocale(android.icu.util.ULocale);
- method public void setPluralRules(String);
- }
-
- public abstract class DateFormat extends android.icu.text.UFormat {
- ctor protected DateFormat();
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(java.util.Date, StringBuffer, java.text.FieldPosition);
- method public final String format(java.util.Date);
- method public static java.util.Locale[] getAvailableLocales();
- method public boolean getBooleanAttribute(android.icu.text.DateFormat.BooleanAttribute);
- method public android.icu.util.Calendar getCalendar();
- method public android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
- method public static final android.icu.text.DateFormat getDateInstance();
- method public static final android.icu.text.DateFormat getDateInstance(int);
- method public static final android.icu.text.DateFormat getDateInstance(int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateInstance(int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int);
- method public static final android.icu.text.DateFormat getDateTimeInstance();
- method public static final android.icu.text.DateFormat getDateTimeInstance(int, int);
- method public static final android.icu.text.DateFormat getDateTimeInstance(int, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(int, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int);
- method public static final android.icu.text.DateFormat getInstance();
- method public static final android.icu.text.DateFormat getInstance(android.icu.util.Calendar, java.util.Locale);
- method public static final android.icu.text.DateFormat getInstance(android.icu.util.Calendar);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(String);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(String, java.util.Locale);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(String, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, String, java.util.Locale);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, String, android.icu.util.ULocale);
- method public android.icu.text.NumberFormat getNumberFormat();
- method public static final android.icu.text.DateFormat getPatternInstance(String);
- method public static final android.icu.text.DateFormat getPatternInstance(String, java.util.Locale);
- method public static final android.icu.text.DateFormat getPatternInstance(String, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, String, java.util.Locale);
- method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, String, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getTimeInstance();
- method public static final android.icu.text.DateFormat getTimeInstance(int);
- method public static final android.icu.text.DateFormat getTimeInstance(int, java.util.Locale);
- method public static final android.icu.text.DateFormat getTimeInstance(int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int);
- method public android.icu.util.TimeZone getTimeZone();
- method public boolean isCalendarLenient();
- method public boolean isLenient();
- method public java.util.Date parse(String) throws java.text.ParseException;
- method public abstract void parse(String, android.icu.util.Calendar, java.text.ParsePosition);
- method public java.util.Date parse(String, java.text.ParsePosition);
- method public Object parseObject(String, java.text.ParsePosition);
- method public android.icu.text.DateFormat setBooleanAttribute(android.icu.text.DateFormat.BooleanAttribute, boolean);
- method public void setCalendar(android.icu.util.Calendar);
- method public void setCalendarLenient(boolean);
- method public void setContext(android.icu.text.DisplayContext);
- method public void setLenient(boolean);
- method public void setNumberFormat(android.icu.text.NumberFormat);
- method public void setTimeZone(android.icu.util.TimeZone);
- field public static final String ABBR_GENERIC_TZ = "v";
- field public static final String ABBR_MONTH = "MMM";
- field public static final String ABBR_MONTH_DAY = "MMMd";
- field public static final String ABBR_MONTH_WEEKDAY_DAY = "MMMEd";
- field public static final String ABBR_QUARTER = "QQQ";
- field public static final String ABBR_SPECIFIC_TZ = "z";
- field public static final String ABBR_UTC_TZ = "ZZZZ";
- field public static final String ABBR_WEEKDAY = "E";
- field public static final int AM_PM_FIELD = 14; // 0xe
- field public static final int AM_PM_MIDNIGHT_NOON_FIELD = 35; // 0x23
- field public static final int DATE_FIELD = 3; // 0x3
- field public static final String DAY = "d";
- field public static final int DAY_OF_WEEK_FIELD = 9; // 0x9
- field public static final int DAY_OF_WEEK_IN_MONTH_FIELD = 11; // 0xb
- field public static final int DAY_OF_YEAR_FIELD = 10; // 0xa
- field public static final int DEFAULT = 2; // 0x2
- field public static final int DOW_LOCAL_FIELD = 19; // 0x13
- field public static final int ERA_FIELD = 0; // 0x0
- field public static final int EXTENDED_YEAR_FIELD = 20; // 0x14
- field public static final int FLEXIBLE_DAY_PERIOD_FIELD = 36; // 0x24
- field public static final int FRACTIONAL_SECOND_FIELD = 8; // 0x8
- field public static final int FULL = 0; // 0x0
- field public static final String GENERIC_TZ = "vvvv";
- field public static final String HOUR = "j";
- field public static final int HOUR0_FIELD = 16; // 0x10
- field public static final int HOUR1_FIELD = 15; // 0xf
- field public static final String HOUR24 = "H";
- field public static final String HOUR24_MINUTE = "Hm";
- field public static final String HOUR24_MINUTE_SECOND = "Hms";
- field public static final String HOUR_MINUTE = "jm";
- field public static final String HOUR_MINUTE_SECOND = "jms";
- field public static final int HOUR_OF_DAY0_FIELD = 5; // 0x5
- field public static final int HOUR_OF_DAY1_FIELD = 4; // 0x4
- field public static final int JULIAN_DAY_FIELD = 21; // 0x15
- field public static final String LOCATION_TZ = "VVVV";
- field public static final int LONG = 1; // 0x1
- field public static final int MEDIUM = 2; // 0x2
- field public static final int MILLISECONDS_IN_DAY_FIELD = 22; // 0x16
- field public static final int MILLISECOND_FIELD = 8; // 0x8
- field public static final String MINUTE = "m";
- field public static final int MINUTE_FIELD = 6; // 0x6
- field public static final String MINUTE_SECOND = "ms";
- field public static final String MONTH = "MMMM";
- field public static final String MONTH_DAY = "MMMMd";
- field public static final int MONTH_FIELD = 2; // 0x2
- field public static final String MONTH_WEEKDAY_DAY = "MMMMEEEEd";
- field public static final int NONE = -1; // 0xffffffff
- field public static final String NUM_MONTH = "M";
- field public static final String NUM_MONTH_DAY = "Md";
- field public static final String NUM_MONTH_WEEKDAY_DAY = "MEd";
- field public static final String QUARTER = "QQQQ";
- field public static final int QUARTER_FIELD = 27; // 0x1b
- field public static final int RELATIVE = 128; // 0x80
- field public static final int RELATIVE_DEFAULT = 130; // 0x82
- field public static final int RELATIVE_FULL = 128; // 0x80
- field public static final int RELATIVE_LONG = 129; // 0x81
- field public static final int RELATIVE_MEDIUM = 130; // 0x82
- field public static final int RELATIVE_SHORT = 131; // 0x83
- field public static final String SECOND = "s";
- field public static final int SECOND_FIELD = 7; // 0x7
- field public static final int SHORT = 3; // 0x3
- field public static final String SPECIFIC_TZ = "zzzz";
- field public static final int STANDALONE_DAY_FIELD = 25; // 0x19
- field public static final int STANDALONE_MONTH_FIELD = 26; // 0x1a
- field public static final int STANDALONE_QUARTER_FIELD = 28; // 0x1c
- field public static final int TIMEZONE_FIELD = 17; // 0x11
- field public static final int TIMEZONE_GENERIC_FIELD = 24; // 0x18
- field public static final int TIMEZONE_ISO_FIELD = 32; // 0x20
- field public static final int TIMEZONE_ISO_LOCAL_FIELD = 33; // 0x21
- field public static final int TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31; // 0x1f
- field public static final int TIMEZONE_RFC_FIELD = 23; // 0x17
- field public static final int TIMEZONE_SPECIAL_FIELD = 29; // 0x1d
- field public static final String WEEKDAY = "EEEE";
- field public static final int WEEK_OF_MONTH_FIELD = 13; // 0xd
- field public static final int WEEK_OF_YEAR_FIELD = 12; // 0xc
- field public static final String YEAR = "y";
- field public static final String YEAR_ABBR_MONTH = "yMMM";
- field public static final String YEAR_ABBR_MONTH_DAY = "yMMMd";
- field public static final String YEAR_ABBR_MONTH_WEEKDAY_DAY = "yMMMEd";
- field public static final String YEAR_ABBR_QUARTER = "yQQQ";
- field public static final int YEAR_FIELD = 1; // 0x1
- field public static final String YEAR_MONTH = "yMMMM";
- field public static final String YEAR_MONTH_DAY = "yMMMMd";
- field public static final String YEAR_MONTH_WEEKDAY_DAY = "yMMMMEEEEd";
- field public static final int YEAR_NAME_FIELD = 30; // 0x1e
- field public static final String YEAR_NUM_MONTH = "yM";
- field public static final String YEAR_NUM_MONTH_DAY = "yMd";
- field public static final String YEAR_NUM_MONTH_WEEKDAY_DAY = "yMEd";
- field public static final String YEAR_QUARTER = "yQQQQ";
- field public static final int YEAR_WOY_FIELD = 18; // 0x12
- field protected android.icu.util.Calendar calendar;
- field protected android.icu.text.NumberFormat numberFormat;
- }
-
- public enum DateFormat.BooleanAttribute {
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_ALLOW_NUMERIC;
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_ALLOW_WHITESPACE;
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_MULTIPLE_PATTERNS_FOR_MATCH;
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_PARTIAL_LITERAL_MATCH;
- }
-
- public static class DateFormat.Field extends java.text.Format.Field {
- ctor protected DateFormat.Field(String, int);
- method public int getCalendarField();
- method public static android.icu.text.DateFormat.Field ofCalendarField(int);
- field public static final android.icu.text.DateFormat.Field AM_PM;
- field public static final android.icu.text.DateFormat.Field AM_PM_MIDNIGHT_NOON;
- field public static final android.icu.text.DateFormat.Field DAY_OF_MONTH;
- field public static final android.icu.text.DateFormat.Field DAY_OF_WEEK;
- field public static final android.icu.text.DateFormat.Field DAY_OF_WEEK_IN_MONTH;
- field public static final android.icu.text.DateFormat.Field DAY_OF_YEAR;
- field public static final android.icu.text.DateFormat.Field DOW_LOCAL;
- field public static final android.icu.text.DateFormat.Field ERA;
- field public static final android.icu.text.DateFormat.Field EXTENDED_YEAR;
- field public static final android.icu.text.DateFormat.Field FLEXIBLE_DAY_PERIOD;
- field public static final android.icu.text.DateFormat.Field HOUR0;
- field public static final android.icu.text.DateFormat.Field HOUR1;
- field public static final android.icu.text.DateFormat.Field HOUR_OF_DAY0;
- field public static final android.icu.text.DateFormat.Field HOUR_OF_DAY1;
- field public static final android.icu.text.DateFormat.Field JULIAN_DAY;
- field public static final android.icu.text.DateFormat.Field MILLISECOND;
- field public static final android.icu.text.DateFormat.Field MILLISECONDS_IN_DAY;
- field public static final android.icu.text.DateFormat.Field MINUTE;
- field public static final android.icu.text.DateFormat.Field MONTH;
- field public static final android.icu.text.DateFormat.Field QUARTER;
- field public static final android.icu.text.DateFormat.Field SECOND;
- field public static final android.icu.text.DateFormat.Field TIME_ZONE;
- field public static final android.icu.text.DateFormat.Field WEEK_OF_MONTH;
- field public static final android.icu.text.DateFormat.Field WEEK_OF_YEAR;
- field public static final android.icu.text.DateFormat.Field YEAR;
- field public static final android.icu.text.DateFormat.Field YEAR_WOY;
- }
-
- public class DateFormatSymbols implements java.lang.Cloneable java.io.Serializable {
- ctor public DateFormatSymbols();
- ctor public DateFormatSymbols(java.util.Locale);
- ctor public DateFormatSymbols(android.icu.util.ULocale);
- ctor public DateFormatSymbols(android.icu.util.Calendar, java.util.Locale);
- ctor public DateFormatSymbols(android.icu.util.Calendar, android.icu.util.ULocale);
- ctor public DateFormatSymbols(Class<? extends android.icu.util.Calendar>, java.util.Locale);
- ctor public DateFormatSymbols(Class<? extends android.icu.util.Calendar>, android.icu.util.ULocale);
- ctor public DateFormatSymbols(java.util.ResourceBundle, java.util.Locale);
- ctor public DateFormatSymbols(java.util.ResourceBundle, android.icu.util.ULocale);
- method public Object clone();
- method public String[] getAmPmStrings();
- method public static java.util.Locale[] getAvailableLocales();
- method public String[] getEraNames();
- method public String[] getEras();
- method public static android.icu.text.DateFormatSymbols getInstance();
- method public static android.icu.text.DateFormatSymbols getInstance(java.util.Locale);
- method public static android.icu.text.DateFormatSymbols getInstance(android.icu.util.ULocale);
- method public String getLocalPatternChars();
- method public String[] getMonths();
- method public String[] getMonths(int, int);
- method public String[] getQuarters(int, int);
- method public String[] getShortMonths();
- method public String[] getShortWeekdays();
- method public String[] getWeekdays();
- method public String[] getWeekdays(int, int);
- method public String[] getYearNames(int, int);
- method public String[] getZodiacNames(int, int);
- method public String[][] getZoneStrings();
- method protected void initializeData(android.icu.util.ULocale, String);
- method public void setAmPmStrings(String[]);
- method public void setEraNames(String[]);
- method public void setEras(String[]);
- method public void setLocalPatternChars(String);
- method public void setMonths(String[]);
- method public void setMonths(String[], int, int);
- method public void setQuarters(String[], int, int);
- method public void setShortMonths(String[]);
- method public void setShortWeekdays(String[]);
- method public void setWeekdays(String[], int, int);
- method public void setWeekdays(String[]);
- method public void setYearNames(String[], int, int);
- method public void setZodiacNames(String[], int, int);
- method public void setZoneStrings(String[][]);
- field public static final int ABBREVIATED = 0; // 0x0
- field public static final int FORMAT = 0; // 0x0
- field public static final int NARROW = 2; // 0x2
- field public static final int SHORT = 3; // 0x3
- field public static final int STANDALONE = 1; // 0x1
- field public static final int WIDE = 1; // 0x1
- }
-
- public class DateIntervalFormat extends android.icu.text.UFormat {
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public final StringBuffer format(android.icu.util.DateInterval, StringBuffer, java.text.FieldPosition);
- method public final StringBuffer format(android.icu.util.Calendar, android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
- method public android.icu.text.DateFormat getDateFormat();
- method public android.icu.text.DateIntervalInfo getDateIntervalInfo();
- method public static final android.icu.text.DateIntervalFormat getInstance(String);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, java.util.Locale);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.util.ULocale);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.text.DateIntervalInfo);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, java.util.Locale, android.icu.text.DateIntervalInfo);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.util.ULocale, android.icu.text.DateIntervalInfo);
- method public android.icu.util.TimeZone getTimeZone();
- method @Deprecated public Object parseObject(String, java.text.ParsePosition);
- method public void setDateIntervalInfo(android.icu.text.DateIntervalInfo);
- method public void setTimeZone(android.icu.util.TimeZone);
- }
-
- public class DateIntervalInfo implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateIntervalInfo> java.io.Serializable {
- ctor public DateIntervalInfo(android.icu.util.ULocale);
- ctor public DateIntervalInfo(java.util.Locale);
- method public Object clone();
- method public android.icu.text.DateIntervalInfo cloneAsThawed();
- method public android.icu.text.DateIntervalInfo freeze();
- method public boolean getDefaultOrder();
- method public String getFallbackIntervalPattern();
- method public android.icu.text.DateIntervalInfo.PatternInfo getIntervalPattern(String, int);
- method public boolean isFrozen();
- method public void setFallbackIntervalPattern(String);
- method public void setIntervalPattern(String, int, String);
- }
-
- public static final class DateIntervalInfo.PatternInfo implements java.lang.Cloneable java.io.Serializable {
- ctor public DateIntervalInfo.PatternInfo(String, String, boolean);
- method public boolean firstDateInPtnIsLaterDate();
- method public String getFirstPart();
- method public String getSecondPart();
- }
-
- public class DateTimePatternGenerator implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateTimePatternGenerator> {
- ctor protected DateTimePatternGenerator();
- method public android.icu.text.DateTimePatternGenerator addPattern(String, boolean, android.icu.text.DateTimePatternGenerator.PatternInfo);
- method public Object clone();
- method public android.icu.text.DateTimePatternGenerator cloneAsThawed();
- method public android.icu.text.DateTimePatternGenerator freeze();
- method public String getAppendItemFormat(int);
- method public String getAppendItemName(int);
- method public String getBaseSkeleton(String);
- method public java.util.Set<java.lang.String> getBaseSkeletons(java.util.Set<java.lang.String>);
- method public String getBestPattern(String);
- method public String getBestPattern(String, int);
- method public String getDateTimeFormat();
- method public String getDecimal();
- method public static android.icu.text.DateTimePatternGenerator getEmptyInstance();
- method public String getFieldDisplayName(int, android.icu.text.DateTimePatternGenerator.DisplayWidth);
- method public static android.icu.text.DateTimePatternGenerator getInstance();
- method public static android.icu.text.DateTimePatternGenerator getInstance(android.icu.util.ULocale);
- method public static android.icu.text.DateTimePatternGenerator getInstance(java.util.Locale);
- method public String getSkeleton(String);
- method public java.util.Map<java.lang.String,java.lang.String> getSkeletons(java.util.Map<java.lang.String,java.lang.String>);
- method public boolean isFrozen();
- method public String replaceFieldTypes(String, String);
- method public String replaceFieldTypes(String, String, int);
- method public void setAppendItemFormat(int, String);
- method public void setAppendItemName(int, String);
- method public void setDateTimeFormat(String);
- method public void setDecimal(String);
- field public static final int DAY = 7; // 0x7
- field public static final int DAYPERIOD = 10; // 0xa
- field public static final int DAY_OF_WEEK_IN_MONTH = 9; // 0x9
- field public static final int DAY_OF_YEAR = 8; // 0x8
- field public static final int ERA = 0; // 0x0
- field public static final int FRACTIONAL_SECOND = 14; // 0xe
- field public static final int HOUR = 11; // 0xb
- field public static final int MATCH_ALL_FIELDS_LENGTH = 65535; // 0xffff
- field public static final int MATCH_HOUR_FIELD_LENGTH = 2048; // 0x800
- field public static final int MATCH_NO_OPTIONS = 0; // 0x0
- field public static final int MINUTE = 12; // 0xc
- field public static final int MONTH = 3; // 0x3
- field public static final int QUARTER = 2; // 0x2
- field public static final int SECOND = 13; // 0xd
- field public static final int WEEKDAY = 6; // 0x6
- field public static final int WEEK_OF_MONTH = 5; // 0x5
- field public static final int WEEK_OF_YEAR = 4; // 0x4
- field public static final int YEAR = 1; // 0x1
- field public static final int ZONE = 15; // 0xf
- }
-
- public enum DateTimePatternGenerator.DisplayWidth {
- enum_constant public static final android.icu.text.DateTimePatternGenerator.DisplayWidth ABBREVIATED;
- enum_constant public static final android.icu.text.DateTimePatternGenerator.DisplayWidth NARROW;
- enum_constant public static final android.icu.text.DateTimePatternGenerator.DisplayWidth WIDE;
- }
-
- public static final class DateTimePatternGenerator.PatternInfo {
- ctor public DateTimePatternGenerator.PatternInfo();
- field public static final int BASE_CONFLICT = 1; // 0x1
- field public static final int CONFLICT = 2; // 0x2
- field public static final int OK = 0; // 0x0
- field public String conflictingPattern;
- field public int status;
- }
-
- public class DecimalFormat extends android.icu.text.NumberFormat {
- ctor public DecimalFormat();
- ctor public DecimalFormat(String);
- ctor public DecimalFormat(String, android.icu.text.DecimalFormatSymbols);
- ctor public DecimalFormat(String, android.icu.text.DecimalFormatSymbols, android.icu.text.CurrencyPluralInfo, int);
- method public void applyLocalizedPattern(String);
- method public void applyPattern(String);
- method public boolean areSignificantDigitsUsed();
- method public StringBuffer format(double, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(long, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(java.math.BigInteger, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(java.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(android.icu.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public android.icu.text.CurrencyPluralInfo getCurrencyPluralInfo();
- method public android.icu.util.Currency.CurrencyUsage getCurrencyUsage();
- method public android.icu.text.DecimalFormatSymbols getDecimalFormatSymbols();
- method public int getFormatWidth();
- method public int getGroupingSize();
- method public java.math.MathContext getMathContext();
- method public android.icu.math.MathContext getMathContextICU();
- method public int getMaximumSignificantDigits();
- method public byte getMinimumExponentDigits();
- method public int getMinimumSignificantDigits();
- method public int getMultiplier();
- method public String getNegativePrefix();
- method public String getNegativeSuffix();
- method public char getPadCharacter();
- method public int getPadPosition();
- method @Deprecated public int getParseMaxDigits();
- method public String getPositivePrefix();
- method public String getPositiveSuffix();
- method public java.math.BigDecimal getRoundingIncrement();
- method public int getSecondaryGroupingSize();
- method public boolean isDecimalPatternMatchRequired();
- method public boolean isDecimalSeparatorAlwaysShown();
- method public boolean isExponentSignAlwaysShown();
- method public boolean isParseBigDecimal();
- method public boolean isScientificNotation();
- method public Number parse(String, java.text.ParsePosition);
- method public void setCurrencyPluralInfo(android.icu.text.CurrencyPluralInfo);
- method public void setCurrencyUsage(android.icu.util.Currency.CurrencyUsage);
- method public void setDecimalFormatSymbols(android.icu.text.DecimalFormatSymbols);
- method public void setDecimalPatternMatchRequired(boolean);
- method public void setDecimalSeparatorAlwaysShown(boolean);
- method public void setExponentSignAlwaysShown(boolean);
- method public void setFormatWidth(int);
- method public void setGroupingSize(int);
- method public void setMathContext(java.math.MathContext);
- method public void setMathContextICU(android.icu.math.MathContext);
- method public void setMaximumSignificantDigits(int);
- method public void setMinimumExponentDigits(byte);
- method public void setMinimumSignificantDigits(int);
- method public void setMultiplier(int);
- method public void setNegativePrefix(String);
- method public void setNegativeSuffix(String);
- method public void setPadCharacter(char);
- method public void setPadPosition(int);
- method public void setParseBigDecimal(boolean);
- method @Deprecated public void setParseMaxDigits(int);
- method public void setPositivePrefix(String);
- method public void setPositiveSuffix(String);
- method public void setRoundingIncrement(java.math.BigDecimal);
- method public void setRoundingIncrement(android.icu.math.BigDecimal);
- method public void setRoundingIncrement(double);
- method public void setScientificNotation(boolean);
- method public void setSecondaryGroupingSize(int);
- method public void setSignificantDigitsUsed(boolean);
- method public String toLocalizedPattern();
- method public String toPattern();
- field public static final int PAD_AFTER_PREFIX = 1; // 0x1
- field public static final int PAD_AFTER_SUFFIX = 3; // 0x3
- field public static final int PAD_BEFORE_PREFIX = 0; // 0x0
- field public static final int PAD_BEFORE_SUFFIX = 2; // 0x2
- }
-
- public class DecimalFormatSymbols implements java.lang.Cloneable java.io.Serializable {
- ctor public DecimalFormatSymbols();
- ctor public DecimalFormatSymbols(java.util.Locale);
- ctor public DecimalFormatSymbols(android.icu.util.ULocale);
- method public Object clone();
- method public static android.icu.text.DecimalFormatSymbols forNumberingSystem(java.util.Locale, android.icu.text.NumberingSystem);
- method public static android.icu.text.DecimalFormatSymbols forNumberingSystem(android.icu.util.ULocale, android.icu.text.NumberingSystem);
- method public static java.util.Locale[] getAvailableLocales();
- method public android.icu.util.Currency getCurrency();
- method public String getCurrencySymbol();
- method public char getDecimalSeparator();
- method public String getDecimalSeparatorString();
- method public char getDigit();
- method public String[] getDigitStrings();
- method public char[] getDigits();
- method public String getExponentMultiplicationSign();
- method public String getExponentSeparator();
- method public char getGroupingSeparator();
- method public String getGroupingSeparatorString();
- method public String getInfinity();
- method public static android.icu.text.DecimalFormatSymbols getInstance();
- method public static android.icu.text.DecimalFormatSymbols getInstance(java.util.Locale);
- method public static android.icu.text.DecimalFormatSymbols getInstance(android.icu.util.ULocale);
- method public String getInternationalCurrencySymbol();
- method public java.util.Locale getLocale();
- method public char getMinusSign();
- method public String getMinusSignString();
- method public char getMonetaryDecimalSeparator();
- method public String getMonetaryDecimalSeparatorString();
- method public char getMonetaryGroupingSeparator();
- method public String getMonetaryGroupingSeparatorString();
- method public String getNaN();
- method public char getPadEscape();
- method public String getPatternForCurrencySpacing(int, boolean);
- method public char getPatternSeparator();
- method public char getPerMill();
- method public String getPerMillString();
- method public char getPercent();
- method public String getPercentString();
- method public char getPlusSign();
- method public String getPlusSignString();
- method public char getSignificantDigit();
- method public android.icu.util.ULocale getULocale();
- method public char getZeroDigit();
- method public void setCurrency(android.icu.util.Currency);
- method public void setCurrencySymbol(String);
- method public void setDecimalSeparator(char);
- method public void setDecimalSeparatorString(String);
- method public void setDigit(char);
- method public void setDigitStrings(String[]);
- method public void setExponentMultiplicationSign(String);
- method public void setExponentSeparator(String);
- method public void setGroupingSeparator(char);
- method public void setGroupingSeparatorString(String);
- method public void setInfinity(String);
- method public void setInternationalCurrencySymbol(String);
- method public void setMinusSign(char);
- method public void setMinusSignString(String);
- method public void setMonetaryDecimalSeparator(char);
- method public void setMonetaryDecimalSeparatorString(String);
- method public void setMonetaryGroupingSeparator(char);
- method public void setMonetaryGroupingSeparatorString(String);
- method public void setNaN(String);
- method public void setPadEscape(char);
- method public void setPatternForCurrencySpacing(int, boolean, String);
- method public void setPatternSeparator(char);
- method public void setPerMill(char);
- method public void setPerMillString(String);
- method public void setPercent(char);
- method public void setPercentString(String);
- method public void setPlusSign(char);
- method public void setPlusSignString(String);
- method public void setSignificantDigit(char);
- method public void setZeroDigit(char);
- field public static final int CURRENCY_SPC_CURRENCY_MATCH = 0; // 0x0
- field public static final int CURRENCY_SPC_INSERT = 2; // 0x2
- field public static final int CURRENCY_SPC_SURROUNDING_MATCH = 1; // 0x1
- }
-
- public enum DisplayContext {
- method public android.icu.text.DisplayContext.Type type();
- method public int value();
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_STANDALONE;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_UI_LIST_OR_MENU;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_NONE;
- enum_constant public static final android.icu.text.DisplayContext DIALECT_NAMES;
- enum_constant public static final android.icu.text.DisplayContext LENGTH_FULL;
- enum_constant public static final android.icu.text.DisplayContext LENGTH_SHORT;
- enum_constant public static final android.icu.text.DisplayContext NO_SUBSTITUTE;
- enum_constant public static final android.icu.text.DisplayContext STANDARD_NAMES;
- enum_constant public static final android.icu.text.DisplayContext SUBSTITUTE;
- }
-
- public enum DisplayContext.Type {
- enum_constant public static final android.icu.text.DisplayContext.Type CAPITALIZATION;
- enum_constant public static final android.icu.text.DisplayContext.Type DIALECT_HANDLING;
- enum_constant public static final android.icu.text.DisplayContext.Type DISPLAY_LENGTH;
- enum_constant public static final android.icu.text.DisplayContext.Type SUBSTITUTE_HANDLING;
- }
-
- public final class Edits {
- ctor public Edits();
- method public void addReplace(int, int);
- method public void addUnchanged(int);
- method public android.icu.text.Edits.Iterator getCoarseChangesIterator();
- method public android.icu.text.Edits.Iterator getCoarseIterator();
- method public android.icu.text.Edits.Iterator getFineChangesIterator();
- method public android.icu.text.Edits.Iterator getFineIterator();
- method public boolean hasChanges();
- method public int lengthDelta();
- method public android.icu.text.Edits mergeAndAppend(android.icu.text.Edits, android.icu.text.Edits);
- method public int numberOfChanges();
- method public void reset();
- }
-
- public static final class Edits.Iterator {
- method public int destinationIndex();
- method public int destinationIndexFromSourceIndex(int);
- method public boolean findDestinationIndex(int);
- method public boolean findSourceIndex(int);
- method public boolean hasChange();
- method public int newLength();
- method public boolean next();
- method public int oldLength();
- method public int replacementIndex();
- method public int sourceIndex();
- method public int sourceIndexFromDestinationIndex(int);
- }
-
- public abstract class IDNA {
- method public static android.icu.text.IDNA getUTS46Instance(int);
- method public abstract StringBuilder labelToASCII(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- method public abstract StringBuilder labelToUnicode(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- method public abstract StringBuilder nameToASCII(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- method public abstract StringBuilder nameToUnicode(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- field public static final int CHECK_BIDI = 4; // 0x4
- field public static final int CHECK_CONTEXTJ = 8; // 0x8
- field public static final int CHECK_CONTEXTO = 64; // 0x40
- field public static final int DEFAULT = 0; // 0x0
- field public static final int NONTRANSITIONAL_TO_ASCII = 16; // 0x10
- field public static final int NONTRANSITIONAL_TO_UNICODE = 32; // 0x20
- field public static final int USE_STD3_RULES = 2; // 0x2
- }
-
- public enum IDNA.Error {
- enum_constant public static final android.icu.text.IDNA.Error BIDI;
- enum_constant public static final android.icu.text.IDNA.Error CONTEXTJ;
- enum_constant public static final android.icu.text.IDNA.Error CONTEXTO_DIGITS;
- enum_constant public static final android.icu.text.IDNA.Error CONTEXTO_PUNCTUATION;
- enum_constant public static final android.icu.text.IDNA.Error DISALLOWED;
- enum_constant public static final android.icu.text.IDNA.Error DOMAIN_NAME_TOO_LONG;
- enum_constant public static final android.icu.text.IDNA.Error EMPTY_LABEL;
- enum_constant public static final android.icu.text.IDNA.Error HYPHEN_3_4;
- enum_constant public static final android.icu.text.IDNA.Error INVALID_ACE_LABEL;
- enum_constant public static final android.icu.text.IDNA.Error LABEL_HAS_DOT;
- enum_constant public static final android.icu.text.IDNA.Error LABEL_TOO_LONG;
- enum_constant public static final android.icu.text.IDNA.Error LEADING_COMBINING_MARK;
- enum_constant public static final android.icu.text.IDNA.Error LEADING_HYPHEN;
- enum_constant public static final android.icu.text.IDNA.Error PUNYCODE;
- enum_constant public static final android.icu.text.IDNA.Error TRAILING_HYPHEN;
- }
-
- public static final class IDNA.Info {
- ctor public IDNA.Info();
- method public java.util.Set<android.icu.text.IDNA.Error> getErrors();
- method public boolean hasErrors();
- method public boolean isTransitionalDifferent();
- }
-
- public final class ListFormatter {
- method public String format(java.lang.Object...);
- method public String format(java.util.Collection<?>);
- method public static android.icu.text.ListFormatter getInstance(android.icu.util.ULocale);
- method public static android.icu.text.ListFormatter getInstance(java.util.Locale);
- method public static android.icu.text.ListFormatter getInstance();
- method public String getPatternForNumItems(int);
- }
-
- public abstract class LocaleDisplayNames {
- method public abstract android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
- method public abstract android.icu.text.LocaleDisplayNames.DialectHandling getDialectHandling();
- method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale);
- method public static android.icu.text.LocaleDisplayNames getInstance(java.util.Locale);
- method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale, android.icu.text.LocaleDisplayNames.DialectHandling);
- method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale, android.icu.text.DisplayContext...);
- method public static android.icu.text.LocaleDisplayNames getInstance(java.util.Locale, android.icu.text.DisplayContext...);
- method public abstract android.icu.util.ULocale getLocale();
- method public java.util.List<android.icu.text.LocaleDisplayNames.UiListItem> getUiList(java.util.Set<android.icu.util.ULocale>, boolean, java.util.Comparator<java.lang.Object>);
- method public abstract java.util.List<android.icu.text.LocaleDisplayNames.UiListItem> getUiListCompareWholeItems(java.util.Set<android.icu.util.ULocale>, java.util.Comparator<android.icu.text.LocaleDisplayNames.UiListItem>);
- method public abstract String keyDisplayName(String);
- method public abstract String keyValueDisplayName(String, String);
- method public abstract String languageDisplayName(String);
- method public abstract String localeDisplayName(android.icu.util.ULocale);
- method public abstract String localeDisplayName(java.util.Locale);
- method public abstract String localeDisplayName(String);
- method public abstract String regionDisplayName(String);
- method public abstract String scriptDisplayName(String);
- method public abstract String scriptDisplayName(int);
- method public abstract String variantDisplayName(String);
- }
-
- public enum LocaleDisplayNames.DialectHandling {
- enum_constant public static final android.icu.text.LocaleDisplayNames.DialectHandling DIALECT_NAMES;
- enum_constant public static final android.icu.text.LocaleDisplayNames.DialectHandling STANDARD_NAMES;
- }
-
- public static class LocaleDisplayNames.UiListItem {
- ctor public LocaleDisplayNames.UiListItem(android.icu.util.ULocale, android.icu.util.ULocale, String, String);
- method public static java.util.Comparator<android.icu.text.LocaleDisplayNames.UiListItem> getComparator(java.util.Comparator<java.lang.Object>, boolean);
- field public final android.icu.util.ULocale minimized;
- field public final android.icu.util.ULocale modified;
- field public final String nameInDisplayLocale;
- field public final String nameInSelf;
- }
-
- public class MeasureFormat extends android.icu.text.UFormat {
- method public final boolean equals(Object);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public StringBuilder formatMeasurePerUnit(android.icu.util.Measure, android.icu.util.MeasureUnit, StringBuilder, java.text.FieldPosition);
- method public final String formatMeasures(android.icu.util.Measure...);
- method public StringBuilder formatMeasures(StringBuilder, java.text.FieldPosition, android.icu.util.Measure...);
- method public static android.icu.text.MeasureFormat getCurrencyFormat(android.icu.util.ULocale);
- method public static android.icu.text.MeasureFormat getCurrencyFormat(java.util.Locale);
- method public static android.icu.text.MeasureFormat getCurrencyFormat();
- method public static android.icu.text.MeasureFormat getInstance(android.icu.util.ULocale, android.icu.text.MeasureFormat.FormatWidth);
- method public static android.icu.text.MeasureFormat getInstance(java.util.Locale, android.icu.text.MeasureFormat.FormatWidth);
- method public static android.icu.text.MeasureFormat getInstance(android.icu.util.ULocale, android.icu.text.MeasureFormat.FormatWidth, android.icu.text.NumberFormat);
- method public static android.icu.text.MeasureFormat getInstance(java.util.Locale, android.icu.text.MeasureFormat.FormatWidth, android.icu.text.NumberFormat);
- method public final android.icu.util.ULocale getLocale();
- method public android.icu.text.NumberFormat getNumberFormat();
- method public String getUnitDisplayName(android.icu.util.MeasureUnit);
- method public android.icu.text.MeasureFormat.FormatWidth getWidth();
- method public final int hashCode();
- method public android.icu.util.Measure parseObject(String, java.text.ParsePosition);
- }
-
- public enum MeasureFormat.FormatWidth {
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth NARROW;
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth NUMERIC;
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth SHORT;
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth WIDE;
- }
-
- public class MessageFormat extends android.icu.text.UFormat {
- ctor public MessageFormat(String);
- ctor public MessageFormat(String, java.util.Locale);
- ctor public MessageFormat(String, android.icu.util.ULocale);
- method public void applyPattern(String);
- method public void applyPattern(String, android.icu.text.MessagePattern.ApostropheMode);
- method public static String autoQuoteApostrophe(String);
- method public final StringBuffer format(Object[], StringBuffer, java.text.FieldPosition);
- method public final StringBuffer format(java.util.Map<java.lang.String,java.lang.Object>, StringBuffer, java.text.FieldPosition);
- method public static String format(String, java.lang.Object...);
- method public static String format(String, java.util.Map<java.lang.String,java.lang.Object>);
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public android.icu.text.MessagePattern.ApostropheMode getApostropheMode();
- method public java.util.Set<java.lang.String> getArgumentNames();
- method public java.text.Format getFormatByArgumentName(String);
- method public java.text.Format[] getFormats();
- method public java.text.Format[] getFormatsByArgumentIndex();
- method public java.util.Locale getLocale();
- method public android.icu.util.ULocale getULocale();
- method public Object[] parse(String, java.text.ParsePosition);
- method public Object[] parse(String) throws java.text.ParseException;
- method public Object parseObject(String, java.text.ParsePosition);
- method public java.util.Map<java.lang.String,java.lang.Object> parseToMap(String, java.text.ParsePosition);
- method public java.util.Map<java.lang.String,java.lang.Object> parseToMap(String) throws java.text.ParseException;
- method public void setFormat(int, java.text.Format);
- method public void setFormatByArgumentIndex(int, java.text.Format);
- method public void setFormatByArgumentName(String, java.text.Format);
- method public void setFormats(java.text.Format[]);
- method public void setFormatsByArgumentIndex(java.text.Format[]);
- method public void setFormatsByArgumentName(java.util.Map<java.lang.String,java.text.Format>);
- method public void setLocale(java.util.Locale);
- method public void setLocale(android.icu.util.ULocale);
- method public String toPattern();
- method public boolean usesNamedArguments();
- }
-
- public static class MessageFormat.Field extends java.text.Format.Field {
- ctor protected MessageFormat.Field(String);
- field public static final android.icu.text.MessageFormat.Field ARGUMENT;
- }
-
- public final class MessagePattern implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.MessagePattern> {
- ctor public MessagePattern();
- ctor public MessagePattern(android.icu.text.MessagePattern.ApostropheMode);
- ctor public MessagePattern(String);
- method public String autoQuoteApostropheDeep();
- method public void clear();
- method public void clearPatternAndSetApostropheMode(android.icu.text.MessagePattern.ApostropheMode);
- method public Object clone();
- method public android.icu.text.MessagePattern cloneAsThawed();
- method public int countParts();
- method public android.icu.text.MessagePattern freeze();
- method public android.icu.text.MessagePattern.ApostropheMode getApostropheMode();
- method public int getLimitPartIndex(int);
- method public double getNumericValue(android.icu.text.MessagePattern.Part);
- method public android.icu.text.MessagePattern.Part getPart(int);
- method public android.icu.text.MessagePattern.Part.Type getPartType(int);
- method public int getPatternIndex(int);
- method public String getPatternString();
- method public double getPluralOffset(int);
- method public String getSubstring(android.icu.text.MessagePattern.Part);
- method public boolean hasNamedArguments();
- method public boolean hasNumberedArguments();
- method public boolean isFrozen();
- method public android.icu.text.MessagePattern parse(String);
- method public android.icu.text.MessagePattern parseChoiceStyle(String);
- method public android.icu.text.MessagePattern parsePluralStyle(String);
- method public android.icu.text.MessagePattern parseSelectStyle(String);
- method public boolean partSubstringMatches(android.icu.text.MessagePattern.Part, String);
- method public static int validateArgumentName(String);
- field public static final int ARG_NAME_NOT_NUMBER = -1; // 0xffffffff
- field public static final int ARG_NAME_NOT_VALID = -2; // 0xfffffffe
- field public static final double NO_NUMERIC_VALUE = -1.23456789E8;
- }
-
- public enum MessagePattern.ApostropheMode {
- enum_constant public static final android.icu.text.MessagePattern.ApostropheMode DOUBLE_OPTIONAL;
- enum_constant public static final android.icu.text.MessagePattern.ApostropheMode DOUBLE_REQUIRED;
- }
-
- public enum MessagePattern.ArgType {
- method public boolean hasPluralStyle();
- enum_constant public static final android.icu.text.MessagePattern.ArgType CHOICE;
- enum_constant public static final android.icu.text.MessagePattern.ArgType NONE;
- enum_constant public static final android.icu.text.MessagePattern.ArgType PLURAL;
- enum_constant public static final android.icu.text.MessagePattern.ArgType SELECT;
- enum_constant public static final android.icu.text.MessagePattern.ArgType SELECTORDINAL;
- enum_constant public static final android.icu.text.MessagePattern.ArgType SIMPLE;
- }
-
- public static final class MessagePattern.Part {
- method public android.icu.text.MessagePattern.ArgType getArgType();
- method public int getIndex();
- method public int getLength();
- method public int getLimit();
- method public android.icu.text.MessagePattern.Part.Type getType();
- method public int getValue();
- }
-
- public enum MessagePattern.Part.Type {
- method public boolean hasNumericValue();
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_DOUBLE;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_INT;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_LIMIT;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_NAME;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_NUMBER;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_SELECTOR;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_START;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_STYLE;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_TYPE;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type INSERT_CHAR;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type MSG_LIMIT;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type MSG_START;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type REPLACE_NUMBER;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type SKIP_SYNTAX;
- }
-
- public final class Normalizer implements java.lang.Cloneable {
- method @Deprecated public Object clone();
- method public static int compare(char[], int, int, char[], int, int, int);
- method public static int compare(String, String, int);
- method public static int compare(char[], char[], int);
- method public static int compare(int, int, int);
- method public static int compare(int, String, int);
- field public static final int COMPARE_CODE_POINT_ORDER = 32768; // 0x8000
- field public static final int COMPARE_IGNORE_CASE = 65536; // 0x10000
- field public static final int FOLD_CASE_DEFAULT = 0; // 0x0
- field public static final int FOLD_CASE_EXCLUDE_SPECIAL_I = 1; // 0x1
- field public static final int INPUT_IS_FCD = 131072; // 0x20000
- field public static final android.icu.text.Normalizer.QuickCheckResult MAYBE;
- field public static final android.icu.text.Normalizer.QuickCheckResult NO;
- field public static final android.icu.text.Normalizer.QuickCheckResult YES;
- }
-
- public static final class Normalizer.QuickCheckResult {
- }
-
- public abstract class Normalizer2 {
- method public abstract StringBuilder append(StringBuilder, CharSequence);
- method public int composePair(int, int);
- method public int getCombiningClass(int);
- method public abstract String getDecomposition(int);
- method public static android.icu.text.Normalizer2 getInstance(java.io.InputStream, String, android.icu.text.Normalizer2.Mode);
- method public static android.icu.text.Normalizer2 getNFCInstance();
- method public static android.icu.text.Normalizer2 getNFDInstance();
- method public static android.icu.text.Normalizer2 getNFKCCasefoldInstance();
- method public static android.icu.text.Normalizer2 getNFKCInstance();
- method public static android.icu.text.Normalizer2 getNFKDInstance();
- method public String getRawDecomposition(int);
- method public abstract boolean hasBoundaryAfter(int);
- method public abstract boolean hasBoundaryBefore(int);
- method public abstract boolean isInert(int);
- method public abstract boolean isNormalized(CharSequence);
- method public String normalize(CharSequence);
- method public abstract StringBuilder normalize(CharSequence, StringBuilder);
- method public abstract Appendable normalize(CharSequence, Appendable);
- method public abstract StringBuilder normalizeSecondAndAppend(StringBuilder, CharSequence);
- method public abstract android.icu.text.Normalizer.QuickCheckResult quickCheck(CharSequence);
- method public abstract int spanQuickCheckYes(CharSequence);
- }
-
- public enum Normalizer2.Mode {
- enum_constant public static final android.icu.text.Normalizer2.Mode COMPOSE;
- enum_constant public static final android.icu.text.Normalizer2.Mode COMPOSE_CONTIGUOUS;
- enum_constant public static final android.icu.text.Normalizer2.Mode DECOMPOSE;
- enum_constant public static final android.icu.text.Normalizer2.Mode FCD;
- }
-
- public abstract class NumberFormat extends android.icu.text.UFormat {
- ctor public NumberFormat();
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public final String format(double);
- method public final String format(long);
- method public final String format(java.math.BigInteger);
- method public final String format(java.math.BigDecimal);
- method public final String format(android.icu.math.BigDecimal);
- method public final String format(android.icu.util.CurrencyAmount);
- method public abstract StringBuffer format(double, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(long, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(java.math.BigInteger, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(java.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(android.icu.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(android.icu.util.CurrencyAmount, StringBuffer, java.text.FieldPosition);
- method public static java.util.Locale[] getAvailableLocales();
- method public android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
- method public android.icu.util.Currency getCurrency();
- method public static final android.icu.text.NumberFormat getCurrencyInstance();
- method public static android.icu.text.NumberFormat getCurrencyInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getCurrencyInstance(android.icu.util.ULocale);
- method public static final android.icu.text.NumberFormat getInstance();
- method public static android.icu.text.NumberFormat getInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getInstance(android.icu.util.ULocale);
- method public static final android.icu.text.NumberFormat getInstance(int);
- method public static android.icu.text.NumberFormat getInstance(java.util.Locale, int);
- method public static android.icu.text.NumberFormat getInstance(android.icu.util.ULocale, int);
- method public static final android.icu.text.NumberFormat getIntegerInstance();
- method public static android.icu.text.NumberFormat getIntegerInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getIntegerInstance(android.icu.util.ULocale);
- method public int getMaximumFractionDigits();
- method public int getMaximumIntegerDigits();
- method public int getMinimumFractionDigits();
- method public int getMinimumIntegerDigits();
- method public static final android.icu.text.NumberFormat getNumberInstance();
- method public static android.icu.text.NumberFormat getNumberInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getNumberInstance(android.icu.util.ULocale);
- method protected static String getPattern(android.icu.util.ULocale, int);
- method public static final android.icu.text.NumberFormat getPercentInstance();
- method public static android.icu.text.NumberFormat getPercentInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getPercentInstance(android.icu.util.ULocale);
- method public int getRoundingMode();
- method public static final android.icu.text.NumberFormat getScientificInstance();
- method public static android.icu.text.NumberFormat getScientificInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getScientificInstance(android.icu.util.ULocale);
- method public boolean isGroupingUsed();
- method public boolean isParseIntegerOnly();
- method public boolean isParseStrict();
- method public abstract Number parse(String, java.text.ParsePosition);
- method public Number parse(String) throws java.text.ParseException;
- method public android.icu.util.CurrencyAmount parseCurrency(CharSequence, java.text.ParsePosition);
- method public final Object parseObject(String, java.text.ParsePosition);
- method public void setContext(android.icu.text.DisplayContext);
- method public void setCurrency(android.icu.util.Currency);
- method public void setGroupingUsed(boolean);
- method public void setMaximumFractionDigits(int);
- method public void setMaximumIntegerDigits(int);
- method public void setMinimumFractionDigits(int);
- method public void setMinimumIntegerDigits(int);
- method public void setParseIntegerOnly(boolean);
- method public void setParseStrict(boolean);
- method public void setRoundingMode(int);
- field public static final int ACCOUNTINGCURRENCYSTYLE = 7; // 0x7
- field public static final int CASHCURRENCYSTYLE = 8; // 0x8
- field public static final int CURRENCYSTYLE = 1; // 0x1
- field public static final int FRACTION_FIELD = 1; // 0x1
- field public static final int INTEGERSTYLE = 4; // 0x4
- field public static final int INTEGER_FIELD = 0; // 0x0
- field public static final int ISOCURRENCYSTYLE = 5; // 0x5
- field public static final int NUMBERSTYLE = 0; // 0x0
- field public static final int PERCENTSTYLE = 2; // 0x2
- field public static final int PLURALCURRENCYSTYLE = 6; // 0x6
- field public static final int SCIENTIFICSTYLE = 3; // 0x3
- field public static final int STANDARDCURRENCYSTYLE = 9; // 0x9
- }
-
- public static class NumberFormat.Field extends java.text.Format.Field {
- ctor protected NumberFormat.Field(String);
- field public static final android.icu.text.NumberFormat.Field CURRENCY;
- field public static final android.icu.text.NumberFormat.Field DECIMAL_SEPARATOR;
- field public static final android.icu.text.NumberFormat.Field EXPONENT;
- field public static final android.icu.text.NumberFormat.Field EXPONENT_SIGN;
- field public static final android.icu.text.NumberFormat.Field EXPONENT_SYMBOL;
- field public static final android.icu.text.NumberFormat.Field FRACTION;
- field public static final android.icu.text.NumberFormat.Field GROUPING_SEPARATOR;
- field public static final android.icu.text.NumberFormat.Field INTEGER;
- field public static final android.icu.text.NumberFormat.Field PERCENT;
- field public static final android.icu.text.NumberFormat.Field PERMILLE;
- field public static final android.icu.text.NumberFormat.Field SIGN;
- }
-
- public class NumberingSystem {
- ctor public NumberingSystem();
- method public static String[] getAvailableNames();
- method public String getDescription();
- method public static android.icu.text.NumberingSystem getInstance(int, boolean, String);
- method public static android.icu.text.NumberingSystem getInstance(java.util.Locale);
- method public static android.icu.text.NumberingSystem getInstance(android.icu.util.ULocale);
- method public static android.icu.text.NumberingSystem getInstance();
- method public static android.icu.text.NumberingSystem getInstanceByName(String);
- method public String getName();
- method public int getRadix();
- method public boolean isAlgorithmic();
- method public static boolean isValidDigitString(String);
- field public static final android.icu.text.NumberingSystem LATIN;
- }
-
- public class PluralFormat extends android.icu.text.UFormat {
- ctor public PluralFormat();
- ctor public PluralFormat(android.icu.util.ULocale);
- ctor public PluralFormat(java.util.Locale);
- ctor public PluralFormat(android.icu.text.PluralRules);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules);
- ctor public PluralFormat(java.util.Locale, android.icu.text.PluralRules);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType);
- ctor public PluralFormat(java.util.Locale, android.icu.text.PluralRules.PluralType);
- ctor public PluralFormat(String);
- ctor public PluralFormat(android.icu.util.ULocale, String);
- ctor public PluralFormat(android.icu.text.PluralRules, String);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules, String);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType, String);
- method public void applyPattern(String);
- method public boolean equals(android.icu.text.PluralFormat);
- method public final String format(double);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public Number parse(String, java.text.ParsePosition);
- method public Object parseObject(String, java.text.ParsePosition);
- method public void setNumberFormat(android.icu.text.NumberFormat);
- method public String toPattern();
- }
-
- public class PluralRules implements java.io.Serializable {
- method public static android.icu.text.PluralRules createRules(String);
- method public boolean equals(android.icu.text.PluralRules);
- method public static android.icu.text.PluralRules forLocale(android.icu.util.ULocale);
- method public static android.icu.text.PluralRules forLocale(java.util.Locale);
- method public static android.icu.text.PluralRules forLocale(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType);
- method public static android.icu.text.PluralRules forLocale(java.util.Locale, android.icu.text.PluralRules.PluralType);
- method public java.util.Collection<java.lang.Double> getAllKeywordValues(String);
- method public java.util.Set<java.lang.String> getKeywords();
- method public java.util.Collection<java.lang.Double> getSamples(String);
- method public double getUniqueKeywordValue(String);
- method public static android.icu.text.PluralRules parseDescription(String) throws java.text.ParseException;
- method public String select(double);
- field public static final android.icu.text.PluralRules DEFAULT;
- field public static final String KEYWORD_FEW = "few";
- field public static final String KEYWORD_MANY = "many";
- field public static final String KEYWORD_ONE = "one";
- field public static final String KEYWORD_OTHER = "other";
- field public static final String KEYWORD_TWO = "two";
- field public static final String KEYWORD_ZERO = "zero";
- field public static final double NO_UNIQUE_VALUE = -0.00123456777;
- }
-
- public enum PluralRules.PluralType {
- enum_constant public static final android.icu.text.PluralRules.PluralType CARDINAL;
- enum_constant public static final android.icu.text.PluralRules.PluralType ORDINAL;
- }
-
- public final class RelativeDateTimeFormatter {
- method public String combineDateAndTime(String, String);
- method public String format(double, android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.RelativeUnit);
- method public String format(android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit);
- method public String format(double, android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit);
- method public String formatNumeric(double, android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit);
- method public android.icu.text.DisplayContext getCapitalizationContext();
- method public android.icu.text.RelativeDateTimeFormatter.Style getFormatStyle();
- method public static android.icu.text.RelativeDateTimeFormatter getInstance();
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(java.util.Locale);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale, android.icu.text.NumberFormat);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale, android.icu.text.NumberFormat, android.icu.text.RelativeDateTimeFormatter.Style, android.icu.text.DisplayContext);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(java.util.Locale, android.icu.text.NumberFormat);
- method public android.icu.text.NumberFormat getNumberFormat();
- }
-
- public enum RelativeDateTimeFormatter.AbsoluteUnit {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit DAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit FRIDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit MONDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit MONTH;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit NOW;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit SATURDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit SUNDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit THURSDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit TUESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit WEDNESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit WEEK;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit YEAR;
- }
-
- public enum RelativeDateTimeFormatter.Direction {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction LAST;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction LAST_2;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction NEXT;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction NEXT_2;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction PLAIN;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction THIS;
- }
-
- public enum RelativeDateTimeFormatter.RelativeDateTimeUnit {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit DAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit FRIDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit HOUR;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MINUTE;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MONDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MONTH;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit QUARTER;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SATURDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SECOND;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SUNDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit THURSDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit TUESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit WEDNESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit WEEK;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit YEAR;
- }
-
- public enum RelativeDateTimeFormatter.RelativeUnit {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit DAYS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit HOURS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit MINUTES;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit MONTHS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit SECONDS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit WEEKS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit YEARS;
- }
-
- public enum RelativeDateTimeFormatter.Style {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style LONG;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style NARROW;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style SHORT;
- }
-
- public interface Replaceable {
- method public int char32At(int);
- method public char charAt(int);
- method public void copy(int, int, int);
- method public void getChars(int, int, char[], int);
- method public boolean hasMetaData();
- method public int length();
- method public void replace(int, int, String);
- method public void replace(int, int, char[], int, int);
- }
-
- public final class RuleBasedCollator extends android.icu.text.Collator {
- ctor public RuleBasedCollator(String) throws java.lang.Exception;
- method public android.icu.text.RuleBasedCollator cloneAsThawed();
- method public int compare(String, String);
- method public android.icu.text.CollationElementIterator getCollationElementIterator(String);
- method public android.icu.text.CollationElementIterator getCollationElementIterator(java.text.CharacterIterator);
- method public android.icu.text.CollationElementIterator getCollationElementIterator(android.icu.text.UCharacterIterator);
- method public android.icu.text.CollationKey getCollationKey(String);
- method public void getContractionsAndExpansions(android.icu.text.UnicodeSet, android.icu.text.UnicodeSet, boolean) throws java.lang.Exception;
- method public boolean getNumericCollation();
- method public String getRules();
- method public String getRules(boolean);
- method public android.icu.util.VersionInfo getUCAVersion();
- method public int getVariableTop();
- method public android.icu.util.VersionInfo getVersion();
- method public boolean isAlternateHandlingShifted();
- method public boolean isCaseLevel();
- method public boolean isFrenchCollation();
- method public boolean isLowerCaseFirst();
- method public boolean isUpperCaseFirst();
- method public void setAlternateHandlingDefault();
- method public void setAlternateHandlingShifted(boolean);
- method public void setCaseFirstDefault();
- method public void setCaseLevel(boolean);
- method public void setCaseLevelDefault();
- method public void setDecompositionDefault();
- method public void setFrenchCollation(boolean);
- method public void setFrenchCollationDefault();
- method public void setLowerCaseFirst(boolean);
- method public android.icu.text.RuleBasedCollator setMaxVariable(int);
- method public void setNumericCollation(boolean);
- method public void setNumericCollationDefault();
- method public void setStrengthDefault();
- method public void setUpperCaseFirst(boolean);
- }
-
- public final class ScientificNumberFormatter {
- method public String format(Object);
- method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.util.ULocale, String, String);
- method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.text.DecimalFormat, String, String);
- method public static android.icu.text.ScientificNumberFormatter getSuperscriptInstance(android.icu.util.ULocale);
- method public static android.icu.text.ScientificNumberFormatter getSuperscriptInstance(android.icu.text.DecimalFormat);
- }
-
- public abstract class SearchIterator {
- ctor protected SearchIterator(java.text.CharacterIterator, android.icu.text.BreakIterator);
- method public final int first();
- method public final int following(int);
- method public android.icu.text.BreakIterator getBreakIterator();
- method public android.icu.text.SearchIterator.ElementComparisonType getElementComparisonType();
- method public abstract int getIndex();
- method public int getMatchLength();
- method public int getMatchStart();
- method public String getMatchedText();
- method public java.text.CharacterIterator getTarget();
- method protected abstract int handleNext(int);
- method protected abstract int handlePrevious(int);
- method public boolean isOverlapping();
- method public final int last();
- method public int next();
- method public final int preceding(int);
- method public int previous();
- method public void reset();
- method public void setBreakIterator(android.icu.text.BreakIterator);
- method public void setElementComparisonType(android.icu.text.SearchIterator.ElementComparisonType);
- method public void setIndex(int);
- method protected void setMatchLength(int);
- method public void setOverlapping(boolean);
- method public void setTarget(java.text.CharacterIterator);
- field public static final int DONE = -1; // 0xffffffff
- field protected android.icu.text.BreakIterator breakIterator;
- field protected int matchLength;
- field protected java.text.CharacterIterator targetText;
- }
-
- public enum SearchIterator.ElementComparisonType {
- enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType ANY_BASE_WEIGHT_IS_WILDCARD;
- enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType PATTERN_BASE_WEIGHT_IS_WILDCARD;
- enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType STANDARD_ELEMENT_COMPARISON;
- }
-
- public class SelectFormat extends java.text.Format {
- ctor public SelectFormat(String);
- method public void applyPattern(String);
- method public final String format(String);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public Object parseObject(String, java.text.ParsePosition);
- method public String toPattern();
- }
-
- public class SimpleDateFormat extends android.icu.text.DateFormat {
- ctor public SimpleDateFormat();
- ctor public SimpleDateFormat(String);
- ctor public SimpleDateFormat(String, java.util.Locale);
- ctor public SimpleDateFormat(String, android.icu.util.ULocale);
- ctor public SimpleDateFormat(String, String, android.icu.util.ULocale);
- ctor public SimpleDateFormat(String, android.icu.text.DateFormatSymbols);
- method public void applyLocalizedPattern(String);
- method public void applyPattern(String);
- method public StringBuffer format(android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
- method public java.util.Date get2DigitYearStart();
- method public android.icu.text.DateFormatSymbols getDateFormatSymbols();
- method public android.icu.text.NumberFormat getNumberFormat(char);
- method protected android.icu.text.DateFormatSymbols getSymbols();
- method public android.icu.text.TimeZoneFormat getTimeZoneFormat();
- method protected int matchQuarterString(String, int, int, String[], android.icu.util.Calendar);
- method protected int matchString(String, int, int, String[], android.icu.util.Calendar);
- method public void parse(String, android.icu.util.Calendar, java.text.ParsePosition);
- method protected android.icu.text.DateFormat.Field patternCharToDateFormatField(char);
- method public void set2DigitYearStart(java.util.Date);
- method public void setDateFormatSymbols(android.icu.text.DateFormatSymbols);
- method public void setNumberFormat(String, android.icu.text.NumberFormat);
- method public void setTimeZoneFormat(android.icu.text.TimeZoneFormat);
- method protected String subFormat(char, int, int, java.text.FieldPosition, android.icu.text.DateFormatSymbols, android.icu.util.Calendar) throws java.lang.IllegalArgumentException;
- method protected int subParse(String, int, char, int, boolean, boolean, boolean[], android.icu.util.Calendar);
- method public String toLocalizedPattern();
- method public String toPattern();
- method protected String zeroPaddingNumber(long, int, int);
- }
-
- public class StringPrepParseException extends java.text.ParseException {
- ctor public StringPrepParseException(String, int);
- ctor public StringPrepParseException(String, int, String, int);
- ctor public StringPrepParseException(String, int, String, int, int);
- method public int getError();
- field public static final int ACE_PREFIX_ERROR = 6; // 0x6
- field public static final int BUFFER_OVERFLOW_ERROR = 9; // 0x9
- field public static final int CHECK_BIDI_ERROR = 4; // 0x4
- field public static final int DOMAIN_NAME_TOO_LONG_ERROR = 11; // 0xb
- field public static final int ILLEGAL_CHAR_FOUND = 1; // 0x1
- field public static final int INVALID_CHAR_FOUND = 0; // 0x0
- field public static final int LABEL_TOO_LONG_ERROR = 8; // 0x8
- field public static final int PROHIBITED_ERROR = 2; // 0x2
- field public static final int STD3_ASCII_RULES_ERROR = 5; // 0x5
- field public static final int UNASSIGNED_ERROR = 3; // 0x3
- field public static final int VERIFICATION_ERROR = 7; // 0x7
- field public static final int ZERO_LENGTH_LABEL = 10; // 0xa
- }
-
- public final class StringSearch extends android.icu.text.SearchIterator {
- ctor public StringSearch(String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator, android.icu.text.BreakIterator);
- ctor public StringSearch(String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator);
- ctor public StringSearch(String, java.text.CharacterIterator, java.util.Locale);
- ctor public StringSearch(String, java.text.CharacterIterator, android.icu.util.ULocale);
- ctor public StringSearch(String, String);
- method public android.icu.text.RuleBasedCollator getCollator();
- method public int getIndex();
- method public String getPattern();
- method protected int handleNext(int);
- method protected int handlePrevious(int);
- method public boolean isCanonical();
- method public void setCanonical(boolean);
- method public void setCollator(android.icu.text.RuleBasedCollator);
- method public void setPattern(String);
- }
-
- public interface SymbolTable {
- method public char[] lookup(String);
- method public android.icu.text.UnicodeMatcher lookupMatcher(int);
- method public String parseReference(String, java.text.ParsePosition, int);
- field public static final char SYMBOL_REF = 36; // 0x0024 '$'
- }
-
- public class TimeZoneFormat extends android.icu.text.UFormat implements android.icu.util.Freezable<android.icu.text.TimeZoneFormat> java.io.Serializable {
- ctor protected TimeZoneFormat(android.icu.util.ULocale);
- method public android.icu.text.TimeZoneFormat cloneAsThawed();
- method public final String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long);
- method public String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public final String formatOffsetISO8601Basic(int, boolean, boolean, boolean);
- method public final String formatOffsetISO8601Extended(int, boolean, boolean, boolean);
- method public String formatOffsetLocalizedGMT(int);
- method public String formatOffsetShortLocalizedGMT(int);
- method public android.icu.text.TimeZoneFormat freeze();
- method public java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption> getDefaultParseOptions();
- method public String getGMTOffsetDigits();
- method public String getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType);
- method public String getGMTPattern();
- method public String getGMTZeroFormat();
- method public static android.icu.text.TimeZoneFormat getInstance(android.icu.util.ULocale);
- method public static android.icu.text.TimeZoneFormat getInstance(java.util.Locale);
- method public android.icu.text.TimeZoneNames getTimeZoneNames();
- method public boolean isFrozen();
- method public android.icu.util.TimeZone parse(android.icu.text.TimeZoneFormat.Style, String, java.text.ParsePosition, java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
- method public android.icu.util.TimeZone parse(android.icu.text.TimeZoneFormat.Style, String, java.text.ParsePosition, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
- method public final android.icu.util.TimeZone parse(String, java.text.ParsePosition);
- method public final android.icu.util.TimeZone parse(String) throws java.text.ParseException;
- method public Object parseObject(String, java.text.ParsePosition);
- method public final int parseOffsetISO8601(String, java.text.ParsePosition);
- method public int parseOffsetLocalizedGMT(String, java.text.ParsePosition);
- method public int parseOffsetShortLocalizedGMT(String, java.text.ParsePosition);
- method public android.icu.text.TimeZoneFormat setDefaultParseOptions(java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>);
- method public android.icu.text.TimeZoneFormat setGMTOffsetDigits(String);
- method public android.icu.text.TimeZoneFormat setGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType, String);
- method public android.icu.text.TimeZoneFormat setGMTPattern(String);
- method public android.icu.text.TimeZoneFormat setGMTZeroFormat(String);
- method public android.icu.text.TimeZoneFormat setTimeZoneNames(android.icu.text.TimeZoneNames);
- }
-
- public enum TimeZoneFormat.GMTOffsetPatternType {
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_H;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_HM;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_HMS;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_H;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_HM;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_HMS;
- }
-
- public enum TimeZoneFormat.ParseOption {
- enum_constant public static final android.icu.text.TimeZoneFormat.ParseOption ALL_STYLES;
- enum_constant public static final android.icu.text.TimeZoneFormat.ParseOption TZ_DATABASE_ABBREVIATIONS;
- }
-
- public enum TimeZoneFormat.Style {
- enum_constant public static final android.icu.text.TimeZoneFormat.Style EXEMPLAR_LOCATION;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_LOCATION;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_LONG;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_LOCAL_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_LOCAL_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style LOCALIZED_GMT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style LOCALIZED_GMT_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style SPECIFIC_LONG;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style SPECIFIC_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ZONE_ID;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ZONE_ID_SHORT;
- }
-
- public enum TimeZoneFormat.TimeType {
- enum_constant public static final android.icu.text.TimeZoneFormat.TimeType DAYLIGHT;
- enum_constant public static final android.icu.text.TimeZoneFormat.TimeType STANDARD;
- enum_constant public static final android.icu.text.TimeZoneFormat.TimeType UNKNOWN;
- }
-
- public abstract class TimeZoneNames implements java.io.Serializable {
- method public abstract java.util.Set<java.lang.String> getAvailableMetaZoneIDs();
- method public abstract java.util.Set<java.lang.String> getAvailableMetaZoneIDs(String);
- method public final String getDisplayName(String, android.icu.text.TimeZoneNames.NameType, long);
- method public String getExemplarLocationName(String);
- method public static android.icu.text.TimeZoneNames getInstance(android.icu.util.ULocale);
- method public static android.icu.text.TimeZoneNames getInstance(java.util.Locale);
- method public abstract String getMetaZoneDisplayName(String, android.icu.text.TimeZoneNames.NameType);
- method public abstract String getMetaZoneID(String, long);
- method public abstract String getReferenceZoneID(String, String);
- method public static android.icu.text.TimeZoneNames getTZDBInstance(android.icu.util.ULocale);
- method public abstract String getTimeZoneDisplayName(String, android.icu.text.TimeZoneNames.NameType);
- }
-
- public enum TimeZoneNames.NameType {
- enum_constant public static final android.icu.text.TimeZoneNames.NameType EXEMPLAR_LOCATION;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_DAYLIGHT;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_GENERIC;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_STANDARD;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_DAYLIGHT;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_GENERIC;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_STANDARD;
- }
-
- public abstract class Transliterator {
- method public static final android.icu.text.Transliterator createFromRules(String, String, int);
- method public void filteredTransliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, boolean);
- method public final void finishTransliteration(android.icu.text.Replaceable, android.icu.text.Transliterator.Position);
- method public static final java.util.Enumeration<java.lang.String> getAvailableIDs();
- method public static final java.util.Enumeration<java.lang.String> getAvailableSources();
- method public static final java.util.Enumeration<java.lang.String> getAvailableTargets(String);
- method public static final java.util.Enumeration<java.lang.String> getAvailableVariants(String, String);
- method public static final String getDisplayName(String);
- method public static String getDisplayName(String, java.util.Locale);
- method public static String getDisplayName(String, android.icu.util.ULocale);
- method public android.icu.text.Transliterator[] getElements();
- method public final android.icu.text.UnicodeFilter getFilter();
- method public final String getID();
- method public static final android.icu.text.Transliterator getInstance(String);
- method public static android.icu.text.Transliterator getInstance(String, int);
- method public final android.icu.text.Transliterator getInverse();
- method public final int getMaximumContextLength();
- method public final android.icu.text.UnicodeSet getSourceSet();
- method public android.icu.text.UnicodeSet getTargetSet();
- method public void setFilter(android.icu.text.UnicodeFilter);
- method public String toRules(boolean);
- method public final int transliterate(android.icu.text.Replaceable, int, int);
- method public final void transliterate(android.icu.text.Replaceable);
- method public final String transliterate(String);
- method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, String);
- method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, int);
- method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position);
- field public static final int FORWARD = 0; // 0x0
- field public static final int REVERSE = 1; // 0x1
- }
-
- public static class Transliterator.Position {
- ctor public Transliterator.Position();
- ctor public Transliterator.Position(int, int, int);
- ctor public Transliterator.Position(int, int, int, int);
- ctor public Transliterator.Position(android.icu.text.Transliterator.Position);
- method public void set(android.icu.text.Transliterator.Position);
- method public final void validate(int);
- field public int contextLimit;
- field public int contextStart;
- field public int limit;
- field public int start;
- }
-
- public abstract class UCharacterIterator implements java.lang.Cloneable {
- ctor protected UCharacterIterator();
- method public Object clone() throws java.lang.CloneNotSupportedException;
- method public abstract int current();
- method public int currentCodePoint();
- method public java.text.CharacterIterator getCharacterIterator();
- method public abstract int getIndex();
- method public static final android.icu.text.UCharacterIterator getInstance(android.icu.text.Replaceable);
- method public static final android.icu.text.UCharacterIterator getInstance(String);
- method public static final android.icu.text.UCharacterIterator getInstance(char[]);
- method public static final android.icu.text.UCharacterIterator getInstance(char[], int, int);
- method public static final android.icu.text.UCharacterIterator getInstance(StringBuffer);
- method public static final android.icu.text.UCharacterIterator getInstance(java.text.CharacterIterator);
- method public abstract int getLength();
- method public abstract int getText(char[], int);
- method public final int getText(char[]);
- method public String getText();
- method public int moveCodePointIndex(int);
- method public int moveIndex(int);
- method public abstract int next();
- method public int nextCodePoint();
- method public abstract int previous();
- method public int previousCodePoint();
- method public abstract void setIndex(int);
- method public void setToLimit();
- method public void setToStart();
- field public static final int DONE = -1; // 0xffffffff
- }
-
- public abstract class UFormat extends java.text.Format {
- ctor public UFormat();
- }
-
- public abstract class UnicodeFilter implements android.icu.text.UnicodeMatcher {
- method public abstract boolean contains(int);
- method public int matches(android.icu.text.Replaceable, int[], int, boolean);
- }
-
- public interface UnicodeMatcher {
- method public void addMatchSetTo(android.icu.text.UnicodeSet);
- method public int matches(android.icu.text.Replaceable, int[], int, boolean);
- method public boolean matchesIndexValue(int);
- method public String toPattern(boolean);
- field public static final char ETHER = 65535; // 0xffff '\uffff'
- field public static final int U_MATCH = 2; // 0x2
- field public static final int U_MISMATCH = 0; // 0x0
- field public static final int U_PARTIAL_MATCH = 1; // 0x1
- }
-
- public class UnicodeSet extends android.icu.text.UnicodeFilter implements java.lang.Comparable<android.icu.text.UnicodeSet> android.icu.util.Freezable<android.icu.text.UnicodeSet> java.lang.Iterable<java.lang.String> {
- ctor public UnicodeSet();
- ctor public UnicodeSet(android.icu.text.UnicodeSet);
- ctor public UnicodeSet(int, int);
- ctor public UnicodeSet(int...);
- ctor public UnicodeSet(String);
- ctor public UnicodeSet(String, boolean);
- ctor public UnicodeSet(String, int);
- ctor public UnicodeSet(String, java.text.ParsePosition, android.icu.text.SymbolTable);
- ctor public UnicodeSet(String, java.text.ParsePosition, android.icu.text.SymbolTable, int);
- method public StringBuffer _generatePattern(StringBuffer, boolean);
- method public StringBuffer _generatePattern(StringBuffer, boolean, boolean);
- method public android.icu.text.UnicodeSet add(int, int);
- method public final android.icu.text.UnicodeSet add(int);
- method public final android.icu.text.UnicodeSet add(CharSequence);
- method public android.icu.text.UnicodeSet add(Iterable<?>);
- method public android.icu.text.UnicodeSet addAll(int, int);
- method public final android.icu.text.UnicodeSet addAll(CharSequence);
- method public android.icu.text.UnicodeSet addAll(android.icu.text.UnicodeSet);
- method public android.icu.text.UnicodeSet addAll(Iterable<?>);
- method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet addAll(T...);
- method public <T extends java.util.Collection<java.lang.String>> T addAllTo(T);
- method public void addMatchSetTo(android.icu.text.UnicodeSet);
- method public android.icu.text.UnicodeSet applyIntPropertyValue(int, int);
- method public final android.icu.text.UnicodeSet applyPattern(String);
- method public android.icu.text.UnicodeSet applyPattern(String, boolean);
- method public android.icu.text.UnicodeSet applyPattern(String, int);
- method public android.icu.text.UnicodeSet applyPropertyAlias(String, String);
- method public android.icu.text.UnicodeSet applyPropertyAlias(String, String, android.icu.text.SymbolTable);
- method public int charAt(int);
- method public android.icu.text.UnicodeSet clear();
- method public Object clone();
- method public android.icu.text.UnicodeSet cloneAsThawed();
- method public android.icu.text.UnicodeSet closeOver(int);
- method public android.icu.text.UnicodeSet compact();
- method public int compareTo(android.icu.text.UnicodeSet);
- method public int compareTo(android.icu.text.UnicodeSet, android.icu.text.UnicodeSet.ComparisonStyle);
- method public int compareTo(Iterable<java.lang.String>);
- method public android.icu.text.UnicodeSet complement(int, int);
- method public final android.icu.text.UnicodeSet complement(int);
- method public android.icu.text.UnicodeSet complement();
- method public final android.icu.text.UnicodeSet complement(CharSequence);
- method public final android.icu.text.UnicodeSet complementAll(CharSequence);
- method public android.icu.text.UnicodeSet complementAll(android.icu.text.UnicodeSet);
- method public boolean contains(int);
- method public boolean contains(int, int);
- method public final boolean contains(CharSequence);
- method public boolean containsAll(android.icu.text.UnicodeSet);
- method public boolean containsAll(String);
- method public <T extends java.lang.CharSequence> boolean containsAll(Iterable<T>);
- method public boolean containsNone(int, int);
- method public boolean containsNone(android.icu.text.UnicodeSet);
- method public boolean containsNone(CharSequence);
- method public <T extends java.lang.CharSequence> boolean containsNone(Iterable<T>);
- method public final boolean containsSome(int, int);
- method public final boolean containsSome(android.icu.text.UnicodeSet);
- method public final boolean containsSome(CharSequence);
- method public final <T extends java.lang.CharSequence> boolean containsSome(Iterable<T>);
- method public android.icu.text.UnicodeSet freeze();
- method public static android.icu.text.UnicodeSet from(CharSequence);
- method public static android.icu.text.UnicodeSet fromAll(CharSequence);
- method public int getRangeCount();
- method public int getRangeEnd(int);
- method public int getRangeStart(int);
- method public int indexOf(int);
- method public boolean isEmpty();
- method public boolean isFrozen();
- method public java.util.Iterator<java.lang.String> iterator();
- method public boolean matchesIndexValue(int);
- method public Iterable<android.icu.text.UnicodeSet.EntryRange> ranges();
- method public android.icu.text.UnicodeSet remove(int, int);
- method public final android.icu.text.UnicodeSet remove(int);
- method public final android.icu.text.UnicodeSet remove(CharSequence);
- method public final android.icu.text.UnicodeSet removeAll(CharSequence);
- method public android.icu.text.UnicodeSet removeAll(android.icu.text.UnicodeSet);
- method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet removeAll(Iterable<T>);
- method public final android.icu.text.UnicodeSet removeAllStrings();
- method public android.icu.text.UnicodeSet retain(int, int);
- method public final android.icu.text.UnicodeSet retain(int);
- method public final android.icu.text.UnicodeSet retain(CharSequence);
- method public final android.icu.text.UnicodeSet retainAll(CharSequence);
- method public android.icu.text.UnicodeSet retainAll(android.icu.text.UnicodeSet);
- method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet retainAll(Iterable<T>);
- method public android.icu.text.UnicodeSet set(int, int);
- method public android.icu.text.UnicodeSet set(android.icu.text.UnicodeSet);
- method public int size();
- method public int span(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
- method public int span(CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
- method public int spanBack(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
- method public int spanBack(CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
- method public java.util.Collection<java.lang.String> strings();
- method public String toPattern(boolean);
- field public static final int ADD_CASE_MAPPINGS = 4; // 0x4
- field public static final android.icu.text.UnicodeSet ALL_CODE_POINTS;
- field public static final int CASE = 2; // 0x2
- field public static final int CASE_INSENSITIVE = 2; // 0x2
- field public static final android.icu.text.UnicodeSet EMPTY;
- field public static final int IGNORE_SPACE = 1; // 0x1
- field public static final int MAX_VALUE = 1114111; // 0x10ffff
- field public static final int MIN_VALUE = 0; // 0x0
- }
-
- public enum UnicodeSet.ComparisonStyle {
- enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle LEXICOGRAPHIC;
- enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle LONGER_FIRST;
- enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle SHORTER_FIRST;
- }
-
- public static class UnicodeSet.EntryRange {
- field public int codepoint;
- field public int codepointEnd;
- }
-
- public enum UnicodeSet.SpanCondition {
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition CONDITION_COUNT;
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition CONTAINED;
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition NOT_CONTAINED;
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition SIMPLE;
- }
-
- public class UnicodeSetIterator {
- ctor public UnicodeSetIterator(android.icu.text.UnicodeSet);
- ctor public UnicodeSetIterator();
- method public String getString();
- method public boolean next();
- method public boolean nextRange();
- method public void reset(android.icu.text.UnicodeSet);
- method public void reset();
- field public static int IS_STRING;
- field public int codepoint;
- field public int codepointEnd;
- field public String string;
- }
-
- public class UnicodeSetSpanner {
- ctor public UnicodeSetSpanner(android.icu.text.UnicodeSet);
- method public int countIn(CharSequence);
- method public int countIn(CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
- method public int countIn(CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
- method public String deleteFrom(CharSequence);
- method public String deleteFrom(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
- method public android.icu.text.UnicodeSet getUnicodeSet();
- method public String replaceFrom(CharSequence, CharSequence);
- method public String replaceFrom(CharSequence, CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
- method public String replaceFrom(CharSequence, CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
- method public CharSequence trim(CharSequence);
- method public CharSequence trim(CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption);
- method public CharSequence trim(CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption, android.icu.text.UnicodeSet.SpanCondition);
- }
-
- public enum UnicodeSetSpanner.CountMethod {
- enum_constant public static final android.icu.text.UnicodeSetSpanner.CountMethod MIN_ELEMENTS;
- enum_constant public static final android.icu.text.UnicodeSetSpanner.CountMethod WHOLE_SPAN;
- }
-
- public enum UnicodeSetSpanner.TrimOption {
- enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption BOTH;
- enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption LEADING;
- enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption TRAILING;
- }
-
-}
-
-package android.icu.util {
-
- public class BuddhistCalendar extends android.icu.util.GregorianCalendar {
- ctor public BuddhistCalendar();
- ctor public BuddhistCalendar(android.icu.util.TimeZone);
- ctor public BuddhistCalendar(java.util.Locale);
- ctor public BuddhistCalendar(android.icu.util.ULocale);
- ctor public BuddhistCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public BuddhistCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public BuddhistCalendar(java.util.Date);
- ctor public BuddhistCalendar(int, int, int);
- ctor public BuddhistCalendar(int, int, int, int, int, int);
- field public static final int BE = 0; // 0x0
- }
-
- public abstract class Calendar implements java.lang.Cloneable java.lang.Comparable<android.icu.util.Calendar> java.io.Serializable {
- ctor protected Calendar();
- ctor protected Calendar(android.icu.util.TimeZone, java.util.Locale);
- ctor protected Calendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- method public void add(int, int);
- method public boolean after(Object);
- method public boolean before(Object);
- method public final void clear();
- method public final void clear(int);
- method public Object clone();
- method public int compareTo(android.icu.util.Calendar);
- method protected void complete();
- method protected void computeFields();
- method protected final void computeGregorianFields(int);
- method protected int computeGregorianMonthStart(int, int);
- method protected int computeJulianDay();
- method @Deprecated protected int computeMillisInDay();
- method protected void computeTime();
- method @Deprecated protected int computeZoneOffset(long, int);
- method public int fieldDifference(java.util.Date, int);
- method protected String fieldName(int);
- method protected static final long floorDivide(long, long);
- method protected static final int floorDivide(int, int);
- method protected static final int floorDivide(int, int, int[]);
- method protected static final int floorDivide(long, int, int[]);
- method public final int get(int);
- method public int getActualMaximum(int);
- method public int getActualMinimum(int);
- method public static java.util.Locale[] getAvailableLocales();
- method public android.icu.text.DateFormat getDateTimeFormat(int, int, java.util.Locale);
- method public android.icu.text.DateFormat getDateTimeFormat(int, int, android.icu.util.ULocale);
- method public String getDisplayName(java.util.Locale);
- method public String getDisplayName(android.icu.util.ULocale);
- method public final int getFieldCount();
- method protected int[][][] getFieldResolutionTable();
- method public int getFirstDayOfWeek();
- method public final int getGreatestMinimum(int);
- method protected final int getGregorianDayOfMonth();
- method protected final int getGregorianDayOfYear();
- method protected final int getGregorianMonth();
- method protected final int getGregorianYear();
- method public static android.icu.util.Calendar getInstance();
- method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone);
- method public static android.icu.util.Calendar getInstance(java.util.Locale);
- method public static android.icu.util.Calendar getInstance(android.icu.util.ULocale);
- method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone, java.util.Locale);
- method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone, android.icu.util.ULocale);
- method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
- method public final int getLeastMaximum(int);
- method protected int getLimit(int, int);
- method public final int getMaximum(int);
- method public int getMinimalDaysInFirstWeek();
- method public final int getMinimum(int);
- method public int getRepeatedWallTimeOption();
- method public int getSkippedWallTimeOption();
- method protected final int getStamp(int);
- method public final java.util.Date getTime();
- method public long getTimeInMillis();
- method public android.icu.util.TimeZone getTimeZone();
- method public String getType();
- method public android.icu.util.Calendar.WeekData getWeekData();
- method public static android.icu.util.Calendar.WeekData getWeekDataForRegion(String);
- method protected static final int gregorianMonthLength(int, int);
- method protected static final int gregorianPreviousMonthLength(int, int);
- method protected void handleComputeFields(int);
- method protected int handleComputeJulianDay(int);
- method protected abstract int handleComputeMonthStart(int, int, boolean);
- method protected int[] handleCreateFields();
- method protected android.icu.text.DateFormat handleGetDateFormat(String, java.util.Locale);
- method protected android.icu.text.DateFormat handleGetDateFormat(String, String, java.util.Locale);
- method protected android.icu.text.DateFormat handleGetDateFormat(String, android.icu.util.ULocale);
- method protected abstract int handleGetExtendedYear();
- method protected abstract int handleGetLimit(int, int);
- method protected int handleGetMonthLength(int, int);
- method protected int handleGetYearLength(int);
- method protected final int internalGet(int);
- method protected final int internalGet(int, int);
- method protected final long internalGetTimeInMillis();
- method protected final void internalSet(int, int);
- method public boolean isEquivalentTo(android.icu.util.Calendar);
- method protected static final boolean isGregorianLeapYear(int);
- method public boolean isLenient();
- method public final boolean isSet(int);
- method public boolean isWeekend(java.util.Date);
- method public boolean isWeekend();
- method protected static final int julianDayToDayOfWeek(int);
- method protected static final long julianDayToMillis(int);
- method protected static final int millisToJulianDay(long);
- method protected int newerField(int, int);
- method protected int newestStamp(int, int, int);
- method protected void pinField(int);
- method protected void prepareGetActual(int, boolean);
- method protected int resolveFields(int[][][]);
- method public final void roll(int, boolean);
- method public void roll(int, int);
- method public final void set(int, int);
- method public final void set(int, int, int);
- method public final void set(int, int, int, int, int);
- method public final void set(int, int, int, int, int, int);
- method public void setFirstDayOfWeek(int);
- method public void setLenient(boolean);
- method public void setMinimalDaysInFirstWeek(int);
- method public void setRepeatedWallTimeOption(int);
- method public void setSkippedWallTimeOption(int);
- method public final void setTime(java.util.Date);
- method public void setTimeInMillis(long);
- method public void setTimeZone(android.icu.util.TimeZone);
- method public android.icu.util.Calendar setWeekData(android.icu.util.Calendar.WeekData);
- method protected void validateField(int);
- method protected final void validateField(int, int, int);
- method protected void validateFields();
- method protected int weekNumber(int, int, int);
- method protected final int weekNumber(int, int);
- field public static final int AM = 0; // 0x0
- field public static final int AM_PM = 9; // 0x9
- field public static final int APRIL = 3; // 0x3
- field public static final int AUGUST = 7; // 0x7
- field @Deprecated protected static final int BASE_FIELD_COUNT = 23; // 0x17
- field public static final int DATE = 5; // 0x5
- field public static final int DAY_OF_MONTH = 5; // 0x5
- field public static final int DAY_OF_WEEK = 7; // 0x7
- field public static final int DAY_OF_WEEK_IN_MONTH = 8; // 0x8
- field public static final int DAY_OF_YEAR = 6; // 0x6
- field public static final int DECEMBER = 11; // 0xb
- field public static final int DOW_LOCAL = 18; // 0x12
- field public static final int DST_OFFSET = 16; // 0x10
- field protected static final int EPOCH_JULIAN_DAY = 2440588; // 0x253d8c
- field public static final int ERA = 0; // 0x0
- field public static final int EXTENDED_YEAR = 19; // 0x13
- field public static final int FEBRUARY = 1; // 0x1
- field public static final int FRIDAY = 6; // 0x6
- field protected static final int GREATEST_MINIMUM = 1; // 0x1
- field public static final int HOUR = 10; // 0xa
- field public static final int HOUR_OF_DAY = 11; // 0xb
- field protected static final int INTERNALLY_SET = 1; // 0x1
- field public static final int IS_LEAP_MONTH = 22; // 0x16
- field public static final int JANUARY = 0; // 0x0
- field protected static final int JAN_1_1_JULIAN_DAY = 1721426; // 0x1a4452
- field public static final int JULIAN_DAY = 20; // 0x14
- field public static final int JULY = 6; // 0x6
- field public static final int JUNE = 5; // 0x5
- field protected static final int LEAST_MAXIMUM = 2; // 0x2
- field public static final int MARCH = 2; // 0x2
- field protected static final int MAXIMUM = 3; // 0x3
- field protected static final java.util.Date MAX_DATE;
- field @Deprecated protected static final int MAX_FIELD_COUNT = 32; // 0x20
- field protected static final int MAX_JULIAN = 2130706432; // 0x7f000000
- field protected static final long MAX_MILLIS = 183882168921600000L; // 0x28d47dbbf19b000L
- field public static final int MAY = 4; // 0x4
- field public static final int MILLISECOND = 14; // 0xe
- field public static final int MILLISECONDS_IN_DAY = 21; // 0x15
- field protected static final int MINIMUM = 0; // 0x0
- field protected static final int MINIMUM_USER_STAMP = 2; // 0x2
- field public static final int MINUTE = 12; // 0xc
- field protected static final java.util.Date MIN_DATE;
- field protected static final int MIN_JULIAN = -2130706432; // 0x81000000
- field protected static final long MIN_MILLIS = -184303902528000000L; // 0xfd713893bf19b000L
- field public static final int MONDAY = 2; // 0x2
- field public static final int MONTH = 2; // 0x2
- field public static final int NOVEMBER = 10; // 0xa
- field public static final int OCTOBER = 9; // 0x9
- field protected static final long ONE_DAY = 86400000L; // 0x5265c00L
- field protected static final int ONE_HOUR = 3600000; // 0x36ee80
- field protected static final int ONE_MINUTE = 60000; // 0xea60
- field protected static final int ONE_SECOND = 1000; // 0x3e8
- field protected static final long ONE_WEEK = 604800000L; // 0x240c8400L
- field public static final int PM = 1; // 0x1
- field protected static final int RESOLVE_REMAP = 32; // 0x20
- field public static final int SATURDAY = 7; // 0x7
- field public static final int SECOND = 13; // 0xd
- field public static final int SEPTEMBER = 8; // 0x8
- field public static final int SUNDAY = 1; // 0x1
- field public static final int THURSDAY = 5; // 0x5
- field public static final int TUESDAY = 3; // 0x3
- field public static final int UNDECIMBER = 12; // 0xc
- field protected static final int UNSET = 0; // 0x0
- field public static final int WALLTIME_FIRST = 1; // 0x1
- field public static final int WALLTIME_LAST = 0; // 0x0
- field public static final int WALLTIME_NEXT_VALID = 2; // 0x2
- field public static final int WEDNESDAY = 4; // 0x4
- field public static final int WEEK_OF_MONTH = 4; // 0x4
- field public static final int WEEK_OF_YEAR = 3; // 0x3
- field public static final int YEAR = 1; // 0x1
- field public static final int YEAR_WOY = 17; // 0x11
- field public static final int ZONE_OFFSET = 15; // 0xf
- }
-
- public static final class Calendar.WeekData {
- ctor public Calendar.WeekData(int, int, int, int, int, int);
- field public final int firstDayOfWeek;
- field public final int minimalDaysInFirstWeek;
- field public final int weekendCease;
- field public final int weekendCeaseMillis;
- field public final int weekendOnset;
- field public final int weekendOnsetMillis;
- }
-
- public class ChineseCalendar extends android.icu.util.Calendar {
- ctor public ChineseCalendar();
- ctor public ChineseCalendar(java.util.Date);
- ctor public ChineseCalendar(int, int, int, int);
- ctor public ChineseCalendar(int, int, int, int, int, int, int);
- ctor public ChineseCalendar(int, int, int, int, int);
- ctor public ChineseCalendar(int, int, int, int, int, int, int, int);
- ctor public ChineseCalendar(java.util.Locale);
- ctor public ChineseCalendar(android.icu.util.TimeZone);
- ctor public ChineseCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public ChineseCalendar(android.icu.util.ULocale);
- ctor public ChineseCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected android.icu.text.DateFormat handleGetDateFormat(String, String, android.icu.util.ULocale);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- }
-
- public final class CopticCalendar extends android.icu.util.Calendar {
- ctor public CopticCalendar();
- ctor public CopticCalendar(android.icu.util.TimeZone);
- ctor public CopticCalendar(java.util.Locale);
- ctor public CopticCalendar(android.icu.util.ULocale);
- ctor public CopticCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public CopticCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public CopticCalendar(int, int, int);
- ctor public CopticCalendar(java.util.Date);
- ctor public CopticCalendar(int, int, int, int, int, int);
- method @Deprecated protected void handleComputeFields(int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method @Deprecated protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- field public static final int AMSHIR = 5; // 0x5
- field public static final int BABA = 1; // 0x1
- field public static final int BARAMHAT = 6; // 0x6
- field public static final int BARAMOUDA = 7; // 0x7
- field public static final int BASHANS = 8; // 0x8
- field public static final int EPEP = 10; // 0xa
- field public static final int HATOR = 2; // 0x2
- field public static final int KIAHK = 3; // 0x3
- field public static final int MESRA = 11; // 0xb
- field public static final int NASIE = 12; // 0xc
- field public static final int PAONA = 9; // 0x9
- field public static final int TOBA = 4; // 0x4
- field public static final int TOUT = 0; // 0x0
- }
-
- public class Currency extends android.icu.util.MeasureUnit {
- ctor protected Currency(String);
- method public static android.icu.util.Currency fromJavaCurrency(java.util.Currency);
- method public static java.util.Set<android.icu.util.Currency> getAvailableCurrencies();
- method public static String[] getAvailableCurrencyCodes(android.icu.util.ULocale, java.util.Date);
- method public static String[] getAvailableCurrencyCodes(java.util.Locale, java.util.Date);
- method public static java.util.Locale[] getAvailableLocales();
- method public static android.icu.util.ULocale[] getAvailableULocales();
- method public String getCurrencyCode();
- method public int getDefaultFractionDigits();
- method public int getDefaultFractionDigits(android.icu.util.Currency.CurrencyUsage);
- method public String getDisplayName();
- method public String getDisplayName(java.util.Locale);
- method public static android.icu.util.Currency getInstance(java.util.Locale);
- method public static android.icu.util.Currency getInstance(android.icu.util.ULocale);
- method public static android.icu.util.Currency getInstance(String);
- method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
- method public String getName(java.util.Locale, int, boolean[]);
- method public String getName(android.icu.util.ULocale, int, boolean[]);
- method public String getName(java.util.Locale, int, String, boolean[]);
- method public String getName(android.icu.util.ULocale, int, String, boolean[]);
- method public int getNumericCode();
- method public double getRoundingIncrement();
- method public double getRoundingIncrement(android.icu.util.Currency.CurrencyUsage);
- method public String getSymbol();
- method public String getSymbol(java.util.Locale);
- method public String getSymbol(android.icu.util.ULocale);
- method public static boolean isAvailable(String, java.util.Date, java.util.Date);
- method public java.util.Currency toJavaCurrency();
- field public static final int LONG_NAME = 1; // 0x1
- field public static final int NARROW_SYMBOL_NAME = 3; // 0x3
- field public static final int PLURAL_LONG_NAME = 2; // 0x2
- field public static final int SYMBOL_NAME = 0; // 0x0
- }
-
- public enum Currency.CurrencyUsage {
- enum_constant public static final android.icu.util.Currency.CurrencyUsage CASH;
- enum_constant public static final android.icu.util.Currency.CurrencyUsage STANDARD;
- }
-
- public class CurrencyAmount extends android.icu.util.Measure {
- ctor public CurrencyAmount(Number, android.icu.util.Currency);
- ctor public CurrencyAmount(double, android.icu.util.Currency);
- ctor public CurrencyAmount(Number, java.util.Currency);
- ctor public CurrencyAmount(double, java.util.Currency);
- method public android.icu.util.Currency getCurrency();
- }
-
- public final class DateInterval implements java.io.Serializable {
- ctor public DateInterval(long, long);
- method public long getFromDate();
- method public long getToDate();
- }
-
- public final class EthiopicCalendar extends android.icu.util.Calendar {
- ctor public EthiopicCalendar();
- ctor public EthiopicCalendar(android.icu.util.TimeZone);
- ctor public EthiopicCalendar(java.util.Locale);
- ctor public EthiopicCalendar(android.icu.util.ULocale);
- ctor public EthiopicCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public EthiopicCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public EthiopicCalendar(int, int, int);
- ctor public EthiopicCalendar(java.util.Date);
- ctor public EthiopicCalendar(int, int, int, int, int, int);
- method @Deprecated protected void handleComputeFields(int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method @Deprecated protected int handleGetExtendedYear();
- method @Deprecated protected int handleGetLimit(int, int);
- method public boolean isAmeteAlemEra();
- method public void setAmeteAlemEra(boolean);
- field public static final int GENBOT = 8; // 0x8
- field public static final int HAMLE = 10; // 0xa
- field public static final int HEDAR = 2; // 0x2
- field public static final int MEGABIT = 6; // 0x6
- field public static final int MESKEREM = 0; // 0x0
- field public static final int MIAZIA = 7; // 0x7
- field public static final int NEHASSE = 11; // 0xb
- field public static final int PAGUMEN = 12; // 0xc
- field public static final int SENE = 9; // 0x9
- field public static final int TAHSAS = 3; // 0x3
- field public static final int TEKEMT = 1; // 0x1
- field public static final int TER = 4; // 0x4
- field public static final int YEKATIT = 5; // 0x5
- }
-
- public interface Freezable<T> extends java.lang.Cloneable {
- method public T cloneAsThawed();
- method public T freeze();
- method public boolean isFrozen();
- }
-
- public class GregorianCalendar extends android.icu.util.Calendar {
- ctor public GregorianCalendar();
- ctor public GregorianCalendar(android.icu.util.TimeZone);
- ctor public GregorianCalendar(java.util.Locale);
- ctor public GregorianCalendar(android.icu.util.ULocale);
- ctor public GregorianCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public GregorianCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public GregorianCalendar(int, int, int);
- ctor public GregorianCalendar(int, int, int, int, int);
- ctor public GregorianCalendar(int, int, int, int, int, int);
- method public final java.util.Date getGregorianChange();
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- method public boolean isLeapYear(int);
- method public void setGregorianChange(java.util.Date);
- field public static final int AD = 1; // 0x1
- field public static final int BC = 0; // 0x0
- field protected transient boolean invertGregorian;
- field protected transient boolean isGregorian;
- }
-
- public class HebrewCalendar extends android.icu.util.Calendar {
- ctor public HebrewCalendar();
- ctor public HebrewCalendar(android.icu.util.TimeZone);
- ctor public HebrewCalendar(java.util.Locale);
- ctor public HebrewCalendar(android.icu.util.ULocale);
- ctor public HebrewCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public HebrewCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public HebrewCalendar(int, int, int);
- ctor public HebrewCalendar(java.util.Date);
- ctor public HebrewCalendar(int, int, int, int, int, int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- method @Deprecated protected void validateField(int);
- field public static final int ADAR = 6; // 0x6
- field public static final int ADAR_1 = 5; // 0x5
- field public static final int AV = 11; // 0xb
- field public static final int ELUL = 12; // 0xc
- field public static final int HESHVAN = 1; // 0x1
- field public static final int IYAR = 8; // 0x8
- field public static final int KISLEV = 2; // 0x2
- field public static final int NISAN = 7; // 0x7
- field public static final int SHEVAT = 4; // 0x4
- field public static final int SIVAN = 9; // 0x9
- field public static final int TAMUZ = 10; // 0xa
- field public static final int TEVET = 3; // 0x3
- field public static final int TISHRI = 0; // 0x0
- }
-
- public class ICUUncheckedIOException extends java.lang.RuntimeException {
- ctor public ICUUncheckedIOException();
- ctor public ICUUncheckedIOException(String);
- ctor public ICUUncheckedIOException(Throwable);
- ctor public ICUUncheckedIOException(String, Throwable);
- }
-
- public class IllformedLocaleException extends java.lang.RuntimeException {
- ctor public IllformedLocaleException();
- ctor public IllformedLocaleException(String);
- ctor public IllformedLocaleException(String, int);
- method public int getErrorIndex();
- }
-
- public class IndianCalendar extends android.icu.util.Calendar {
- ctor public IndianCalendar();
- ctor public IndianCalendar(android.icu.util.TimeZone);
- ctor public IndianCalendar(java.util.Locale);
- ctor public IndianCalendar(android.icu.util.ULocale);
- ctor public IndianCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public IndianCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public IndianCalendar(java.util.Date);
- ctor public IndianCalendar(int, int, int);
- ctor public IndianCalendar(int, int, int, int, int, int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- field public static final int AGRAHAYANA = 8; // 0x8
- field public static final int ASADHA = 3; // 0x3
- field public static final int ASVINA = 6; // 0x6
- field public static final int BHADRA = 5; // 0x5
- field public static final int CHAITRA = 0; // 0x0
- field public static final int IE = 0; // 0x0
- field public static final int JYAISTHA = 2; // 0x2
- field public static final int KARTIKA = 7; // 0x7
- field public static final int MAGHA = 10; // 0xa
- field public static final int PAUSA = 9; // 0x9
- field public static final int PHALGUNA = 11; // 0xb
- field public static final int SRAVANA = 4; // 0x4
- field public static final int VAISAKHA = 1; // 0x1
- }
-
- public class IslamicCalendar extends android.icu.util.Calendar {
- ctor public IslamicCalendar();
- ctor public IslamicCalendar(android.icu.util.TimeZone);
- ctor public IslamicCalendar(java.util.Locale);
- ctor public IslamicCalendar(android.icu.util.ULocale);
- ctor public IslamicCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public IslamicCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public IslamicCalendar(java.util.Date);
- ctor public IslamicCalendar(int, int, int);
- ctor public IslamicCalendar(int, int, int, int, int, int);
- method public android.icu.util.IslamicCalendar.CalculationType getCalculationType();
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- method public void setCalculationType(android.icu.util.IslamicCalendar.CalculationType);
- field public static final int DHU_AL_HIJJAH = 11; // 0xb
- field public static final int DHU_AL_QIDAH = 10; // 0xa
- field public static final int JUMADA_1 = 4; // 0x4
- field public static final int JUMADA_2 = 5; // 0x5
- field public static final int MUHARRAM = 0; // 0x0
- field public static final int RABI_1 = 2; // 0x2
- field public static final int RABI_2 = 3; // 0x3
- field public static final int RAJAB = 6; // 0x6
- field public static final int RAMADAN = 8; // 0x8
- field public static final int SAFAR = 1; // 0x1
- field public static final int SHABAN = 7; // 0x7
- field public static final int SHAWWAL = 9; // 0x9
- }
-
- public enum IslamicCalendar.CalculationType {
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC;
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_CIVIL;
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_TBLA;
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_UMALQURA;
- }
-
- public class JapaneseCalendar extends android.icu.util.GregorianCalendar {
- ctor public JapaneseCalendar();
- ctor public JapaneseCalendar(android.icu.util.TimeZone);
- ctor public JapaneseCalendar(java.util.Locale);
- ctor public JapaneseCalendar(android.icu.util.ULocale);
- ctor public JapaneseCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public JapaneseCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public JapaneseCalendar(java.util.Date);
- ctor public JapaneseCalendar(int, int, int, int);
- ctor public JapaneseCalendar(int, int, int);
- ctor public JapaneseCalendar(int, int, int, int, int, int);
- field public static final int HEISEI;
- field public static final int MEIJI;
- field public static final int REIWA;
- field public static final int SHOWA;
- field public static final int TAISHO;
- }
-
- public final class LocaleData {
- method public static android.icu.util.VersionInfo getCLDRVersion();
- method public String getDelimiter(int);
- method public static android.icu.util.LocaleData getInstance(android.icu.util.ULocale);
- method public static android.icu.util.LocaleData getInstance();
- method public static android.icu.util.LocaleData.MeasurementSystem getMeasurementSystem(android.icu.util.ULocale);
- method public boolean getNoSubstitute();
- method public static android.icu.util.LocaleData.PaperSize getPaperSize(android.icu.util.ULocale);
- method public void setNoSubstitute(boolean);
- field public static final int ALT_QUOTATION_END = 3; // 0x3
- field public static final int ALT_QUOTATION_START = 2; // 0x2
- field public static final int QUOTATION_END = 1; // 0x1
- field public static final int QUOTATION_START = 0; // 0x0
- }
-
- public static final class LocaleData.MeasurementSystem {
- field public static final android.icu.util.LocaleData.MeasurementSystem SI;
- field public static final android.icu.util.LocaleData.MeasurementSystem UK;
- field public static final android.icu.util.LocaleData.MeasurementSystem US;
- }
-
- public static final class LocaleData.PaperSize {
- method public int getHeight();
- method public int getWidth();
- }
-
- public class Measure {
- ctor public Measure(Number, android.icu.util.MeasureUnit);
- method public Number getNumber();
- method public android.icu.util.MeasureUnit getUnit();
- }
-
- public class MeasureUnit implements java.io.Serializable {
- method public static java.util.Set<android.icu.util.MeasureUnit> getAvailable(String);
- method public static java.util.Set<android.icu.util.MeasureUnit> getAvailable();
- method public static java.util.Set<java.lang.String> getAvailableTypes();
- method public String getSubtype();
- method public String getType();
- field public static final android.icu.util.MeasureUnit ACRE;
- field public static final android.icu.util.MeasureUnit ACRE_FOOT;
- field public static final android.icu.util.MeasureUnit AMPERE;
- field public static final android.icu.util.MeasureUnit ARC_MINUTE;
- field public static final android.icu.util.MeasureUnit ARC_SECOND;
- field public static final android.icu.util.MeasureUnit ASTRONOMICAL_UNIT;
- field public static final android.icu.util.MeasureUnit ATMOSPHERE;
- field public static final android.icu.util.MeasureUnit BIT;
- field public static final android.icu.util.MeasureUnit BUSHEL;
- field public static final android.icu.util.MeasureUnit BYTE;
- field public static final android.icu.util.MeasureUnit CALORIE;
- field public static final android.icu.util.MeasureUnit CARAT;
- field public static final android.icu.util.MeasureUnit CELSIUS;
- field public static final android.icu.util.MeasureUnit CENTILITER;
- field public static final android.icu.util.MeasureUnit CENTIMETER;
- field public static final android.icu.util.MeasureUnit CENTURY;
- field public static final android.icu.util.MeasureUnit CUBIC_CENTIMETER;
- field public static final android.icu.util.MeasureUnit CUBIC_FOOT;
- field public static final android.icu.util.MeasureUnit CUBIC_INCH;
- field public static final android.icu.util.MeasureUnit CUBIC_KILOMETER;
- field public static final android.icu.util.MeasureUnit CUBIC_METER;
- field public static final android.icu.util.MeasureUnit CUBIC_MILE;
- field public static final android.icu.util.MeasureUnit CUBIC_YARD;
- field public static final android.icu.util.MeasureUnit CUP;
- field public static final android.icu.util.MeasureUnit CUP_METRIC;
- field public static final android.icu.util.TimeUnit DAY;
- field public static final android.icu.util.MeasureUnit DECILITER;
- field public static final android.icu.util.MeasureUnit DECIMETER;
- field public static final android.icu.util.MeasureUnit DEGREE;
- field public static final android.icu.util.MeasureUnit FAHRENHEIT;
- field public static final android.icu.util.MeasureUnit FATHOM;
- field public static final android.icu.util.MeasureUnit FLUID_OUNCE;
- field public static final android.icu.util.MeasureUnit FOODCALORIE;
- field public static final android.icu.util.MeasureUnit FOOT;
- field public static final android.icu.util.MeasureUnit FURLONG;
- field public static final android.icu.util.MeasureUnit GALLON;
- field public static final android.icu.util.MeasureUnit GALLON_IMPERIAL;
- field public static final android.icu.util.MeasureUnit GENERIC_TEMPERATURE;
- field public static final android.icu.util.MeasureUnit GIGABIT;
- field public static final android.icu.util.MeasureUnit GIGABYTE;
- field public static final android.icu.util.MeasureUnit GIGAHERTZ;
- field public static final android.icu.util.MeasureUnit GIGAWATT;
- field public static final android.icu.util.MeasureUnit GRAM;
- field public static final android.icu.util.MeasureUnit G_FORCE;
- field public static final android.icu.util.MeasureUnit HECTARE;
- field public static final android.icu.util.MeasureUnit HECTOLITER;
- field public static final android.icu.util.MeasureUnit HECTOPASCAL;
- field public static final android.icu.util.MeasureUnit HERTZ;
- field public static final android.icu.util.MeasureUnit HORSEPOWER;
- field public static final android.icu.util.TimeUnit HOUR;
- field public static final android.icu.util.MeasureUnit INCH;
- field public static final android.icu.util.MeasureUnit INCH_HG;
- field public static final android.icu.util.MeasureUnit JOULE;
- field public static final android.icu.util.MeasureUnit KARAT;
- field public static final android.icu.util.MeasureUnit KELVIN;
- field public static final android.icu.util.MeasureUnit KILOBIT;
- field public static final android.icu.util.MeasureUnit KILOBYTE;
- field public static final android.icu.util.MeasureUnit KILOCALORIE;
- field public static final android.icu.util.MeasureUnit KILOGRAM;
- field public static final android.icu.util.MeasureUnit KILOHERTZ;
- field public static final android.icu.util.MeasureUnit KILOJOULE;
- field public static final android.icu.util.MeasureUnit KILOMETER;
- field public static final android.icu.util.MeasureUnit KILOMETER_PER_HOUR;
- field public static final android.icu.util.MeasureUnit KILOWATT;
- field public static final android.icu.util.MeasureUnit KILOWATT_HOUR;
- field public static final android.icu.util.MeasureUnit KNOT;
- field public static final android.icu.util.MeasureUnit LIGHT_YEAR;
- field public static final android.icu.util.MeasureUnit LITER;
- field public static final android.icu.util.MeasureUnit LITER_PER_100KILOMETERS;
- field public static final android.icu.util.MeasureUnit LITER_PER_KILOMETER;
- field public static final android.icu.util.MeasureUnit LUX;
- field public static final android.icu.util.MeasureUnit MEGABIT;
- field public static final android.icu.util.MeasureUnit MEGABYTE;
- field public static final android.icu.util.MeasureUnit MEGAHERTZ;
- field public static final android.icu.util.MeasureUnit MEGALITER;
- field public static final android.icu.util.MeasureUnit MEGAWATT;
- field public static final android.icu.util.MeasureUnit METER;
- field public static final android.icu.util.MeasureUnit METER_PER_SECOND;
- field public static final android.icu.util.MeasureUnit METER_PER_SECOND_SQUARED;
- field public static final android.icu.util.MeasureUnit METRIC_TON;
- field public static final android.icu.util.MeasureUnit MICROGRAM;
- field public static final android.icu.util.MeasureUnit MICROMETER;
- field public static final android.icu.util.MeasureUnit MICROSECOND;
- field public static final android.icu.util.MeasureUnit MILE;
- field public static final android.icu.util.MeasureUnit MILE_PER_GALLON;
- field public static final android.icu.util.MeasureUnit MILE_PER_GALLON_IMPERIAL;
- field public static final android.icu.util.MeasureUnit MILE_PER_HOUR;
- field public static final android.icu.util.MeasureUnit MILE_SCANDINAVIAN;
- field public static final android.icu.util.MeasureUnit MILLIAMPERE;
- field public static final android.icu.util.MeasureUnit MILLIBAR;
- field public static final android.icu.util.MeasureUnit MILLIGRAM;
- field public static final android.icu.util.MeasureUnit MILLIGRAM_PER_DECILITER;
- field public static final android.icu.util.MeasureUnit MILLILITER;
- field public static final android.icu.util.MeasureUnit MILLIMETER;
- field public static final android.icu.util.MeasureUnit MILLIMETER_OF_MERCURY;
- field public static final android.icu.util.MeasureUnit MILLIMOLE_PER_LITER;
- field public static final android.icu.util.MeasureUnit MILLISECOND;
- field public static final android.icu.util.MeasureUnit MILLIWATT;
- field public static final android.icu.util.TimeUnit MINUTE;
- field public static final android.icu.util.TimeUnit MONTH;
- field public static final android.icu.util.MeasureUnit NANOMETER;
- field public static final android.icu.util.MeasureUnit NANOSECOND;
- field public static final android.icu.util.MeasureUnit NAUTICAL_MILE;
- field public static final android.icu.util.MeasureUnit OHM;
- field public static final android.icu.util.MeasureUnit OUNCE;
- field public static final android.icu.util.MeasureUnit OUNCE_TROY;
- field public static final android.icu.util.MeasureUnit PARSEC;
- field public static final android.icu.util.MeasureUnit PART_PER_MILLION;
- field public static final android.icu.util.MeasureUnit PERCENT;
- field public static final android.icu.util.MeasureUnit PERMILLE;
- field public static final android.icu.util.MeasureUnit PETABYTE;
- field public static final android.icu.util.MeasureUnit PICOMETER;
- field public static final android.icu.util.MeasureUnit PINT;
- field public static final android.icu.util.MeasureUnit PINT_METRIC;
- field public static final android.icu.util.MeasureUnit POINT;
- field public static final android.icu.util.MeasureUnit POUND;
- field public static final android.icu.util.MeasureUnit POUND_PER_SQUARE_INCH;
- field public static final android.icu.util.MeasureUnit QUART;
- field public static final android.icu.util.MeasureUnit RADIAN;
- field public static final android.icu.util.MeasureUnit REVOLUTION_ANGLE;
- field public static final android.icu.util.TimeUnit SECOND;
- field public static final android.icu.util.MeasureUnit SQUARE_CENTIMETER;
- field public static final android.icu.util.MeasureUnit SQUARE_FOOT;
- field public static final android.icu.util.MeasureUnit SQUARE_INCH;
- field public static final android.icu.util.MeasureUnit SQUARE_KILOMETER;
- field public static final android.icu.util.MeasureUnit SQUARE_METER;
- field public static final android.icu.util.MeasureUnit SQUARE_MILE;
- field public static final android.icu.util.MeasureUnit SQUARE_YARD;
- field public static final android.icu.util.MeasureUnit STONE;
- field public static final android.icu.util.MeasureUnit TABLESPOON;
- field public static final android.icu.util.MeasureUnit TEASPOON;
- field public static final android.icu.util.MeasureUnit TERABIT;
- field public static final android.icu.util.MeasureUnit TERABYTE;
- field public static final android.icu.util.MeasureUnit TON;
- field public static final android.icu.util.MeasureUnit VOLT;
- field public static final android.icu.util.MeasureUnit WATT;
- field public static final android.icu.util.TimeUnit WEEK;
- field public static final android.icu.util.MeasureUnit YARD;
- field public static final android.icu.util.TimeUnit YEAR;
- }
-
- public class Output<T> {
- ctor public Output();
- ctor public Output(T);
- field public T value;
- }
-
- public interface RangeValueIterator {
- method public boolean next(android.icu.util.RangeValueIterator.Element);
- method public void reset();
- }
-
- public static class RangeValueIterator.Element {
- ctor public RangeValueIterator.Element();
- field public int limit;
- field public int start;
- field public int value;
- }
-
- public class TaiwanCalendar extends android.icu.util.GregorianCalendar {
- ctor public TaiwanCalendar();
- ctor public TaiwanCalendar(android.icu.util.TimeZone);
- ctor public TaiwanCalendar(java.util.Locale);
- ctor public TaiwanCalendar(android.icu.util.ULocale);
- ctor public TaiwanCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public TaiwanCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public TaiwanCalendar(java.util.Date);
- ctor public TaiwanCalendar(int, int, int);
- ctor public TaiwanCalendar(int, int, int, int, int, int);
- field public static final int BEFORE_MINGUO = 0; // 0x0
- field public static final int MINGUO = 1; // 0x1
- }
-
- public class TimeUnit extends android.icu.util.MeasureUnit {
- method public static android.icu.util.TimeUnit[] values();
- }
-
- public abstract class TimeZone implements java.lang.Cloneable android.icu.util.Freezable<android.icu.util.TimeZone> java.io.Serializable {
- ctor public TimeZone();
- method public Object clone();
- method public android.icu.util.TimeZone cloneAsThawed();
- method public static int countEquivalentIDs(String);
- method public android.icu.util.TimeZone freeze();
- method public static java.util.Set<java.lang.String> getAvailableIDs(android.icu.util.TimeZone.SystemTimeZoneType, String, Integer);
- method public static String[] getAvailableIDs(int);
- method public static String[] getAvailableIDs(String);
- method public static String[] getAvailableIDs();
- method public static String getCanonicalID(String);
- method public static String getCanonicalID(String, boolean[]);
- method public int getDSTSavings();
- method public static android.icu.util.TimeZone getDefault();
- method public final String getDisplayName();
- method public final String getDisplayName(java.util.Locale);
- method public final String getDisplayName(android.icu.util.ULocale);
- method public final String getDisplayName(boolean, int);
- method public String getDisplayName(boolean, int, java.util.Locale);
- method public String getDisplayName(boolean, int, android.icu.util.ULocale);
- method public static String getEquivalentID(String, int);
- method public static android.icu.util.TimeZone getFrozenTimeZone(String);
- method public String getID();
- method public static String getIDForWindowsID(String, String);
- method public abstract int getOffset(int, int, int, int, int, int);
- method public int getOffset(long);
- method public void getOffset(long, boolean, int[]);
- method public abstract int getRawOffset();
- method public static String getRegion(String);
- method public static String getTZDataVersion();
- method public static android.icu.util.TimeZone getTimeZone(String);
- method public static android.icu.util.TimeZone getTimeZone(String, int);
- method public static String getWindowsID(String);
- method public boolean hasSameRules(android.icu.util.TimeZone);
- method public abstract boolean inDaylightTime(java.util.Date);
- method public boolean isFrozen();
- method public boolean observesDaylightTime();
- method public void setID(String);
- method public abstract void setRawOffset(int);
- method public abstract boolean useDaylightTime();
- field public static final int GENERIC_LOCATION = 7; // 0x7
- field public static final android.icu.util.TimeZone GMT_ZONE;
- field public static final int LONG = 1; // 0x1
- field public static final int LONG_GENERIC = 3; // 0x3
- field public static final int LONG_GMT = 5; // 0x5
- field public static final int SHORT = 0; // 0x0
- field public static final int SHORT_COMMONLY_USED = 6; // 0x6
- field public static final int SHORT_GENERIC = 2; // 0x2
- field public static final int SHORT_GMT = 4; // 0x4
- field public static final int TIMEZONE_ICU = 0; // 0x0
- field public static final int TIMEZONE_JDK = 1; // 0x1
- field public static final android.icu.util.TimeZone UNKNOWN_ZONE;
- field public static final String UNKNOWN_ZONE_ID = "Etc/Unknown";
- }
-
- public enum TimeZone.SystemTimeZoneType {
- enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType ANY;
- enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType CANONICAL;
- enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType CANONICAL_LOCATION;
- }
-
- public final class ULocale implements java.lang.Comparable<android.icu.util.ULocale> java.io.Serializable {
- ctor public ULocale(String);
- ctor public ULocale(String, String);
- ctor public ULocale(String, String, String);
- method public static android.icu.util.ULocale acceptLanguage(String, android.icu.util.ULocale[], boolean[]);
- method public static android.icu.util.ULocale acceptLanguage(android.icu.util.ULocale[], android.icu.util.ULocale[], boolean[]);
- method public static android.icu.util.ULocale acceptLanguage(String, boolean[]);
- method public static android.icu.util.ULocale acceptLanguage(android.icu.util.ULocale[], boolean[]);
- method public static android.icu.util.ULocale addLikelySubtags(android.icu.util.ULocale);
- method public static String canonicalize(String);
- method public Object clone();
- method public int compareTo(android.icu.util.ULocale);
- method public static android.icu.util.ULocale createCanonical(String);
- method public static android.icu.util.ULocale forLanguageTag(String);
- method public static android.icu.util.ULocale forLocale(java.util.Locale);
- method public static android.icu.util.ULocale[] getAvailableLocales();
- method public String getBaseName();
- method public static String getBaseName(String);
- method public String getCharacterOrientation();
- method public String getCountry();
- method public static String getCountry(String);
- method public static android.icu.util.ULocale getDefault();
- method public static android.icu.util.ULocale getDefault(android.icu.util.ULocale.Category);
- method public String getDisplayCountry();
- method public String getDisplayCountry(android.icu.util.ULocale);
- method public static String getDisplayCountry(String, String);
- method public static String getDisplayCountry(String, android.icu.util.ULocale);
- method public static String getDisplayKeyword(String);
- method public static String getDisplayKeyword(String, String);
- method public static String getDisplayKeyword(String, android.icu.util.ULocale);
- method public String getDisplayKeywordValue(String);
- method public String getDisplayKeywordValue(String, android.icu.util.ULocale);
- method public static String getDisplayKeywordValue(String, String, String);
- method public static String getDisplayKeywordValue(String, String, android.icu.util.ULocale);
- method public String getDisplayLanguage();
- method public String getDisplayLanguage(android.icu.util.ULocale);
- method public static String getDisplayLanguage(String, String);
- method public static String getDisplayLanguage(String, android.icu.util.ULocale);
- method public String getDisplayLanguageWithDialect();
- method public String getDisplayLanguageWithDialect(android.icu.util.ULocale);
- method public static String getDisplayLanguageWithDialect(String, String);
- method public static String getDisplayLanguageWithDialect(String, android.icu.util.ULocale);
- method public String getDisplayName();
- method public String getDisplayName(android.icu.util.ULocale);
- method public static String getDisplayName(String, String);
- method public static String getDisplayName(String, android.icu.util.ULocale);
- method public String getDisplayNameWithDialect();
- method public String getDisplayNameWithDialect(android.icu.util.ULocale);
- method public static String getDisplayNameWithDialect(String, String);
- method public static String getDisplayNameWithDialect(String, android.icu.util.ULocale);
- method public String getDisplayScript();
- method public String getDisplayScript(android.icu.util.ULocale);
- method public static String getDisplayScript(String, String);
- method public static String getDisplayScript(String, android.icu.util.ULocale);
- method public String getDisplayVariant();
- method public String getDisplayVariant(android.icu.util.ULocale);
- method public static String getDisplayVariant(String, String);
- method public static String getDisplayVariant(String, android.icu.util.ULocale);
- method public String getExtension(char);
- method public java.util.Set<java.lang.Character> getExtensionKeys();
- method public static String getFallback(String);
- method public android.icu.util.ULocale getFallback();
- method public String getISO3Country();
- method public static String getISO3Country(String);
- method public String getISO3Language();
- method public static String getISO3Language(String);
- method public static String[] getISOCountries();
- method public static String[] getISOLanguages();
- method public String getKeywordValue(String);
- method public static String getKeywordValue(String, String);
- method public java.util.Iterator<java.lang.String> getKeywords();
- method public static java.util.Iterator<java.lang.String> getKeywords(String);
- method public String getLanguage();
- method public static String getLanguage(String);
- method public String getLineOrientation();
- method public String getName();
- method public static String getName(String);
- method public String getScript();
- method public static String getScript(String);
- method public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
- method public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
- method public String getUnicodeLocaleType(String);
- method public String getVariant();
- method public static String getVariant(String);
- method public boolean isRightToLeft();
- method public static android.icu.util.ULocale minimizeSubtags(android.icu.util.ULocale);
- method public android.icu.util.ULocale setKeywordValue(String, String);
- method public static String setKeywordValue(String, String, String);
- method public String toLanguageTag();
- method public static String toLegacyKey(String);
- method public static String toLegacyType(String, String);
- method public java.util.Locale toLocale();
- method public static String toUnicodeLocaleKey(String);
- method public static String toUnicodeLocaleType(String, String);
- field public static final android.icu.util.ULocale CANADA;
- field public static final android.icu.util.ULocale CANADA_FRENCH;
- field public static final android.icu.util.ULocale CHINA;
- field public static final android.icu.util.ULocale CHINESE;
- field public static final android.icu.util.ULocale ENGLISH;
- field public static final android.icu.util.ULocale FRANCE;
- field public static final android.icu.util.ULocale FRENCH;
- field public static final android.icu.util.ULocale GERMAN;
- field public static final android.icu.util.ULocale GERMANY;
- field public static final android.icu.util.ULocale ITALIAN;
- field public static final android.icu.util.ULocale ITALY;
- field public static final android.icu.util.ULocale JAPAN;
- field public static final android.icu.util.ULocale JAPANESE;
- field public static final android.icu.util.ULocale KOREA;
- field public static final android.icu.util.ULocale KOREAN;
- field public static final android.icu.util.ULocale PRC;
- field public static final char PRIVATE_USE_EXTENSION = 120; // 0x0078 'x'
- field public static final android.icu.util.ULocale ROOT;
- field public static final android.icu.util.ULocale SIMPLIFIED_CHINESE;
- field public static final android.icu.util.ULocale TAIWAN;
- field public static final android.icu.util.ULocale TRADITIONAL_CHINESE;
- field public static final android.icu.util.ULocale UK;
- field public static final char UNICODE_LOCALE_EXTENSION = 117; // 0x0075 'u'
- field public static final android.icu.util.ULocale US;
- }
-
- public static final class ULocale.Builder {
- ctor public ULocale.Builder();
- method public android.icu.util.ULocale.Builder addUnicodeLocaleAttribute(String);
- method public android.icu.util.ULocale build();
- method public android.icu.util.ULocale.Builder clear();
- method public android.icu.util.ULocale.Builder clearExtensions();
- method public android.icu.util.ULocale.Builder removeUnicodeLocaleAttribute(String);
- method public android.icu.util.ULocale.Builder setExtension(char, String);
- method public android.icu.util.ULocale.Builder setLanguage(String);
- method public android.icu.util.ULocale.Builder setLanguageTag(String);
- method public android.icu.util.ULocale.Builder setLocale(android.icu.util.ULocale);
- method public android.icu.util.ULocale.Builder setRegion(String);
- method public android.icu.util.ULocale.Builder setScript(String);
- method public android.icu.util.ULocale.Builder setUnicodeLocaleKeyword(String, String);
- method public android.icu.util.ULocale.Builder setVariant(String);
- }
-
- public enum ULocale.Category {
- enum_constant public static final android.icu.util.ULocale.Category DISPLAY;
- enum_constant public static final android.icu.util.ULocale.Category FORMAT;
- }
-
- public final class UniversalTimeScale {
- method public static android.icu.math.BigDecimal bigDecimalFrom(double, int);
- method public static android.icu.math.BigDecimal bigDecimalFrom(long, int);
- method public static android.icu.math.BigDecimal bigDecimalFrom(android.icu.math.BigDecimal, int);
- method public static long from(long, int);
- method public static long getTimeScaleValue(int, int);
- method public static android.icu.math.BigDecimal toBigDecimal(long, int);
- method public static android.icu.math.BigDecimal toBigDecimal(android.icu.math.BigDecimal, int);
- method public static long toLong(long, int);
- field public static final int DB2_TIME = 8; // 0x8
- field public static final int DOTNET_DATE_TIME = 4; // 0x4
- field public static final int EPOCH_OFFSET_PLUS_1_VALUE = 6; // 0x6
- field public static final int EPOCH_OFFSET_VALUE = 1; // 0x1
- field public static final int EXCEL_TIME = 7; // 0x7
- field public static final int FROM_MAX_VALUE = 3; // 0x3
- field public static final int FROM_MIN_VALUE = 2; // 0x2
- field public static final int ICU4C_TIME = 2; // 0x2
- field public static final int JAVA_TIME = 0; // 0x0
- field public static final int MAC_OLD_TIME = 5; // 0x5
- field public static final int MAC_TIME = 6; // 0x6
- field @Deprecated public static final int MAX_SCALE = 10; // 0xa
- field public static final int TO_MAX_VALUE = 5; // 0x5
- field public static final int TO_MIN_VALUE = 4; // 0x4
- field public static final int UNITS_VALUE = 0; // 0x0
- field public static final int UNIX_MICROSECONDS_TIME = 9; // 0x9
- field public static final int UNIX_TIME = 1; // 0x1
- field public static final int WINDOWS_FILE_TIME = 3; // 0x3
- }
-
- public interface ValueIterator {
- method public boolean next(android.icu.util.ValueIterator.Element);
- method public void reset();
- method public void setRange(int, int);
- }
-
- public static final class ValueIterator.Element {
- ctor public ValueIterator.Element();
- field public int integer;
- field public Object value;
- }
-
- public final class VersionInfo implements java.lang.Comparable<android.icu.util.VersionInfo> {
- method public int compareTo(android.icu.util.VersionInfo);
- method public static android.icu.util.VersionInfo getInstance(String);
- method public static android.icu.util.VersionInfo getInstance(int, int, int, int);
- method public static android.icu.util.VersionInfo getInstance(int, int, int);
- method public static android.icu.util.VersionInfo getInstance(int, int);
- method public static android.icu.util.VersionInfo getInstance(int);
- method public int getMajor();
- method public int getMicro();
- method public int getMilli();
- method public int getMinor();
- field public static final android.icu.util.VersionInfo ICU_VERSION;
- field public static final android.icu.util.VersionInfo UCOL_BUILDER_VERSION;
- field public static final android.icu.util.VersionInfo UCOL_RUNTIME_VERSION;
- field public static final android.icu.util.VersionInfo UNICODE_10_0;
- field public static final android.icu.util.VersionInfo UNICODE_11_0;
- field public static final android.icu.util.VersionInfo UNICODE_12_0;
- field public static final android.icu.util.VersionInfo UNICODE_12_1;
- field public static final android.icu.util.VersionInfo UNICODE_13_0;
- field public static final android.icu.util.VersionInfo UNICODE_1_0;
- field public static final android.icu.util.VersionInfo UNICODE_1_0_1;
- field public static final android.icu.util.VersionInfo UNICODE_1_1_0;
- field public static final android.icu.util.VersionInfo UNICODE_1_1_5;
- field public static final android.icu.util.VersionInfo UNICODE_2_0;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_2;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_5;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_8;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_9;
- field public static final android.icu.util.VersionInfo UNICODE_3_0;
- field public static final android.icu.util.VersionInfo UNICODE_3_0_1;
- field public static final android.icu.util.VersionInfo UNICODE_3_1_0;
- field public static final android.icu.util.VersionInfo UNICODE_3_1_1;
- field public static final android.icu.util.VersionInfo UNICODE_3_2;
- field public static final android.icu.util.VersionInfo UNICODE_4_0;
- field public static final android.icu.util.VersionInfo UNICODE_4_0_1;
- field public static final android.icu.util.VersionInfo UNICODE_4_1;
- field public static final android.icu.util.VersionInfo UNICODE_5_0;
- field public static final android.icu.util.VersionInfo UNICODE_5_1;
- field public static final android.icu.util.VersionInfo UNICODE_5_2;
- field public static final android.icu.util.VersionInfo UNICODE_6_0;
- field public static final android.icu.util.VersionInfo UNICODE_6_1;
- field public static final android.icu.util.VersionInfo UNICODE_6_2;
- field public static final android.icu.util.VersionInfo UNICODE_6_3;
- field public static final android.icu.util.VersionInfo UNICODE_7_0;
- field public static final android.icu.util.VersionInfo UNICODE_8_0;
- field public static final android.icu.util.VersionInfo UNICODE_9_0;
- }
-
-}
-
package android.inputmethodservice {
public abstract class AbstractInputMethodService extends android.app.Service implements android.view.KeyEvent.Callback {
@@ -24003,7 +19204,7 @@
method public float getBearingAccuracyDegrees();
method public long getElapsedRealtimeNanos();
method public double getElapsedRealtimeUncertaintyNanos();
- method @Deprecated public android.os.Bundle getExtras();
+ method public android.os.Bundle getExtras();
method public double getLatitude();
method public double getLongitude();
method public String getProvider();
@@ -24032,7 +19233,7 @@
method public void setBearingAccuracyDegrees(float);
method public void setElapsedRealtimeNanos(long);
method public void setElapsedRealtimeUncertaintyNanos(double);
- method @Deprecated public void setExtras(android.os.Bundle);
+ method public void setExtras(@Nullable android.os.Bundle);
method public void setLatitude(double);
method public void setLongitude(double);
method public void setProvider(String);
@@ -24103,10 +19304,10 @@
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.app.PendingIntent);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull android.app.PendingIntent);
method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
@@ -24124,6 +19325,7 @@
field public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED";
field public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED";
field public static final String EXTRA_PROVIDER_NAME = "android.location.extra.PROVIDER_NAME";
+ field public static final String FUSED_PROVIDER = "fused";
field public static final String GPS_PROVIDER = "gps";
field public static final String KEY_FLUSH_COMPLETE = "flushComplete";
field public static final String KEY_LOCATION_CHANGED = "location";
@@ -24305,6 +19507,7 @@
public final class AudioDeviceInfo {
method @NonNull public String getAddress();
+ method @NonNull public java.util.List<android.media.AudioProfile> getAudioProfiles();
method @NonNull public int[] getChannelCounts();
method @NonNull public int[] getChannelIndexMasks();
method @NonNull public int[] getChannelMasks();
@@ -24470,6 +19673,7 @@
method public java.util.List<android.media.MicrophoneInfo> getMicrophones() throws java.io.IOException;
method public int getMode();
method public String getParameters(String);
+ method public static int getPlaybackOffloadSupport(@NonNull android.media.AudioFormat, @NonNull android.media.AudioAttributes);
method public String getProperty(String);
method public int getRingerMode();
method @Deprecated public int getRouting(int);
@@ -24588,6 +19792,9 @@
field public static final int MODE_NORMAL = 0; // 0x0
field public static final int MODE_RINGTONE = 1; // 0x1
field @Deprecated public static final int NUM_STREAMS = 5; // 0x5
+ field public static final int PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED = 2; // 0x2
+ field public static final int PLAYBACK_OFFLOAD_NOT_SUPPORTED = 0; // 0x0
+ field public static final int PLAYBACK_OFFLOAD_SUPPORTED = 1; // 0x1
field public static final String PROPERTY_OUTPUT_FRAMES_PER_BUFFER = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
field public static final String PROPERTY_OUTPUT_SAMPLE_RATE = "android.media.property.OUTPUT_SAMPLE_RATE";
field public static final String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED = "android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
@@ -24722,6 +19929,13 @@
method @NonNull public android.media.AudioPresentation.Builder setProgramId(int);
}
+ public class AudioProfile {
+ method @NonNull public int[] getChannelIndexMasks();
+ method @NonNull public int[] getChannelMasks();
+ method public int getFormat();
+ method @NonNull public int[] getSampleRates();
+ }
+
public class AudioRecord implements android.media.AudioRecordingMonitor android.media.AudioRouting android.media.MicrophoneDirection {
ctor public AudioRecord(int, int, int, int, int) throws java.lang.IllegalArgumentException;
method public void addOnRoutingChangedListener(android.media.AudioRouting.OnRoutingChangedListener, android.os.Handler);
@@ -28899,6 +24113,7 @@
field public static final long ACTION_PREPARE_FROM_URI = 131072L; // 0x20000L
field public static final long ACTION_REWIND = 8L; // 0x8L
field public static final long ACTION_SEEK_TO = 256L; // 0x100L
+ field public static final long ACTION_SET_PLAYBACK_SPEED = 4194304L; // 0x400000L
field public static final long ACTION_SET_RATING = 128L; // 0x80L
field public static final long ACTION_SKIP_TO_NEXT = 32L; // 0x20L
field public static final long ACTION_SKIP_TO_PREVIOUS = 16L; // 0x10L
@@ -34712,6 +29927,7 @@
field public static final String ID;
field public static final String MANUFACTURER;
field public static final String MODEL;
+ field @NonNull public static final String ODM_SKU;
field public static final String PRODUCT;
field @Deprecated public static final String RADIO;
field @Deprecated public static final String SERIAL;
@@ -34862,6 +30078,27 @@
method public void onCancel();
}
+ public abstract class CombinedVibrationEffect implements android.os.Parcelable {
+ method @NonNull public static android.os.CombinedVibrationEffect createSynced(@NonNull android.os.VibrationEffect);
+ method public int describeContents();
+ method @NonNull public static android.os.CombinedVibrationEffect.SequentialCombination startSequential();
+ method @NonNull public static android.os.CombinedVibrationEffect.SyncedCombination startSynced();
+ field @NonNull public static final android.os.Parcelable.Creator<android.os.CombinedVibrationEffect> CREATOR;
+ }
+
+ public static final class CombinedVibrationEffect.SequentialCombination {
+ method @NonNull public android.os.CombinedVibrationEffect.SequentialCombination addNext(int, @NonNull android.os.VibrationEffect);
+ method @NonNull public android.os.CombinedVibrationEffect.SequentialCombination addNext(int, @NonNull android.os.VibrationEffect, int);
+ method @NonNull public android.os.CombinedVibrationEffect.SequentialCombination addNext(@NonNull android.os.CombinedVibrationEffect);
+ method @NonNull public android.os.CombinedVibrationEffect.SequentialCombination addNext(@NonNull android.os.CombinedVibrationEffect, int);
+ method @NonNull public android.os.CombinedVibrationEffect combine();
+ }
+
+ public static final class CombinedVibrationEffect.SyncedCombination {
+ method @NonNull public android.os.CombinedVibrationEffect.SyncedCombination addVibrator(int, @NonNull android.os.VibrationEffect);
+ method @NonNull public android.os.CombinedVibrationEffect combine();
+ }
+
public class ConditionVariable {
ctor public ConditionVariable();
ctor public ConditionVariable(boolean);
@@ -36088,6 +31325,13 @@
field public static final int VIBRATION_EFFECT_SUPPORT_YES = 1; // 0x1
}
+ public abstract class VibratorManager {
+ method @NonNull public abstract android.os.Vibrator getDefaultVibrator();
+ method @NonNull public abstract android.os.Vibrator getVibrator(int);
+ method @NonNull public abstract int[] getVibratorIds();
+ method public abstract void vibrate(@NonNull android.os.CombinedVibrationEffect);
+ }
+
public class WorkSource implements android.os.Parcelable {
ctor public WorkSource();
ctor public WorkSource(android.os.WorkSource);
@@ -45840,6 +41084,28 @@
field public static final int IP_VERSION_MISMATCH = 2055; // 0x807
field public static final int IRAT_HANDOVER_FAILED = 2194; // 0x892
field public static final int IS707B_MAX_ACCESS_PROBES = 2089; // 0x829
+ field public static final int IWLAN_AUTHORIZATION_REJECTED = 9003; // 0x232b
+ field public static final int IWLAN_DNS_RESOLUTION_NAME_FAILURE = 16388; // 0x4004
+ field public static final int IWLAN_DNS_RESOLUTION_TIMEOUT = 16389; // 0x4005
+ field public static final int IWLAN_IKEV2_AUTH_FAILURE = 16385; // 0x4001
+ field public static final int IWLAN_IKEV2_CERT_INVALID = 16387; // 0x4003
+ field public static final int IWLAN_IKEV2_CONFIG_FAILURE = 16384; // 0x4000
+ field public static final int IWLAN_IKEV2_MSG_TIMEOUT = 16386; // 0x4002
+ field public static final int IWLAN_ILLEGAL_ME = 9006; // 0x232e
+ field public static final int IWLAN_IMEI_NOT_ACCEPTED = 11005; // 0x2afd
+ field public static final int IWLAN_MAX_CONNECTION_REACHED = 8193; // 0x2001
+ field public static final int IWLAN_NETWORK_FAILURE = 10500; // 0x2904
+ field public static final int IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED = 9000; // 0x2328
+ field public static final int IWLAN_NO_APN_SUBSCRIPTION = 9002; // 0x232a
+ field public static final int IWLAN_PDN_CONNECTION_REJECTION = 8192; // 0x2000
+ field public static final int IWLAN_PLMN_NOT_ALLOWED = 11011; // 0x2b03
+ field public static final int IWLAN_RAT_TYPE_NOT_ALLOWED = 11001; // 0x2af9
+ field public static final int IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS = 8244; // 0x2034
+ field public static final int IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION = 8241; // 0x2031
+ field public static final int IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS = 8245; // 0x2035
+ field public static final int IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION = 8242; // 0x2032
+ field public static final int IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED = 11055; // 0x2b2f
+ field public static final int IWLAN_USER_UNKNOWN = 9001; // 0x2329
field public static final int LIMITED_TO_IPV4 = 2234; // 0x8ba
field public static final int LIMITED_TO_IPV6 = 2235; // 0x8bb
field public static final int LLC_SNDCP = 25; // 0x19
@@ -46949,6 +42215,7 @@
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public String getManualNetworkSelectionPlmn();
method @Nullable public String getManufacturerCode();
method @Nullable public String getManufacturerCode(int);
+ method public static long getMaximumCallComposerPictureSize();
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getMeid();
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getMeid(int);
method public String getMmsUAProfUrl();
@@ -47014,7 +42281,6 @@
method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle);
method public boolean isWorldPhone();
method @Deprecated public void listen(android.telephony.PhoneStateListener, int);
- method @Deprecated public void listen(long, @NonNull android.telephony.PhoneStateListener);
method public void registerPhoneStateListener(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.PhoneStateListener);
method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public void requestCellInfoUpdate(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CellInfoCallback);
method @RequiresPermission(allOf={android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.ACCESS_FINE_LOCATION}) public android.telephony.NetworkScan requestNetworkScan(android.telephony.NetworkScanRequest, java.util.concurrent.Executor, android.telephony.TelephonyScanManager.NetworkScanCallback);
@@ -47058,6 +42324,7 @@
field public static final int APPTYPE_ISIM = 5; // 0x5
field public static final int APPTYPE_RUIM = 3; // 0x3
field public static final int APPTYPE_SIM = 1; // 0x1
+ field public static final int APPTYPE_UNKNOWN = 0; // 0x0
field public static final int APPTYPE_USIM = 2; // 0x2
field public static final int AUTHTYPE_EAP_AKA = 129; // 0x81
field public static final int AUTHTYPE_EAP_SIM = 128; // 0x80
@@ -51337,6 +46604,7 @@
method public int getSources();
method public int getVendorId();
method public android.os.Vibrator getVibrator();
+ method @NonNull public android.os.VibratorManager getVibratorManager();
method public boolean[] hasKeys(int...);
method public boolean hasMicrophone();
method public boolean isEnabled();
@@ -54188,6 +49456,7 @@
method public void setFlags(int, int);
method public void setFormat(int);
method public void setGravity(int);
+ method @RequiresPermission(android.Manifest.permission.HIDE_OVERLAY_WINDOWS) public final void setHideOverlayWindows(boolean);
method public void setIcon(@DrawableRes int);
method public void setLayout(int, int);
method public void setLocalFocus(boolean, boolean);
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt
index d83c0ad..cbb3bea 100644
--- a/core/api/module-lib-current.txt
+++ b/core/api/module-lib-current.txt
@@ -122,6 +122,20 @@
}
+package android.net {
+
+ public final class TcpRepairWindow {
+ ctor public TcpRepairWindow(int, int, int, int, int, int);
+ field public final int maxWindow;
+ field public final int rcvWnd;
+ field public final int rcvWndScale;
+ field public final int rcvWup;
+ field public final int sndWl1;
+ field public final int sndWnd;
+ }
+
+}
+
package android.os {
public class Binder implements android.os.IBinder {
diff --git a/core/api/removed.txt b/core/api/removed.txt
index f2dfb84..990388a 100644
--- a/core/api/removed.txt
+++ b/core/api/removed.txt
@@ -213,14 +213,6 @@
}
-package android.icu.util {
-
- public class JapaneseCalendar extends android.icu.util.GregorianCalendar {
- field @Deprecated public static final int CURRENT_ERA;
- }
-
-}
-
package android.location {
public class Location implements android.os.Parcelable {
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 3395ecc..821d3f1 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -36,6 +36,7 @@
field public static final String BIND_DIRECTORY_SEARCH = "android.permission.BIND_DIRECTORY_SEARCH";
field public static final String BIND_EUICC_SERVICE = "android.permission.BIND_EUICC_SERVICE";
field public static final String BIND_EXTERNAL_STORAGE_SERVICE = "android.permission.BIND_EXTERNAL_STORAGE_SERVICE";
+ field public static final String BIND_GBA_SERVICE = "android.permission.BIND_GBA_SERVICE";
field public static final String BIND_IMS_SERVICE = "android.permission.BIND_IMS_SERVICE";
field public static final String BIND_KEYGUARD_APPWIDGET = "android.permission.BIND_KEYGUARD_APPWIDGET";
field public static final String BIND_MUSIC_RECOGNITION_SERVICE = "android.permission.BIND_MUSIC_RECOGNITION_SERVICE";
@@ -56,6 +57,7 @@
field public static final String BRIGHTNESS_SLIDER_USAGE = "android.permission.BRIGHTNESS_SLIDER_USAGE";
field @Deprecated public static final String BROADCAST_NETWORK_PRIVILEGED = "android.permission.BROADCAST_NETWORK_PRIVILEGED";
field public static final String CAMERA_DISABLE_TRANSMIT_LED = "android.permission.CAMERA_DISABLE_TRANSMIT_LED";
+ field public static final String CAMERA_OPEN_CLOSE_LISTENER = "android.permission.CAMERA_OPEN_CLOSE_LISTENER";
field public static final String CAPTURE_AUDIO_HOTWORD = "android.permission.CAPTURE_AUDIO_HOTWORD";
field public static final String CAPTURE_MEDIA_OUTPUT = "android.permission.CAPTURE_MEDIA_OUTPUT";
field public static final String CAPTURE_TV_INPUT = "android.permission.CAPTURE_TV_INPUT";
@@ -92,7 +94,7 @@
field public static final String HANDLE_CAR_MODE_CHANGES = "android.permission.HANDLE_CAR_MODE_CHANGES";
field public static final String HARDWARE_TEST = "android.permission.HARDWARE_TEST";
field public static final String HDMI_CEC = "android.permission.HDMI_CEC";
- field public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
+ field @Deprecated public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
field public static final String INJECT_EVENTS = "android.permission.INJECT_EVENTS";
field public static final String INSTALL_DYNAMIC_SYSTEM = "android.permission.INSTALL_DYNAMIC_SYSTEM";
field public static final String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS";
@@ -210,6 +212,7 @@
field public static final String RETRIEVE_WINDOW_CONTENT = "android.permission.RETRIEVE_WINDOW_CONTENT";
field public static final String REVIEW_ACCESSIBILITY_SERVICES = "android.permission.REVIEW_ACCESSIBILITY_SERVICES";
field public static final String REVOKE_RUNTIME_PERMISSIONS = "android.permission.REVOKE_RUNTIME_PERMISSIONS";
+ field public static final String ROTATE_SURFACE_FLINGER = "android.permission.ROTATE_SURFACE_FLINGER";
field public static final String SCORE_NETWORKS = "android.permission.SCORE_NETWORKS";
field public static final String SECURE_ELEMENT_PRIVILEGED_OPERATION = "android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION";
field public static final String SEND_CATEGORY_CAR_NOTIFICATIONS = "android.permission.SEND_CATEGORY_CAR_NOTIFICATIONS";
@@ -2294,6 +2297,7 @@
field public static final int PROTECTION_FLAG_OEM = 16384; // 0x4000
field public static final int PROTECTION_FLAG_RECENTS = 33554432; // 0x2000000
field public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000
+ field public static final int PROTECTION_FLAG_ROLE = 67108864; // 0x4000000
field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000
field public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000
field @Nullable public final String backgroundPermission;
@@ -2457,6 +2461,11 @@
field public static final int SESSION_OPERATION_MODE_VENDOR_START = 32768; // 0x8000
}
+ public abstract static class CameraManager.AvailabilityCallback {
+ method @RequiresPermission(android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER) public void onCameraClosed(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER) public void onCameraOpened(@NonNull String, @NonNull String);
+ }
+
}
package android.hardware.camera2.params {
@@ -4164,7 +4173,6 @@
method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, @NonNull android.os.UserHandle);
method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(@NonNull String, boolean, @NonNull android.os.UserHandle);
method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(@NonNull android.location.BatchedLocationCallback);
- field public static final String FUSED_PROVIDER = "fused";
}
public final class LocationRequest implements android.os.Parcelable {
@@ -5912,8 +5920,8 @@
public class DvbsFrontendSettings extends android.media.tv.tuner.frontend.FrontendSettings {
method @NonNull public static android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder builder();
+ method public boolean canHandleDiseqcRxMessage();
method @Nullable public android.media.tv.tuner.frontend.DvbsCodeRate getCodeRate();
- method public boolean getCouldHandleDiseqcRxMessage();
method public int getInputStreamId();
method public int getModulation();
method public int getPilot();
@@ -5965,8 +5973,8 @@
public static class DvbsFrontendSettings.Builder {
method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings build();
+ method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setCanHandleDiseqcRxMessage(boolean);
method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setCodeRate(@Nullable android.media.tv.tuner.frontend.DvbsCodeRate);
- method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setCouldHandleDiseqcRxMessage(boolean);
method @IntRange(from=1) @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setFrequency(int);
method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setInputStreamId(int);
method @NonNull public android.media.tv.tuner.frontend.DvbsFrontendSettings.Builder setModulation(int);
@@ -8380,6 +8388,18 @@
package android.provider {
+ public class CallLog {
+ method @RequiresPermission(android.Manifest.permission.WRITE_CALL_LOG) public static void storeCallComposerPictureAsUser(@NonNull android.content.Context, @Nullable android.os.UserHandle, @NonNull java.io.InputStream, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.net.Uri,android.provider.CallLog.CallComposerLoggingException>);
+ }
+
+ public static class CallLog.CallComposerLoggingException extends java.lang.Throwable {
+ method public int getErrorCode();
+ field public static final int ERROR_INPUT_CLOSED = 3; // 0x3
+ field public static final int ERROR_REMOTE_END_CLOSED = 1; // 0x1
+ field public static final int ERROR_STORAGE_FULL = 2; // 0x2
+ field public static final int ERROR_UNKNOWN = 0; // 0x0
+ }
+
@Deprecated public static final class ContactsContract.MetadataSync implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncColumns {
field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata";
field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata";
@@ -10892,6 +10912,7 @@
}
public class TelephonyManager {
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) @WorkerThread public void bootstrapAuthenticationRequest(int, @NonNull android.net.Uri, @NonNull android.telephony.gba.UaSecurityProtocolIdentifier, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.BootstrapAuthenticationCallback);
method @Deprecated @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void call(String, String);
method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult changeIccLockPin(@NonNull String, @NonNull String);
method public int checkCarrierPrivilegesForPackage(String);
@@ -11011,8 +11032,10 @@
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setRadioEnabled(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadioPower(boolean);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerState(int);
- method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int, int);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerState(int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerState(int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
+ method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int, int);
+ method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSimPowerStateForSlot(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Integer>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<java.lang.Boolean>);
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List<android.telephony.RadioAccessSpecifier>);
method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean);
@@ -11062,6 +11085,12 @@
field public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
field public static final String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
field public static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
+ field public static final int GBA_FAILURE_REASON_FEATURE_NOT_READY = 2; // 0x2
+ field public static final int GBA_FAILURE_REASON_FEATURE_NOT_SUPPORTED = 1; // 0x1
+ field public static final int GBA_FAILURE_REASON_INCORRECT_NAF_ID = 4; // 0x4
+ field public static final int GBA_FAILURE_REASON_NETWORK_FAILURE = 3; // 0x3
+ field public static final int GBA_FAILURE_REASON_SECURITY_PROTOCOL_NOT_SUPPORTED = 5; // 0x5
+ field public static final int GBA_FAILURE_REASON_UNKNOWN = 0; // 0x0
field public static final int INVALID_EMERGENCY_NUMBER_DB_VERSION = -1; // 0xffffffff
field public static final int KEY_TYPE_EPDG = 1; // 0x1
field public static final int KEY_TYPE_WLAN = 2; // 0x2
@@ -11096,6 +11125,11 @@
field public static final int SET_CARRIER_RESTRICTION_ERROR = 2; // 0x2
field public static final int SET_CARRIER_RESTRICTION_NOT_SUPPORTED = 1; // 0x1
field public static final int SET_CARRIER_RESTRICTION_SUCCESS = 0; // 0x0
+ field public static final int SET_SIM_POWER_STATE_ALREADY_IN_STATE = 1; // 0x1
+ field public static final int SET_SIM_POWER_STATE_MODEM_ERROR = 2; // 0x2
+ field public static final int SET_SIM_POWER_STATE_NOT_SUPPORTED = 4; // 0x4
+ field public static final int SET_SIM_POWER_STATE_SIM_ERROR = 3; // 0x3
+ field public static final int SET_SIM_POWER_STATE_SUCCESS = 0; // 0x0
field public static final int SIM_ACTIVATION_STATE_ACTIVATED = 2; // 0x2
field public static final int SIM_ACTIVATION_STATE_ACTIVATING = 1; // 0x1
field public static final int SIM_ACTIVATION_STATE_DEACTIVATED = 3; // 0x3
@@ -11115,6 +11149,12 @@
field public static final int THERMAL_MITIGATION_RESULT_UNKNOWN_ERROR = 4; // 0x4
}
+ public static class TelephonyManager.BootstrapAuthenticationCallback {
+ ctor public TelephonyManager.BootstrapAuthenticationCallback();
+ method public void onAuthenticationFailure(int);
+ method public void onKeysAvailable(@NonNull byte[], @NonNull String);
+ }
+
public static interface TelephonyManager.CallForwardingInfoCallback {
method public void onCallForwardingInfoAvailable(@NonNull android.telephony.CallForwardingInfo);
method public void onError(int);
@@ -11253,7 +11293,6 @@
method @NonNull public android.telephony.data.ApnThrottleStatus.Builder setSlotIndex(int);
method @NonNull public android.telephony.data.ApnThrottleStatus.Builder setThrottleExpiryTimeMillis(long);
method @NonNull public android.telephony.data.ApnThrottleStatus.Builder setTransportType(int);
- field public static final long NO_THROTTLE_EXPIRY_TIME = -1L; // 0xffffffffffffffffL
}
public final class DataCallResponse implements android.os.Parcelable {
@@ -11557,6 +11596,141 @@
}
+package android.telephony.gba {
+
+ public class GbaService extends android.app.Service {
+ ctor public GbaService();
+ method public void onAuthenticationRequest(int, int, int, @NonNull android.net.Uri, @NonNull byte[], boolean);
+ method public final void reportAuthenticationFailure(int, int) throws java.lang.RuntimeException;
+ method public final void reportKeysAvailable(int, @NonNull byte[], @NonNull String) throws java.lang.RuntimeException;
+ field public static final String SERVICE_INTERFACE = "android.telephony.gba.GbaService";
+ }
+
+ public class TlsParams {
+ method public static boolean isTlsCipherSuiteSupported(int);
+ field public static final int GROUP_SECP256R1 = 23; // 0x17
+ field public static final int GROUP_SECP384R1 = 24; // 0x18
+ field public static final int GROUP_X25519 = 29; // 0x1d
+ field public static final int GROUP_X448 = 30; // 0x1e
+ field public static final int PROTOCOL_VERSION_TLS_1_2 = 771; // 0x303
+ field public static final int PROTOCOL_VERSION_TLS_1_3 = 772; // 0x304
+ field public static final int SIG_ECDSA_BRAINPOOLP256R1TLS13_SHA256 = 2074; // 0x81a
+ field public static final int SIG_ECDSA_BRAINPOOLP384R1TLS13_SHA384 = 2075; // 0x81b
+ field public static final int SIG_ECDSA_BRAINPOOLP512R1TLS13_SHA512 = 2076; // 0x81c
+ field public static final int SIG_ECDSA_SECP256R1_SHA256 = 1027; // 0x403
+ field public static final int SIG_ECDSA_SECP384R1_SHA384 = 1283; // 0x503
+ field public static final int SIG_ECDSA_SECP521R1_SHA512 = 1539; // 0x603
+ field public static final int SIG_ECDSA_SHA1 = 515; // 0x203
+ field public static final int SIG_RSA_PKCS1_SHA1 = 513; // 0x201
+ field public static final int SIG_RSA_PKCS1_SHA256 = 1025; // 0x401
+ field public static final int SIG_RSA_PKCS1_SHA256_LEGACY = 1056; // 0x420
+ field public static final int SIG_RSA_PKCS1_SHA384 = 1281; // 0x501
+ field public static final int SIG_RSA_PKCS1_SHA384_LEGACY = 1312; // 0x520
+ field public static final int SIG_RSA_PKCS1_SHA512 = 1537; // 0x601
+ field public static final int SIG_RSA_PKCS1_SHA512_LEGACY = 1568; // 0x620
+ field public static final int SIG_RSA_PSS_RSAE_SHA256 = 2052; // 0x804
+ field public static final int SIG_RSA_PSS_RSAE_SHA384 = 2053; // 0x805
+ field public static final int SIG_RSA_PSS_RSAE_SHA512 = 2054; // 0x806
+ field public static final int TLS_AES_128_CCM_SHA256 = 4868; // 0x1304
+ field public static final int TLS_AES_128_GCM_SHA256 = 4865; // 0x1301
+ field public static final int TLS_AES_256_GCM_SHA384 = 4866; // 0x1302
+ field public static final int TLS_CHACHA20_POLY1305_SHA256 = 4867; // 0x1303
+ field public static final int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 19; // 0x13
+ field public static final int TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 50; // 0x32
+ field public static final int TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 64; // 0x40
+ field public static final int TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 56; // 0x38
+ field public static final int TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 106; // 0x6a
+ field public static final int TLS_DHE_PSK_WITH_AES_128_CCM = 49318; // 0xc0a6
+ field public static final int TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 170; // 0xaa
+ field public static final int TLS_DHE_PSK_WITH_AES_256_CCM = 49319; // 0xc0a7
+ field public static final int TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 171; // 0xab
+ field public static final int TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 52397; // 0xccad
+ field public static final int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 22; // 0x16
+ field public static final int TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 51; // 0x33
+ field public static final int TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 103; // 0x67
+ field public static final int TLS_DHE_RSA_WITH_AES_128_CCM = 49310; // 0xc09e
+ field public static final int TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 158; // 0x9e
+ field public static final int TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 57; // 0x39
+ field public static final int TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 107; // 0x6b
+ field public static final int TLS_DHE_RSA_WITH_AES_256_CCM = 49311; // 0xc09f
+ field public static final int TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 159; // 0x9f
+ field public static final int TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 52394; // 0xccaa
+ field public static final int TLS_DH_ANON_WITH_3DES_EDE_CBC_SHA = 27; // 0x1b
+ field public static final int TLS_DH_ANON_WITH_AES_128_CBC_SHA = 52; // 0x34
+ field public static final int TLS_DH_ANON_WITH_AES_128_CBC_SHA256 = 108; // 0x6c
+ field public static final int TLS_DH_ANON_WITH_AES_256_CBC_SHA = 58; // 0x3a
+ field public static final int TLS_DH_ANON_WITH_AES_256_CBC_SHA256 = 109; // 0x6d
+ field public static final int TLS_DH_ANON_WITH_RC4_128_MD5 = 24; // 0x18
+ field public static final int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 13; // 0xd
+ field public static final int TLS_DH_DSS_WITH_AES_128_CBC_SHA = 48; // 0x30
+ field public static final int TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 62; // 0x3e
+ field public static final int TLS_DH_DSS_WITH_AES_256_CBC_SHA = 54; // 0x36
+ field public static final int TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 104; // 0x68
+ field public static final int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 16; // 0x10
+ field public static final int TLS_DH_RSA_WITH_AES_128_CBC_SHA = 49; // 0x31
+ field public static final int TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 63; // 0x3f
+ field public static final int TLS_DH_RSA_WITH_AES_256_CBC_SHA = 55; // 0x37
+ field public static final int TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 105; // 0x69
+ field public static final int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 49195; // 0xc02b
+ field public static final int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 49196; // 0xc02c
+ field public static final int TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 52393; // 0xcca9
+ field public static final int TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256 = 53253; // 0xd005
+ field public static final int TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 = 53249; // 0xd001
+ field public static final int TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384 = 53250; // 0xd002
+ field public static final int TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 52396; // 0xccac
+ field public static final int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 49199; // 0xc02f
+ field public static final int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 49200; // 0xc030
+ field public static final int TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 52392; // 0xcca8
+ field public static final int TLS_NULL_WITH_NULL_NULL = 0; // 0x0
+ field public static final int TLS_RSA_WITH_3DES_EDE_CBC_SHA = 10; // 0xa
+ field public static final int TLS_RSA_WITH_AES_128_CBC_SHA = 47; // 0x2f
+ field public static final int TLS_RSA_WITH_AES_128_CBC_SHA256 = 60; // 0x3c
+ field public static final int TLS_RSA_WITH_AES_256_CBC_SHA = 53; // 0x35
+ field public static final int TLS_RSA_WITH_AES_256_CBC_SHA256 = 61; // 0x3d
+ field public static final int TLS_RSA_WITH_NULL_MD5 = 1; // 0x1
+ field public static final int TLS_RSA_WITH_NULL_SHA = 2; // 0x2
+ field public static final int TLS_RSA_WITH_NULL_SHA256 = 59; // 0x3b
+ field public static final int TLS_RSA_WITH_RC4_128_MD5 = 4; // 0x4
+ field public static final int TLS_RSA_WITH_RC4_128_SHA = 5; // 0x5
+ }
+
+ public final class UaSecurityProtocolIdentifier implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getOrg();
+ method public int getProtocol();
+ method public int getTlsCipherSuite();
+ method @NonNull public byte[] toByteArray();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.telephony.gba.UaSecurityProtocolIdentifier> CREATOR;
+ field public static final int ORG_3GPP = 1; // 0x1
+ field public static final int ORG_3GPP2 = 2; // 0x2
+ field public static final int ORG_GSMA = 4; // 0x4
+ field public static final int ORG_LOCAL = 255; // 0xff
+ field public static final int ORG_NONE = 0; // 0x0
+ field public static final int ORG_OMA = 3; // 0x3
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_GENERATION_TMPI = 256; // 0x100
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_GENERIC_PUSH_LAYER = 5; // 0x5
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_HTTP_BASED_MBMS = 3; // 0x3
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_HTTP_DIGEST_AUTHENTICATION = 2; // 0x2
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_IMS_MEDIA_PLANE = 6; // 0x6
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_MBMS = 1; // 0x1
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_SIP_BASED_MBMS = 4; // 0x4
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_SUBSCRIBER_CERTIFICATE = 0; // 0x0
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_TLS_BROWSER = 131072; // 0x20000
+ field public static final int UA_SECURITY_PROTOCOL_3GPP_TLS_DEFAULT = 65536; // 0x10000
+ }
+
+ public static final class UaSecurityProtocolIdentifier.Builder {
+ ctor public UaSecurityProtocolIdentifier.Builder();
+ ctor public UaSecurityProtocolIdentifier.Builder(@NonNull android.telephony.gba.UaSecurityProtocolIdentifier);
+ method @NonNull public android.telephony.gba.UaSecurityProtocolIdentifier build();
+ method @NonNull public android.telephony.gba.UaSecurityProtocolIdentifier.Builder setOrg(int);
+ method @NonNull public android.telephony.gba.UaSecurityProtocolIdentifier.Builder setProtocol(int);
+ method @NonNull public android.telephony.gba.UaSecurityProtocolIdentifier.Builder setTlsCipherSuite(int);
+ }
+
+}
+
package android.telephony.ims {
public final class AudioCodecAttributes implements android.os.Parcelable {
@@ -12154,6 +12328,7 @@
}
public interface SipDelegateConnection {
+ method public void closeDialog(@NonNull String);
method public void notifyMessageReceiveError(@NonNull String, int);
method public void notifyMessageReceived(@NonNull String);
method public void sendMessage(@NonNull android.telephony.ims.SipMessage, long);
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index ffb31c9..ffe2736f 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -94,6 +94,8 @@
method public static void resumeAppSwitches() throws android.os.RemoteException;
method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public void scheduleApplicationInfoChanged(java.util.List<java.lang.String>, int);
method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public boolean updateMccMncConfiguration(@NonNull String, @NonNull String);
+ field public static final long DROP_CLOSE_SYSTEM_DIALOGS = 174664120L; // 0xa6929b8L
+ field public static final long LOCK_DOWN_CLOSE_SYSTEM_DIALOGS = 174664365L; // 0xa692aadL
field public static final int PROCESS_CAPABILITY_ALL = 7; // 0x7
field public static final int PROCESS_CAPABILITY_ALL_EXPLICIT = 1; // 0x1
field public static final int PROCESS_CAPABILITY_ALL_IMPLICIT = 6; // 0x6
@@ -216,6 +218,7 @@
field public static final String KEY_FG_SERVICE_STATE_SETTLE_TIME = "fg_service_state_settle_time";
field public static final String KEY_TOP_STATE_SETTLE_TIME = "top_state_settle_time";
field public static final String OPSTR_MANAGE_ONGOING_CALLS = "android:manage_ongoing_calls";
+ field public static final String OPSTR_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER = "android:use_icc_auth_with_device_identifier";
field public static final int OP_COARSE_LOCATION = 0; // 0x0
field public static final int OP_RECORD_AUDIO = 27; // 0x1b
field public static final int OP_START_FOREGROUND = 76; // 0x4c
@@ -282,6 +285,7 @@
method public java.util.List<android.app.RemoteAction> getActions();
method public float getAspectRatio();
method public android.graphics.Rect getSourceRectHint();
+ method public boolean isSeamlessResizeEnabled();
}
public class StatusBarManager {
@@ -378,6 +382,7 @@
field public static final String ACTION_DATA_SHARING_RESTRICTION_APPLIED = "android.app.action.DATA_SHARING_RESTRICTION_APPLIED";
field public static final int OPERATION_CREATE_AND_MANAGE_USER = 5; // 0x5
field public static final int OPERATION_LOCK_NOW = 1; // 0x1
+ field public static final int OPERATION_REBOOT = 7; // 0x7
field public static final int OPERATION_REMOVE_USER = 6; // 0x6
field public static final int OPERATION_START_USER_IN_BACKGROUND = 3; // 0x3
field public static final int OPERATION_STOP_USER = 4; // 0x4
@@ -740,6 +745,11 @@
method public String[] getCameraIdListNoLazy() throws android.hardware.camera2.CameraAccessException;
}
+ public abstract static class CameraManager.AvailabilityCallback {
+ method @RequiresPermission(android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER) public void onCameraClosed(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER) public void onCameraOpened(@NonNull String, @NonNull String);
+ }
+
}
package android.hardware.display {
@@ -953,7 +963,6 @@
method @NonNull public String[] getBackgroundThrottlingWhitelist();
method @NonNull public String[] getIgnoreSettingsWhitelist();
method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
- field public static final String FUSED_PROVIDER = "fused";
}
}
@@ -1001,6 +1010,8 @@
field public static final int DEVICE_ROLE_DISABLED = 2; // 0x2
field public static final int DEVICE_ROLE_NONE = 0; // 0x0
field public static final int DEVICE_ROLE_PREFERRED = 1; // 0x1
+ field public static final int OFFLOAD_GAPLESS_SUPPORTED = 2; // 0x2
+ field public static final int OFFLOAD_SUPPORTED = 1; // 0x1
field public static final int STREAM_DEFAULT = -1; // 0xffffffff
}
diff --git a/core/java/android/accounts/ChooseAccountActivity.java b/core/java/android/accounts/ChooseAccountActivity.java
index 4af22bf..b27d9cd 100644
--- a/core/java/android/accounts/ChooseAccountActivity.java
+++ b/core/java/android/accounts/ChooseAccountActivity.java
@@ -16,16 +16,12 @@
package android.accounts;
import android.app.Activity;
-import android.app.ActivityManager;
-import android.app.ActivityTaskManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
-import android.os.IBinder;
import android.os.Parcelable;
-import android.os.RemoteException;
import android.os.Process;
import android.os.UserHandle;
import android.util.Log;
@@ -71,15 +67,8 @@
return;
}
- try {
- IBinder activityToken = getActivityToken();
- mCallingUid = ActivityTaskManager.getService().getLaunchedFromUid(activityToken);
- mCallingPackage = ActivityTaskManager.getService().getLaunchedFromPackage(
- activityToken);
- } catch (RemoteException re) {
- // Couldn't figure out caller details
- Log.w(getClass().getSimpleName(), "Unable to get caller identity \n" + re);
- }
+ mCallingUid = getLaunchedFromUid();
+ mCallingPackage = getLaunchedFromPackage();
if (UserHandle.isSameApp(mCallingUid, Process.SYSTEM_UID) &&
getIntent().getStringExtra(AccountManager.KEY_ANDROID_PACKAGE_NAME) != null) {
diff --git a/core/java/android/accounts/ChooseTypeAndAccountActivity.java b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
index 4b4ef00..a2464d5 100644
--- a/core/java/android/accounts/ChooseTypeAndAccountActivity.java
+++ b/core/java/android/accounts/ChooseTypeAndAccountActivity.java
@@ -15,16 +15,12 @@
*/
package android.accounts;
-import android.app.ActivityTaskManager;
import com.google.android.collect.Sets;
import android.app.Activity;
-import android.app.ActivityManager;
import android.content.Intent;
import android.os.Bundle;
-import android.os.IBinder;
import android.os.Parcelable;
-import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.TextUtils;
@@ -144,22 +140,13 @@
+ savedInstanceState + ")");
}
- String message = null;
-
- try {
- IBinder activityToken = getActivityToken();
- mCallingUid = ActivityTaskManager.getService().getLaunchedFromUid(activityToken);
- mCallingPackage = ActivityTaskManager.getService().getLaunchedFromPackage(
- activityToken);
- if (mCallingUid != 0 && mCallingPackage != null) {
- Bundle restrictions = UserManager.get(this)
- .getUserRestrictions(new UserHandle(UserHandle.getUserId(mCallingUid)));
- mDisallowAddAccounts =
- restrictions.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false);
- }
- } catch (RemoteException re) {
- // Couldn't figure out caller details
- Log.w(getClass().getSimpleName(), "Unable to get caller identity \n" + re);
+ mCallingUid = getLaunchedFromUid();
+ mCallingPackage = getLaunchedFromPackage();
+ if (mCallingUid != 0 && mCallingPackage != null) {
+ Bundle restrictions = UserManager.get(this)
+ .getUserRestrictions(new UserHandle(UserHandle.getUserId(mCallingUid)));
+ mDisallowAddAccounts =
+ restrictions.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false);
}
// save some items we use frequently
diff --git a/core/java/android/accounts/GrantCredentialsPermissionActivity.java b/core/java/android/accounts/GrantCredentialsPermissionActivity.java
index 5dc6e60..74dae0e 100644
--- a/core/java/android/accounts/GrantCredentialsPermissionActivity.java
+++ b/core/java/android/accounts/GrantCredentialsPermissionActivity.java
@@ -16,18 +16,14 @@
package android.accounts;
import android.app.Activity;
-import android.app.ActivityTaskManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
-import android.os.IBinder;
import android.os.Process;
-import android.os.RemoteException;
import android.os.UserHandle;
import android.text.TextUtils;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
@@ -85,13 +81,7 @@
return;
}
- try {
- IBinder activityToken = getActivityToken();
- mCallingUid = ActivityTaskManager.getService().getLaunchedFromUid(activityToken);
- } catch (RemoteException re) {
- // Couldn't figure out caller details
- Log.w(getClass().getSimpleName(), "Unable to get caller identity \n" + re);
- }
+ mCallingUid = getLaunchedFromUid();
if (!UserHandle.isSameApp(mCallingUid, Process.SYSTEM_UID) && mCallingUid != mUid) {
setResult(Activity.RESULT_CANCELED);
diff --git a/core/java/android/animation/OWNERS b/core/java/android/animation/OWNERS
new file mode 100644
index 0000000..822a35c
--- /dev/null
+++ b/core/java/android/animation/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 47085
+
+romainguy@google.com
+tianliu@google.com
+alanv@google.com
+adamp@google.com
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index f92768a..d8cb7a6 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -6230,6 +6230,23 @@
}
/**
+ * Returns the uid who started this activity.
+ * @hide
+ */
+ public int getLaunchedFromUid() {
+ return ActivityClient.getInstance().getLaunchedFromUid(getActivityToken());
+ }
+
+ /**
+ * Returns the package who started this activity.
+ * @hide
+ */
+ @Nullable
+ public String getLaunchedFromPackage() {
+ return ActivityClient.getInstance().getLaunchedFromPackage(getActivityToken());
+ }
+
+ /**
* Control whether this activity's main window is visible. This is intended
* only for the special case of an activity that is not going to show a
* UI itself, but can't just finish prior to onResume() because it needs
diff --git a/core/java/android/app/ActivityClient.java b/core/java/android/app/ActivityClient.java
index 84ecd24..64d795c 100644
--- a/core/java/android/app/ActivityClient.java
+++ b/core/java/android/app/ActivityClient.java
@@ -221,6 +221,22 @@
}
}
+ public int getLaunchedFromUid(IBinder token) {
+ try {
+ return getActivityClientController().getLaunchedFromUid(token);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ public String getLaunchedFromPackage(IBinder token) {
+ try {
+ return getActivityClientController().getLaunchedFromPackage(token);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
Bundle getActivityOptions(IBinder token) {
try {
return getActivityClientController().getActivityOptions(token);
@@ -451,8 +467,20 @@
return sInstance.get();
}
+ /**
+ * If system server has passed the controller interface, store it so the subsequent access can
+ * speed up.
+ */
+ public static IActivityClientController setActivityClientController(
+ IActivityClientController activityClientController) {
+ // No lock because it is no harm to encounter race condition. The thread safe Singleton#get
+ // will take over that case.
+ return INTERFACE_SINGLETON.mKnownInstance = activityClientController;
+ }
+
private static IActivityClientController getActivityClientController() {
- return sActivityClientController.get();
+ final IActivityClientController controller = INTERFACE_SINGLETON.mKnownInstance;
+ return controller != null ? controller : INTERFACE_SINGLETON.get();
}
private static final Singleton<ActivityClient> sInstance = new Singleton<ActivityClient>() {
@@ -462,8 +490,17 @@
}
};
- private static final Singleton<IActivityClientController> sActivityClientController =
- new Singleton<IActivityClientController>() {
+ private static final ActivityClientControllerSingleton INTERFACE_SINGLETON =
+ new ActivityClientControllerSingleton();
+
+ private static class ActivityClientControllerSingleton
+ extends Singleton<IActivityClientController> {
+ /**
+ * A quick look up to reduce potential extra binder transactions. E.g. getting activity
+ * task manager from service manager and controller from activity task manager.
+ */
+ IActivityClientController mKnownInstance;
+
@Override
protected IActivityClientController create() {
try {
@@ -472,5 +509,5 @@
throw e.rethrowFromSystemServer();
}
}
- };
+ }
}
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 38a22d8..a5d88ef 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -31,6 +31,8 @@
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.Disabled;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Context;
@@ -91,9 +93,6 @@
import com.android.internal.util.Preconditions;
import com.android.server.LocalServices;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlSerializer;
-
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -870,6 +869,39 @@
private static final boolean DEVELOPMENT_FORCE_LOW_RAM =
SystemProperties.getBoolean("debug.force_low_ram", false);
+ /**
+ * Intent {@link Intent#ACTION_CLOSE_SYSTEM_DIALOGS} is too powerful to be unrestricted. We
+ * restrict its usage for a few legitimate use-cases only, regardless of targetSdk. For the
+ * other use-cases we drop the intent with a log message.
+ *
+ * Note that this is the lighter version of {@link ActivityManager
+ * #LOCK_DOWN_CLOSE_SYSTEM_DIALOGS} which is not gated on targetSdk in order to eliminate the
+ * abuse vector.
+ *
+ * @hide
+ */
+ @TestApi
+ @ChangeId
+ @Disabled
+ public static final long DROP_CLOSE_SYSTEM_DIALOGS = 174664120L;
+
+ /**
+ * Intent {@link Intent#ACTION_CLOSE_SYSTEM_DIALOGS} is too powerful to be unrestricted. So,
+ * apps targeting {@link Build.VERSION_CODES#S} or higher will crash if they try to send such
+ * intent and don't have permission {@code android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS}.
+ *
+ * Note that this is the more restrict version of {@link ActivityManager
+ * #DROP_CLOSE_SYSTEM_DIALOGS} that expects the app to stop sending aforementioned intent once
+ * it bumps its targetSdk to {@link Build.VERSION_CODES#S} or higher.
+ *
+ * @hide
+ */
+ @TestApi
+ @ChangeId
+ @Disabled
+ // @EnabledSince(targetSdkVersion = VERSION_CODES.S)
+ public static final long LOCK_DOWN_CLOSE_SYSTEM_DIALOGS = 174664365L;
+
/** @hide */
public int getFrontActivityScreenCompatMode() {
try {
@@ -4167,10 +4199,8 @@
"android.permission.INTERACT_ACROSS_USERS_FULL"
})
public static int getCurrentUser() {
- UserInfo ui;
try {
- ui = getService().getCurrentUser();
- return ui != null ? ui.id : 0;
+ return getService().getCurrentUserId();
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index ed6dea8..6d564a3 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -6681,8 +6681,7 @@
private InstrumentationInfo prepareInstrumentation(AppBindData data) {
final InstrumentationInfo ii;
try {
- ii = new ApplicationPackageManager(
- null, getPackageManager(), getPermissionManager())
+ ii = new ApplicationPackageManager(null, getPackageManager())
.getInstrumentationInfo(data.instrumentationName, 0);
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 4dd6a7e..1009f66 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -1166,8 +1166,12 @@
public static final int OP_MANAGE_CREDENTIALS = AppProtoEnums.APP_OP_MANAGE_CREDENTIALS;
/** @hide */
+ public static final int OP_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER =
+ AppProtoEnums.APP_OP_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER;
+
+ /** @hide */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- public static final int _NUM_OP = 105;
+ public static final int _NUM_OP = 106;
/** Access to coarse location information. */
public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -1525,6 +1529,15 @@
*/
public static final String OPSTR_MANAGE_CREDENTIALS = "android:manage_credentials";
+ /**
+ * Allows to read device identifiers and use ICC based authentication like EAP-AKA.
+ *
+ * @hide
+ */
+ @TestApi
+ public static final String OPSTR_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER =
+ "android:use_icc_auth_with_device_identifier";
+
/** {@link #sAppOpsToNote} not initialized yet for this op */
private static final byte SHOULD_COLLECT_NOTE_OP_NOT_INITIALIZED = 0;
/** Should not collect noting of this app-op in {@link #sAppOpsToNote} */
@@ -1604,6 +1617,7 @@
OP_INTERACT_ACROSS_PROFILES,
OP_LOADER_USAGE_STATS,
OP_MANAGE_ONGOING_CALLS,
+ OP_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER,
};
/**
@@ -1720,6 +1734,7 @@
OP_RECORD_AUDIO_HOTWORD, // RECORD_AUDIO_HOTWORD
OP_MANAGE_ONGOING_CALLS, // MANAGE_ONGOING_CALLS
OP_MANAGE_CREDENTIALS, // MANAGE_CREDENTIALS
+ OP_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER, // USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
};
/**
@@ -1831,6 +1846,7 @@
OPSTR_RECORD_AUDIO_HOTWORD,
OPSTR_MANAGE_ONGOING_CALLS,
OPSTR_MANAGE_CREDENTIALS,
+ OPSTR_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER,
};
/**
@@ -1943,6 +1959,7 @@
"RECORD_AUDIO_HOTWORD",
"MANAGE_ONGOING_CALLS",
"MANAGE_CREDENTIALS",
+ "USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER",
};
/**
@@ -2056,6 +2073,7 @@
null, // no permission for OP_RECORD_AUDIO_HOTWORD
Manifest.permission.MANAGE_ONGOING_CALLS,
null, // no permission for OP_MANAGE_CREDENTIALS
+ Manifest.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER,
};
/**
@@ -2169,6 +2187,7 @@
null, // RECORD_AUDIO_HOTWORD
null, // MANAGE_ONGOING_CALLS
null, // MANAGE_CREDENTIALS
+ null, // USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
};
/**
@@ -2281,6 +2300,7 @@
null, // RECORD_AUDIO_HOTWORD
null, // MANAGE_ONGOING_CALLS
null, // MANAGE_CREDENTIALS
+ null, // USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
};
/**
@@ -2392,6 +2412,7 @@
AppOpsManager.MODE_ALLOWED, // OP_RECORD_AUDIO_HOTWORD
AppOpsManager.MODE_DEFAULT, // MANAGE_ONGOING_CALLS
AppOpsManager.MODE_DEFAULT, // MANAGE_CREDENTIALS
+ AppOpsManager.MODE_DEFAULT, // USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
};
/**
@@ -2507,6 +2528,7 @@
false, // RECORD_AUDIO_HOTWORD
true, // MANAGE_ONGOING_CALLS
false, // MANAGE_CREDENTIALS
+ true, // USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER
};
/**
@@ -6489,9 +6511,10 @@
* @param code The op code.
* @param uid The UID performing the operation.
* @param packageName The package performing the operation.
+ * @param flags The flags of this op
* @param result The result of the note.
*/
- void onOpNoted(int code, int uid, String packageName, int result);
+ void onOpNoted(int code, int uid, String packageName, @OpFlags int flags, @Mode int result);
}
/**
@@ -6528,9 +6551,10 @@
* @param op The op code.
* @param uid The UID performing the operation.
* @param packageName The package performing the operation.
+ * @param flags The flags of this op
* @param result The result of the start.
*/
- void onOpStarted(int op, int uid, String packageName, int result);
+ void onOpStarted(int op, int uid, String packageName, @OpFlags int flags, @Mode int result);
}
AppOpsManager(Context context, IAppOpsService service) {
@@ -7113,8 +7137,8 @@
}
cb = new IAppOpsStartedCallback.Stub() {
@Override
- public void opStarted(int op, int uid, String packageName, int mode) {
- callback.onOpStarted(op, uid, packageName, mode);
+ public void opStarted(int op, int uid, String packageName, int flags, int mode) {
+ callback.onOpStarted(op, uid, packageName, flags, mode);
}
};
mStartedWatchers.put(callback, cb);
@@ -7180,8 +7204,8 @@
}
cb = new IAppOpsNotedCallback.Stub() {
@Override
- public void opNoted(int op, int uid, String packageName, int mode) {
- callback.onOpNoted(op, uid, packageName, mode);
+ public void opNoted(int op, int uid, String packageName, int flags, int mode) {
+ callback.onOpNoted(op, uid, packageName, flags, mode);
}
};
mNotedWatchers.put(callback, cb);
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 3642d31..186d1fe 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -59,8 +59,6 @@
import android.content.pm.PackageInstaller;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.PackageManager.Property;
import android.content.pm.ParceledListSlice;
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
@@ -95,8 +93,6 @@
import android.os.UserManager;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
-import android.permission.IOnPermissionsChangeListener;
-import android.permission.IPermissionManager;
import android.permission.PermissionManager;
import android.provider.Settings;
import android.system.ErrnoException;
@@ -106,7 +102,6 @@
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
-import android.util.DebugUtils;
import android.util.LauncherIcons;
import android.util.Log;
@@ -129,7 +124,6 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Objects;
import java.util.Set;
@@ -137,14 +131,6 @@
public class ApplicationPackageManager extends PackageManager {
private static final String TAG = "ApplicationPackageManager";
private static final boolean DEBUG_ICONS = false;
- /**
- * Note: Changing this won't do anything on it's own - you should also change the filtering in
- * {@link #shouldTraceGrant}
- *
- * @hide
- */
- public static final boolean DEBUG_TRACE_GRANTS = false;
- public static final boolean DEBUG_TRACE_PERMISSION_UPDATES = false;
private static final int DEFAULT_EPHEMERAL_COOKIE_MAX_SIZE_BYTES = 16384; // 16KB
@@ -171,6 +157,8 @@
@GuardedBy("mLock")
private UserManager mUserManager;
@GuardedBy("mLock")
+ private PermissionManager mPermissionManager;
+ @GuardedBy("mLock")
private PackageInstaller mInstaller;
@GuardedBy("mLock")
private ArtManager mArtManager;
@@ -190,6 +178,15 @@
}
}
+ private PermissionManager getPermissionManager() {
+ synchronized (mLock) {
+ if (mPermissionManager == null) {
+ mPermissionManager = mContext.getSystemService(PermissionManager.class);
+ }
+ return mPermissionManager;
+ }
+ }
+
@Override
public int getUserId() {
return mContext.getUserId();
@@ -355,66 +352,41 @@
@Override
@SuppressWarnings("unchecked")
public List<PermissionGroupInfo> getAllPermissionGroups(int flags) {
- try {
- final ParceledListSlice<PermissionGroupInfo> parceledList =
- mPermissionManager.getAllPermissionGroups(flags);
- if (parceledList == null) {
- return Collections.emptyList();
- }
- return parceledList.getList();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().getAllPermissionGroups(flags);
}
@Override
public PermissionGroupInfo getPermissionGroupInfo(String groupName, int flags)
throws NameNotFoundException {
- try {
- final PermissionGroupInfo pgi =
- mPermissionManager.getPermissionGroupInfo(groupName, flags);
- if (pgi != null) {
- return pgi;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ final PermissionGroupInfo permissionGroupInfo = getPermissionManager()
+ .getPermissionGroupInfo(groupName, flags);
+ if (permissionGroupInfo == null) {
+ throw new NameNotFoundException(groupName);
}
- throw new NameNotFoundException(groupName);
+ return permissionGroupInfo;
}
@Override
public PermissionInfo getPermissionInfo(String permName, int flags)
throws NameNotFoundException {
- try {
- final String packageName = mContext.getOpPackageName();
- final PermissionInfo pi =
- mPermissionManager.getPermissionInfo(permName, packageName, flags);
- if (pi != null) {
- return pi;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ final PermissionInfo permissionInfo = getPermissionManager().getPermissionInfo(permName,
+ flags);
+ if (permissionInfo == null) {
+ throw new NameNotFoundException(permName);
}
- throw new NameNotFoundException(permName);
+ return permissionInfo;
}
@Override
@SuppressWarnings("unchecked")
public List<PermissionInfo> queryPermissionsByGroup(String groupName, int flags)
throws NameNotFoundException {
- try {
- final ParceledListSlice<PermissionInfo> parceledList =
- mPermissionManager.queryPermissionsByGroup(groupName, flags);
- if (parceledList != null) {
- final List<PermissionInfo> pi = parceledList.getList();
- if (pi != null) {
- return pi;
- }
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ final List<PermissionInfo> permissionInfos = getPermissionManager().queryPermissionsByGroup(
+ groupName, flags);
+ if (permissionInfos == null) {
+ throw new NameNotFoundException(groupName);
}
- throw new NameNotFoundException(groupName);
+ return permissionInfos;
}
@Override
@@ -724,11 +696,7 @@
@Override
public boolean isPermissionRevokedByPolicy(String permName, String pkgName) {
- try {
- return mPermissionManager.isPermissionRevokedByPolicy(permName, pkgName, getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().isPermissionRevokedByPolicy(pkgName, permName);
}
/**
@@ -750,50 +718,23 @@
@Override
public boolean addPermission(PermissionInfo info) {
- try {
- return mPermissionManager.addPermission(info, false);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().addPermission(info, false);
}
@Override
public boolean addPermissionAsync(PermissionInfo info) {
- try {
- return mPermissionManager.addPermission(info, true);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().addPermission(info, true);
}
@Override
public void removePermission(String name) {
- try {
- mPermissionManager.removePermission(name);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ getPermissionManager().removePermission(name);
}
@Override
public void grantRuntimePermission(String packageName, String permissionName,
UserHandle user) {
- if (DEBUG_TRACE_GRANTS
- && shouldTraceGrant(packageName, permissionName, user.getIdentifier())) {
- Log.i(TAG, "App " + mContext.getPackageName() + " is granting " + packageName + " "
- + permissionName + " for user " + user.getIdentifier(), new RuntimeException());
- }
- try {
- mPM.grantRuntimePermission(packageName, permissionName, user.getIdentifier());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public static boolean shouldTraceGrant(String packageName, String permissionName, int userId) {
- // To be modified when debugging
- return false;
+ getPermissionManager().grantRuntimePermission(packageName, permissionName, user);
}
@Override
@@ -804,124 +745,55 @@
@Override
public void revokeRuntimePermission(String packageName, String permName, UserHandle user,
String reason) {
- if (DEBUG_TRACE_PERMISSION_UPDATES
- && shouldTraceGrant(packageName, permName, user.getIdentifier())) {
- Log.i(TAG, "App " + mContext.getPackageName() + " is revoking " + packageName + " "
- + permName + " for user " + user.getIdentifier() + " with reason " + reason,
- new RuntimeException());
- }
- try {
- mPermissionManager
- .revokeRuntimePermission(packageName, permName, user.getIdentifier(), reason);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ getPermissionManager().revokeRuntimePermission(packageName, permName, user, reason);
}
@Override
public int getPermissionFlags(String permName, String packageName, UserHandle user) {
- try {
- return mPermissionManager
- .getPermissionFlags(permName, packageName, user.getIdentifier());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().getPermissionFlags(packageName, permName, user);
}
@Override
public void updatePermissionFlags(String permName, String packageName,
int flagMask, int flagValues, UserHandle user) {
- if (DEBUG_TRACE_PERMISSION_UPDATES
- && shouldTraceGrant(packageName, permName, user.getIdentifier())) {
- Log.i(TAG, "App " + mContext.getPackageName() + " is updating flags for "
- + packageName + " "
- + permName + " for user " + user.getIdentifier() + ": "
- + DebugUtils.flagsToString(PackageManager.class, "FLAG_PERMISSION_", flagMask)
- + " := " + DebugUtils.flagsToString(
- PackageManager.class, "FLAG_PERMISSION_", flagValues),
- new RuntimeException());
- }
- try {
- final boolean checkAdjustPolicyFlagPermission =
- mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q;
- mPermissionManager.updatePermissionFlags(permName, packageName, flagMask,
- flagValues, checkAdjustPolicyFlagPermission, user.getIdentifier());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ getPermissionManager().updatePermissionFlags(packageName, permName, flagMask, flagValues,
+ user);
}
@Override
public @NonNull Set<String> getWhitelistedRestrictedPermissions(
@NonNull String packageName, @PermissionWhitelistFlags int flags) {
- try {
- final int userId = getUserId();
- final List<String> whitelist = mPermissionManager
- .getWhitelistedRestrictedPermissions(packageName, flags, userId);
- if (whitelist != null) {
- return new ArraySet<>(whitelist);
- }
- return Collections.emptySet();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().getAllowlistedRestrictedPermissions(packageName, flags);
}
@Override
public boolean addWhitelistedRestrictedPermission(@NonNull String packageName,
@NonNull String permName, @PermissionWhitelistFlags int flags) {
- try {
- final int userId = getUserId();
- return mPermissionManager
- .addWhitelistedRestrictedPermission(packageName, permName, flags, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().addAllowlistedRestrictedPermission(packageName, permName,
+ flags);
}
@Override
- public boolean setAutoRevokeWhitelisted(
- @NonNull String packageName, boolean whitelisted) {
- try {
- final int userId = getUserId();
- return mPermissionManager.setAutoRevokeWhitelisted(packageName, whitelisted, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ public boolean setAutoRevokeWhitelisted(@NonNull String packageName, boolean whitelisted) {
+ return getPermissionManager().setAutoRevokeExempted(packageName, whitelisted);
}
@Override
public boolean isAutoRevokeWhitelisted(@NonNull String packageName) {
- try {
- final int userId = getUserId();
- return mPermissionManager.isAutoRevokeWhitelisted(packageName, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().isAutoRevokeExempted(packageName);
}
@Override
public boolean removeWhitelistedRestrictedPermission(@NonNull String packageName,
@NonNull String permName, @PermissionWhitelistFlags int flags) {
- try {
- final int userId = getUserId();
- return mPermissionManager
- .removeWhitelistedRestrictedPermission(packageName, permName, flags, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().removeAllowlistedRestrictedPermission(packageName, permName,
+ flags);
}
@Override
@UnsupportedAppUsage
public boolean shouldShowRequestPermissionRationale(String permName) {
- try {
- final String packageName = mContext.getPackageName();
- return mPermissionManager
- .shouldShowRequestPermissionRationale(permName, packageName, getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().shouldShowRequestPermissionRationale(permName);
}
@Override
@@ -1880,34 +1752,12 @@
@Override
public void addOnPermissionsChangeListener(OnPermissionsChangedListener listener) {
- synchronized (mPermissionListeners) {
- if (mPermissionListeners.get(listener) != null) {
- return;
- }
- OnPermissionsChangeListenerDelegate delegate =
- new OnPermissionsChangeListenerDelegate(listener, Looper.getMainLooper());
- try {
- mPermissionManager.addOnPermissionsChangeListener(delegate);
- mPermissionListeners.put(listener, delegate);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
+ getPermissionManager().addOnPermissionsChangeListener(listener);
}
@Override
public void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener) {
- synchronized (mPermissionListeners) {
- IOnPermissionsChangeListener delegate = mPermissionListeners.get(listener);
- if (delegate != null) {
- try {
- mPermissionManager.removeOnPermissionsChangeListener(delegate);
- mPermissionListeners.remove(listener);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
+ getPermissionManager().removeOnPermissionsChangeListener(listener);
}
@UnsupportedAppUsage
@@ -1918,11 +1768,9 @@
}
}
- protected ApplicationPackageManager(ContextImpl context, IPackageManager pm,
- IPermissionManager permissionManager) {
+ protected ApplicationPackageManager(ContextImpl context, IPackageManager pm) {
mContext = context;
mPM = pm;
- mPermissionManager = permissionManager;
}
/**
@@ -3234,7 +3082,6 @@
private final ContextImpl mContext;
@UnsupportedAppUsage
private final IPackageManager mPM;
- private final IPermissionManager mPermissionManager;
/** Assume locked until we hear otherwise */
private volatile boolean mUserUnlocked = false;
@@ -3245,41 +3092,6 @@
private static ArrayMap<ResourceName, WeakReference<CharSequence>> sStringCache
= new ArrayMap<ResourceName, WeakReference<CharSequence>>();
- private final Map<OnPermissionsChangedListener, IOnPermissionsChangeListener>
- mPermissionListeners = new ArrayMap<>();
-
- public class OnPermissionsChangeListenerDelegate extends IOnPermissionsChangeListener.Stub
- implements Handler.Callback{
- private static final int MSG_PERMISSIONS_CHANGED = 1;
-
- private final OnPermissionsChangedListener mListener;
- private final Handler mHandler;
-
-
- public OnPermissionsChangeListenerDelegate(OnPermissionsChangedListener listener,
- Looper looper) {
- mListener = listener;
- mHandler = new Handler(looper, this);
- }
-
- @Override
- public void onPermissionsChanged(int uid) {
- mHandler.obtainMessage(MSG_PERMISSIONS_CHANGED, uid, 0).sendToTarget();
- }
-
- @Override
- public boolean handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_PERMISSIONS_CHANGED: {
- final int uid = msg.arg1;
- mListener.onPermissionsChanged(uid);
- return true;
- }
- }
- return false;
- }
- }
-
@Override
public boolean canRequestPackageInstalls() {
try {
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 2fec9f7..124cf71 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -72,7 +72,6 @@
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
-import android.permission.IPermissionManager;
import android.permission.PermissionManager;
import android.system.ErrnoException;
import android.system.Os;
@@ -370,10 +369,9 @@
}
final IPackageManager pm = ActivityThread.getPackageManager();
- final IPermissionManager permissionManager = ActivityThread.getPermissionManager();
- if (pm != null && permissionManager != null) {
+ if (pm != null) {
// Doesn't matter if we make more than one instance.
- return (mPackageManager = new ApplicationPackageManager(this, pm, permissionManager));
+ return (mPackageManager = new ApplicationPackageManager(this, pm));
}
return null;
diff --git a/core/java/android/app/IActivityClientController.aidl b/core/java/android/app/IActivityClientController.aidl
index f9449f2..e1e0a8a 100644
--- a/core/java/android/app/IActivityClientController.aidl
+++ b/core/java/android/app/IActivityClientController.aidl
@@ -58,6 +58,8 @@
int getTaskForActivity(in IBinder token, in boolean onlyRoot);
ComponentName getCallingActivity(in IBinder token);
String getCallingPackage(in IBinder token);
+ int getLaunchedFromUid(in IBinder token);
+ String getLaunchedFromPackage(in IBinder token);
Bundle getActivityOptions(in IBinder token);
void setRequestedOrientation(in IBinder token, int requestedOrientation);
diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl
index 86625d3..c564d28 100644
--- a/core/java/android/app/IActivityManager.aidl
+++ b/core/java/android/app/IActivityManager.aidl
@@ -363,6 +363,7 @@
boolean killProcessesBelowForeground(in String reason);
@UnsupportedAppUsage
UserInfo getCurrentUser();
+ int getCurrentUserId();
// This is not public because you need to be very careful in how you
// manage your activity to make sure it is always the uid you expect.
@UnsupportedAppUsage
diff --git a/core/java/android/app/IActivityTaskManager.aidl b/core/java/android/app/IActivityTaskManager.aidl
index 4b25573..fabce45 100644
--- a/core/java/android/app/IActivityTaskManager.aidl
+++ b/core/java/android/app/IActivityTaskManager.aidl
@@ -159,8 +159,6 @@
int userId);
boolean isTopActivityImmersive();
ActivityManager.TaskDescription getTaskDescription(int taskId);
- int getLaunchedFromUid(in IBinder activityToken);
- String getLaunchedFromPackage(in IBinder activityToken);
void reportAssistContextExtras(in IBinder assistToken, in Bundle extras,
in AssistStructure structure, in AssistContent content, in Uri referrer);
@@ -257,8 +255,6 @@
* etc.
*/
void keyguardGoingAway(int flags);
- ComponentName getActivityClassForToken(in IBinder token);
- String getPackageForToken(in IBinder token);
void suppressResizeConfigChanges(boolean suppress);
boolean moveTopActivityToPinnedRootTask(int rootTaskId, in Rect bounds);
diff --git a/core/java/android/app/OWNERS b/core/java/android/app/OWNERS
new file mode 100644
index 0000000..06ad9c9
--- /dev/null
+++ b/core/java/android/app/OWNERS
@@ -0,0 +1,34 @@
+
+# Remain no owner because multiple modules may touch this file.
+per-file ContextImpl.java = *
+
+# ActivityThread
+per-file ActivityThread.java = file:/services/core/java/com/android/server/am/OWNERS
+per-file ActivityThread.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# Alarm
+per-file *Alarm* = file:/apex/jobscheduler/OWNERS
+
+# AppOps
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
+
+# Notification
+per-file *Notification* = file:/packages/SystemUI/OWNERS
+
+# ResourcesManager
+per-file ResourcesManager = rtmitchell@google.com, toddke@google.com
+
+# Wallpaper
+per-file *Wallpaper* = file:/core/java/android/service/wallpaper/OWNERS
+
+# WindowManager
+per-file *Activity* = file:/services/core/java/com/android/server/wm/OWNERS
+per-file ClientTransactionHandler.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Fragment.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file *Task* = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Window* = file:/services/core/java/com/android/server/wm/OWNERS
+
+# TODO(b/174932174): determine the ownership of KeyguardManager.java
+
+# Zygote
+per-file *Zygote* = file:/ZYGOTE_OWNERS
diff --git a/core/java/android/app/PictureInPictureParams.java b/core/java/android/app/PictureInPictureParams.java
index 29c9c67..ea7eab2 100644
--- a/core/java/android/app/PictureInPictureParams.java
+++ b/core/java/android/app/PictureInPictureParams.java
@@ -48,7 +48,9 @@
@Nullable
private Rect mSourceRectHint;
- private boolean mAutoEnterEnabled;
+ private Boolean mAutoEnterEnabled;
+
+ private Boolean mSeamlessResizeEnabled;
/**
* Sets the aspect ratio. This aspect ratio is defined as the desired width / height, and
@@ -113,7 +115,7 @@
*
* If true, {@link Activity#onPictureInPictureRequested()} will never be called.
*
- * This property is false by default.
+ * This property is {@code false} by default.
* @param autoEnterEnabled {@code true} if the system will automatically put the activity
* in picture-in-picture mode.
*
@@ -126,6 +128,23 @@
}
/**
+ * Sets whether the system can seamlessly resize the window while the activity is in
+ * picture-in-picture mode. This should normally be the case for video content and
+ * when it's set to {@code false}, system will perform transitions to overcome the
+ * artifacts due to resize.
+ *
+ * This property is {@code true} by default for backwards compatibility.
+ * @param seamlessResizeEnabled {@code true} if the system can seamlessly resize the window
+ * while activity is in picture-in-picture mode.
+ * @return this builder instance.
+ */
+ @NonNull
+ public Builder setSeamlessResizeEnabled(boolean seamlessResizeEnabled) {
+ mSeamlessResizeEnabled = seamlessResizeEnabled;
+ return this;
+ }
+
+ /**
* @return an immutable {@link PictureInPictureParams} to be used when entering or updating
* the activity in picture-in-picture.
*
@@ -134,7 +153,7 @@
*/
public PictureInPictureParams build() {
PictureInPictureParams params = new PictureInPictureParams(mAspectRatio, mUserActions,
- mSourceRectHint, mAutoEnterEnabled);
+ mSourceRectHint, mAutoEnterEnabled, mSeamlessResizeEnabled);
return params;
}
}
@@ -161,8 +180,16 @@
/**
* Whether the system is allowed to automatically put the activity in picture-in-picture mode.
+ * {@link #isAutoEnterEnabled()} defaults to {@code false} if this is not set.
*/
- private boolean mAutoEnterEnabled;
+ private Boolean mAutoEnterEnabled;
+
+ /**
+ * Whether system can seamlessly resize the window when activity is in picture-in-picture mode.
+ * {@link #isSeamlessResizeEnabled()} defaults to {@code true} if this is not set for
+ * backwards compatibility.
+ */
+ private Boolean mSeamlessResizeEnabled;
/** {@hide} */
PictureInPictureParams() {
@@ -183,15 +210,19 @@
if (in.readInt() != 0) {
mAutoEnterEnabled = in.readBoolean();
}
+ if (in.readInt() != 0) {
+ mSeamlessResizeEnabled = in.readBoolean();
+ }
}
/** {@hide} */
PictureInPictureParams(Rational aspectRatio, List<RemoteAction> actions,
- Rect sourceRectHint, boolean autoEnterEnabled) {
+ Rect sourceRectHint, Boolean autoEnterEnabled, Boolean seamlessResizeEnabled) {
mAspectRatio = aspectRatio;
mUserActions = actions;
mSourceRectHint = sourceRectHint;
mAutoEnterEnabled = autoEnterEnabled;
+ mSeamlessResizeEnabled = seamlessResizeEnabled;
}
/**
@@ -201,7 +232,7 @@
public PictureInPictureParams(PictureInPictureParams other) {
this(other.mAspectRatio, other.mUserActions,
other.hasSourceBoundsHint() ? new Rect(other.getSourceRectHint()) : null,
- other.mAutoEnterEnabled);
+ other.mAutoEnterEnabled, other.mSeamlessResizeEnabled);
}
/**
@@ -218,7 +249,12 @@
if (otherArgs.hasSourceBoundsHint()) {
mSourceRectHint = new Rect(otherArgs.getSourceRectHint());
}
- mAutoEnterEnabled = otherArgs.mAutoEnterEnabled;
+ if (otherArgs.mAutoEnterEnabled != null) {
+ mAutoEnterEnabled = otherArgs.mAutoEnterEnabled;
+ }
+ if (otherArgs.mSeamlessResizeEnabled != null) {
+ mSeamlessResizeEnabled = otherArgs.mSeamlessResizeEnabled;
+ }
}
/**
@@ -295,7 +331,16 @@
* @hide
*/
public boolean isAutoEnterEnabled() {
- return mAutoEnterEnabled;
+ return mAutoEnterEnabled == null ? false : mAutoEnterEnabled;
+ }
+
+ /**
+ * @return whether seamless resize is enabled.
+ * @hide
+ */
+ @TestApi
+ public boolean isSeamlessResizeEnabled() {
+ return mSeamlessResizeEnabled == null ? true : mSeamlessResizeEnabled;
}
/**
@@ -304,7 +349,7 @@
*/
public boolean empty() {
return !hasSourceBoundsHint() && !hasSetActions() && !hasSetAspectRatio()
- && !mAutoEnterEnabled;
+ && mAutoEnterEnabled != null && mSeamlessResizeEnabled != null;
}
@Override
@@ -312,7 +357,8 @@
if (this == o) return true;
if (!(o instanceof PictureInPictureParams)) return false;
PictureInPictureParams that = (PictureInPictureParams) o;
- return mAutoEnterEnabled == that.mAutoEnterEnabled
+ return Objects.equals(mAutoEnterEnabled, that.mAutoEnterEnabled)
+ && Objects.equals(mSeamlessResizeEnabled, that.mSeamlessResizeEnabled)
&& Objects.equals(mAspectRatio, that.mAspectRatio)
&& Objects.equals(mUserActions, that.mUserActions)
&& Objects.equals(mSourceRectHint, that.mSourceRectHint);
@@ -320,7 +366,8 @@
@Override
public int hashCode() {
- return Objects.hash(mAspectRatio, mUserActions, mSourceRectHint, mAutoEnterEnabled);
+ return Objects.hash(mAspectRatio, mUserActions, mSourceRectHint,
+ mAutoEnterEnabled, mSeamlessResizeEnabled);
}
@Override
@@ -349,8 +396,18 @@
} else {
out.writeInt(0);
}
- out.writeInt(1);
- out.writeBoolean(mAutoEnterEnabled);
+ if (mAutoEnterEnabled != null) {
+ out.writeInt(1);
+ out.writeBoolean(mAutoEnterEnabled);
+ } else {
+ out.writeInt(0);
+ }
+ if (mSeamlessResizeEnabled != null) {
+ out.writeInt(1);
+ out.writeBoolean(mSeamlessResizeEnabled);
+ } else {
+ out.writeInt(0);
+ }
}
@Override
@@ -360,6 +417,7 @@
+ " sourceRectHint=" + getSourceRectHint()
+ " hasSetActions=" + hasSetActions()
+ " isAutoPipEnabled=" + isAutoEnterEnabled()
+ + " isSeamlessResizeEnabled=" + isSeamlessResizeEnabled()
+ ")";
}
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 392d6fb..a6bf4ddd 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -63,7 +63,6 @@
import android.content.pm.DataLoaderManager;
import android.content.pm.ICrossProfileApps;
import android.content.pm.IDataLoaderManager;
-import android.content.pm.IPackageManager;
import android.content.pm.IShortcutService;
import android.content.pm.LauncherApps;
import android.content.pm.PackageManager;
@@ -176,6 +175,7 @@
import android.os.incremental.IIncrementalService;
import android.os.incremental.IncrementalManager;
import android.os.storage.StorageManager;
+import android.permission.LegacyPermissionManager;
import android.permission.PermissionControllerManager;
import android.permission.PermissionManager;
import android.print.IPrintManager;
@@ -1264,8 +1264,15 @@
@Override
public PermissionManager createService(ContextImpl ctx)
throws ServiceNotFoundException {
- IPackageManager packageManager = AppGlobals.getPackageManager();
- return new PermissionManager(ctx.getOuterContext(), packageManager);
+ return new PermissionManager(ctx.getOuterContext());
+ }});
+
+ registerService(Context.LEGACY_PERMISSION_SERVICE, LegacyPermissionManager.class,
+ new CachedServiceFetcher<LegacyPermissionManager>() {
+ @Override
+ public LegacyPermissionManager createService(ContextImpl ctx)
+ throws ServiceNotFoundException {
+ return new LegacyPermissionManager();
}});
registerService(Context.PERMISSION_CONTROLLER_SERVICE, PermissionControllerManager.class,
diff --git a/core/java/android/app/TaskInfo.java b/core/java/android/app/TaskInfo.java
index 8367bde..2da5e00 100644
--- a/core/java/android/app/TaskInfo.java
+++ b/core/java/android/app/TaskInfo.java
@@ -27,7 +27,6 @@
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Point;
-import android.graphics.Rect;
import android.os.Build;
import android.os.IBinder;
import android.os.Parcel;
@@ -187,14 +186,6 @@
public boolean isResizeable;
/**
- * Activity bounds if this task or its top activity is presented in letterbox mode and
- * {@code null} otherwise.
- * @hide
- */
- @Nullable
- public Rect letterboxActivityBounds;
-
- /**
* Relative position of the task's top left corner in the parent container.
* @hide
*/
@@ -215,12 +206,6 @@
public int parentTaskId;
/**
- * Parent bounds.
- * @hide
- */
- public Rect parentBounds;
-
- /**
* Whether this task is focused.
* @hide
*/
@@ -312,7 +297,6 @@
return topActivityType == that.topActivityType
&& isResizeable == that.isResizeable
&& Objects.equals(positionInParent, that.positionInParent)
- && equalsLetterboxParams(that)
&& Objects.equals(pictureInPictureParams, that.pictureInPictureParams)
&& getWindowingMode() == that.getWindowingMode()
&& Objects.equals(taskDescription, that.taskDescription)
@@ -320,17 +304,6 @@
&& isVisible == that.isVisible;
}
- private boolean equalsLetterboxParams(TaskInfo that) {
- return Objects.equals(letterboxActivityBounds, that.letterboxActivityBounds)
- && Objects.equals(
- getConfiguration().windowConfiguration.getBounds(),
- that.getConfiguration().windowConfiguration.getBounds())
- && Objects.equals(
- getConfiguration().windowConfiguration.getMaxBounds(),
- that.getConfiguration().windowConfiguration.getMaxBounds())
- && Objects.equals(parentBounds, that.parentBounds);
- }
-
/**
* Reads the TaskInfo from a parcel.
*/
@@ -359,10 +332,8 @@
topActivityInfo = source.readTypedObject(ActivityInfo.CREATOR);
isResizeable = source.readBoolean();
source.readBinderList(launchCookies);
- letterboxActivityBounds = source.readTypedObject(Rect.CREATOR);
positionInParent = source.readTypedObject(Point.CREATOR);
parentTaskId = source.readInt();
- parentBounds = source.readTypedObject(Rect.CREATOR);
isFocused = source.readBoolean();
isVisible = source.readBoolean();
}
@@ -396,10 +367,8 @@
dest.writeTypedObject(topActivityInfo, flags);
dest.writeBoolean(isResizeable);
dest.writeBinderList(launchCookies);
- dest.writeTypedObject(letterboxActivityBounds, flags);
dest.writeTypedObject(positionInParent, flags);
dest.writeInt(parentTaskId);
- dest.writeTypedObject(parentBounds, flags);
dest.writeBoolean(isFocused);
dest.writeBoolean(isVisible);
}
@@ -422,10 +391,8 @@
+ " pictureInPictureParams=" + pictureInPictureParams
+ " topActivityInfo=" + topActivityInfo
+ " launchCookies=" + launchCookies
- + " letterboxActivityBounds=" + letterboxActivityBounds
+ " positionInParent=" + positionInParent
+ " parentTaskId=" + parentTaskId
- + " parentBounds=" + parentBounds
+ " isFocused=" + isFocused
+ " isVisible=" + isVisible
+ "}";
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 4095acc..94084b85 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -2610,6 +2610,9 @@
/** @hide */
@TestApi
public static final int OPERATION_REMOVE_USER = 6;
+ /** @hide */
+ @TestApi
+ public static final int OPERATION_REBOOT = 7;
private static final String PREFIX_OPERATION = "OPERATION_";
@@ -2620,7 +2623,8 @@
OPERATION_START_USER_IN_BACKGROUND,
OPERATION_STOP_USER,
OPERATION_CREATE_AND_MANAGE_USER,
- OPERATION_REMOVE_USER
+ OPERATION_REMOVE_USER,
+ OPERATION_REBOOT
})
@Retention(RetentionPolicy.SOURCE)
public static @interface DevicePolicyOperation {
@@ -2915,22 +2919,36 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
- * profile.
+ * profile. Apps targeting {@link android.os.Build.VERSION_CODES#S} and above will get a
+ * {@code IllegalArgumentException} when calling this method on the parent
+ * {@link DevicePolicyManager} instance.
*
* <p><strong>Note:</strong> Specifying password requirements using this method clears the
* password complexity requirements set using {@link #setRequiredPasswordComplexity(int)}.
*
+ * @deprecated Prefer using {@link #setRequiredPasswordComplexity(int)}, to require a password
+ * that satisfies a complexity level defined by the platform, rather than specifying custom
+ * password requirement.
+ * Setting custom, overly-complicated password requirements leads to passwords that are hard
+ * for users to remember and may not provide any security benefits given as Android uses
+ * hardware-backed throttling to thwart online and offline brute-forcing of the device's
+ * screen lock.
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param quality The new desired quality. One of {@link #PASSWORD_QUALITY_UNSPECIFIED},
* {@link #PASSWORD_QUALITY_BIOMETRIC_WEAK},
* {@link #PASSWORD_QUALITY_SOMETHING}, {@link #PASSWORD_QUALITY_NUMERIC},
* {@link #PASSWORD_QUALITY_NUMERIC_COMPLEX}, {@link #PASSWORD_QUALITY_ALPHABETIC},
* {@link #PASSWORD_QUALITY_ALPHANUMERIC} or {@link #PASSWORD_QUALITY_COMPLEX}.
- * @throws SecurityException if {@code admin} is not an active administrator or if {@code admin}
- * does not use {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD}
+ * @throws SecurityException if {@code admin} is not an active administrator, if {@code admin}
+ * does not use {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} or if the
+ * calling app is targeting {@link android.os.Build.VERSION_CODES#S} and above,
+ * and is calling the method the {@link DevicePolicyManager} instance returned by
+ * {@link #getParentProfileInstance(ComponentName)}.
*/
+ @Deprecated
public void setPasswordQuality(@NonNull ComponentName admin, int quality) {
if (mService != null) {
try {
@@ -2953,9 +2971,12 @@
* <p>Note: on devices not supporting {@link PackageManager#FEATURE_SECURE_LOCK_SCREEN} feature,
* the password is always treated as empty.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to aggregate
* all admins.
*/
+ @Deprecated
public int getPasswordQuality(@Nullable ComponentName admin) {
return getPasswordQuality(admin, myUserId());
}
@@ -2995,10 +3016,14 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum password length. A value of 0 means there is no
* restriction.
@@ -3008,6 +3033,7 @@
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumLength(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3030,9 +3056,12 @@
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to aggregate
* all admins.
*/
+ @Deprecated
public int getPasswordMinimumLength(@Nullable ComponentName admin) {
return getPasswordMinimumLength(admin, myUserId());
}
@@ -3070,10 +3099,14 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of upper case letters required in the password.
* A value of 0 means there is no restriction.
@@ -3083,6 +3116,7 @@
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumUpperCase(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3110,11 +3144,14 @@
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of upper case letters required in the
* password.
*/
+ @Deprecated
public int getPasswordMinimumUpperCase(@Nullable ComponentName admin) {
return getPasswordMinimumUpperCase(admin, myUserId());
}
@@ -3152,10 +3189,14 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of lower case letters required in the password.
* A value of 0 means there is no restriction.
@@ -3165,6 +3206,7 @@
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumLowerCase(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3192,11 +3234,14 @@
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of lower case letters required in the
* password.
*/
+ @Deprecated
public int getPasswordMinimumLowerCase(@Nullable ComponentName admin) {
return getPasswordMinimumLowerCase(admin, myUserId());
}
@@ -3234,10 +3279,14 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of letters required in the password. A value of
* 0 means there is no restriction.
@@ -3247,6 +3296,7 @@
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumLetters(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3274,10 +3324,13 @@
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of letters required in the password.
*/
+ @Deprecated
public int getPasswordMinimumLetters(@Nullable ComponentName admin) {
return getPasswordMinimumLetters(admin, myUserId());
}
@@ -3315,10 +3368,14 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of numerical digits required in the password. A
* value of 0 means there is no restriction.
@@ -3328,6 +3385,7 @@
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumNumeric(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3355,10 +3413,13 @@
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of numerical digits required in the password.
*/
+ @Deprecated
public int getPasswordMinimumNumeric(@Nullable ComponentName admin) {
return getPasswordMinimumNumeric(admin, myUserId());
}
@@ -3396,10 +3457,14 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of symbols required in the password. A value of
* 0 means there is no restriction.
@@ -3409,6 +3474,7 @@
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumSymbols(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3435,10 +3501,13 @@
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of symbols required in the password.
*/
+ @Deprecated
public int getPasswordMinimumSymbols(@Nullable ComponentName admin) {
return getPasswordMinimumSymbols(admin, myUserId());
}
@@ -3476,10 +3545,14 @@
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of letters required in the password. A value of
* 0 means there is no restriction.
@@ -3489,6 +3562,7 @@
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumNonLetter(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3516,10 +3590,13 @@
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of letters required in the password.
*/
+ @Deprecated
public int getPasswordMinimumNonLetter(@Nullable ComponentName admin) {
return getPasswordMinimumNonLetter(admin, myUserId());
}
@@ -5758,7 +5835,6 @@
return null;
}
-
/**
* Called by a device or profile owner, or delegated certificate chooser (an app that has been
* delegated the {@link #DELEGATION_CERT_SELECTION} privilege), to grant an application access
@@ -5796,6 +5872,51 @@
/**
* Called by a device or profile owner, or delegated certificate chooser (an app that has been
+ * delegated the {@link #DELEGATION_CERT_SELECTION} privilege), to query which apps have access
+ * to a given KeyChain key.
+ *
+ * Key are granted on a per-UID basis, so if several apps share the same UID, granting access to
+ * one of them automatically grants it to others. This method returns a set of sets of package
+ * names, where each internal set contains all packages sharing the same UID. Grantee packages
+ * that don't share UID with other packages are represented by singleton sets.
+ *
+ * @param alias The alias of the key to grant access to.
+ * @return package names of apps that have access to a given key, grouped by UIDs
+ *
+ * @throws SecurityException if the caller is not a device owner, a profile owner or
+ * delegated certificate chooser.
+ * @throws IllegalArgumentException if {@code alias} doesn't correspond to an existing key.
+ *
+ * @see #grantKeyPairToApp(ComponentName, String, String)
+ */
+ public @NonNull Set<Set<String>> getKeyPairGrants(@NonNull String alias) {
+ throwIfParentInstance("getKeyPairGrants");
+ try {
+ // Set of sets is flattened into a null-separated list.
+ final List<String> flattened =
+ mService.getKeyPairGrants(mContext.getPackageName(), alias);
+ final Set<Set<String>> result = new HashSet<>();
+ Set<String> pkgsForOneUid = new HashSet<>();
+ for (final String pkg : flattened) {
+ if (pkg == null) {
+ result.add(pkgsForOneUid);
+ pkgsForOneUid = new HashSet<>();
+ } else {
+ pkgsForOneUid.add(pkg);
+ }
+ }
+ if (!pkgsForOneUid.isEmpty()) {
+ result.add(pkgsForOneUid);
+ }
+ return result;
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ return null;
+ }
+
+ /**
+ * Called by a device or profile owner, or delegated certificate chooser (an app that has been
* delegated the {@link #DELEGATION_CERT_SELECTION} privilege), to revoke an application's
* grant to a KeyChain key pair.
* Calls by the application to {@link android.security.KeyChain#getPrivateKey}
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index e21fee2..bcc90f7 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -471,6 +471,7 @@
boolean startViewCalendarEventInManagedProfile(String packageName, long eventId, long start, long end, boolean allDay, int flags);
boolean setKeyGrantForApp(in ComponentName admin, String callerPackage, String alias, String packageName, boolean hasGrant);
+ List<String> getKeyPairGrants(in String callerPackage, in String alias);
void setUserControlDisabledPackages(in ComponentName admin, in List<String> packages);
diff --git a/core/java/android/app/admin/OWNERS b/core/java/android/app/admin/OWNERS
new file mode 100644
index 0000000..8462cbe
--- /dev/null
+++ b/core/java/android/app/admin/OWNERS
@@ -0,0 +1,11 @@
+# Bug component: 142675
+
+# Android Enterprise team
+rubinxu@google.com
+sandness@google.com
+eranm@google.com
+alexkershaw@google.com
+pgrafov@google.com
+
+# Emeritus
+yamasani@google.com
diff --git a/core/java/android/app/assist/OWNERS b/core/java/android/app/assist/OWNERS
new file mode 100644
index 0000000..46b5ea0
--- /dev/null
+++ b/core/java/android/app/assist/OWNERS
@@ -0,0 +1,7 @@
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/app/contentsuggestions/OWNERS b/core/java/android/app/contentsuggestions/OWNERS
new file mode 100644
index 0000000..482abb2
--- /dev/null
+++ b/core/java/android/app/contentsuggestions/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 643919
+
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/app/prediction/OWNERS b/core/java/android/app/prediction/OWNERS
new file mode 100644
index 0000000..fe012da
--- /dev/null
+++ b/core/java/android/app/prediction/OWNERS
@@ -0,0 +1,2 @@
+adamcohen@google.com
+sunnygoyal@google.com
diff --git a/core/java/android/app/role/OWNERS b/core/java/android/app/role/OWNERS
index b94d988..b8076366 100644
--- a/core/java/android/app/role/OWNERS
+++ b/core/java/android/app/role/OWNERS
@@ -1,6 +1,4 @@
-svetoslavganov@google.com
-moltmann@google.com
+# Bug component: 137825
+
zhanghai@google.com
-evanseverson@google.com
-eugenesusla@google.com
-ntmyren@google.com
+moltmann@google.com
diff --git a/core/java/android/app/servertransaction/LaunchActivityItem.java b/core/java/android/app/servertransaction/LaunchActivityItem.java
index 7f08bfb..3758cb4 100644
--- a/core/java/android/app/servertransaction/LaunchActivityItem.java
+++ b/core/java/android/app/servertransaction/LaunchActivityItem.java
@@ -20,8 +20,10 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.ActivityClient;
import android.app.ActivityThread.ActivityClientRecord;
import android.app.ClientTransactionHandler;
+import android.app.IActivityClientController;
import android.app.ProfilerInfo;
import android.app.ResultInfo;
import android.compat.annotation.UnsupportedAppUsage;
@@ -67,6 +69,11 @@
private boolean mIsForward;
private ProfilerInfo mProfilerInfo;
private IBinder mAssistToken;
+ /**
+ * It is only non-null if the process is the first time to launch activity. It is only an
+ * optimization for quick look up of the interface so the field is ignored for comparison.
+ */
+ private IActivityClientController mActivityClientController;
private FixedRotationAdjustments mFixedRotationAdjustments;
@Override
@@ -74,6 +81,9 @@
client.countLaunchingActivities(1);
client.updateProcessState(mProcState, false);
client.updatePendingConfiguration(mCurConfig);
+ if (mActivityClientController != null) {
+ ActivityClient.setActivityClientController(mActivityClientController);
+ }
}
@Override
@@ -105,14 +115,16 @@
String referrer, IVoiceInteractor voiceInteractor, int procState, Bundle state,
PersistableBundle persistentState, List<ResultInfo> pendingResults,
List<ReferrerIntent> pendingNewIntents, boolean isForward, ProfilerInfo profilerInfo,
- IBinder assistToken, FixedRotationAdjustments fixedRotationAdjustments) {
+ IBinder assistToken, IActivityClientController activityClientController,
+ FixedRotationAdjustments fixedRotationAdjustments) {
LaunchActivityItem instance = ObjectPool.obtain(LaunchActivityItem.class);
if (instance == null) {
instance = new LaunchActivityItem();
}
setValues(instance, intent, ident, info, curConfig, overrideConfig, compatInfo, referrer,
voiceInteractor, procState, state, persistentState, pendingResults,
- pendingNewIntents, isForward, profilerInfo, assistToken, fixedRotationAdjustments);
+ pendingNewIntents, isForward, profilerInfo, assistToken, activityClientController,
+ fixedRotationAdjustments);
return instance;
}
@@ -120,7 +132,7 @@
@Override
public void recycle() {
setValues(this, null, 0, null, null, null, null, null, null, 0, null, null, null, null,
- false, null, null, null);
+ false, null, null, null, null);
ObjectPool.recycle(this);
}
@@ -146,6 +158,7 @@
dest.writeBoolean(mIsForward);
dest.writeTypedObject(mProfilerInfo, flags);
dest.writeStrongBinder(mAssistToken);
+ dest.writeStrongInterface(mActivityClientController);
dest.writeTypedObject(mFixedRotationAdjustments, flags);
}
@@ -162,6 +175,7 @@
in.createTypedArrayList(ReferrerIntent.CREATOR), in.readBoolean(),
in.readTypedObject(ProfilerInfo.CREATOR),
in.readStrongBinder(),
+ IActivityClientController.Stub.asInterface(in.readStrongBinder()),
in.readTypedObject(FixedRotationAdjustments.CREATOR));
}
@@ -266,6 +280,7 @@
int procState, Bundle state, PersistableBundle persistentState,
List<ResultInfo> pendingResults, List<ReferrerIntent> pendingNewIntents,
boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken,
+ IActivityClientController activityClientController,
FixedRotationAdjustments fixedRotationAdjustments) {
instance.mIntent = intent;
instance.mIdent = ident;
@@ -283,6 +298,7 @@
instance.mIsForward = isForward;
instance.mProfilerInfo = profilerInfo;
instance.mAssistToken = assistToken;
+ instance.mActivityClientController = activityClientController;
instance.mFixedRotationAdjustments = fixedRotationAdjustments;
}
}
diff --git a/core/java/android/app/servertransaction/OWNERS b/core/java/android/app/servertransaction/OWNERS
new file mode 100644
index 0000000..aa6248e
--- /dev/null
+++ b/core/java/android/app/servertransaction/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 316125
+
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/core/java/android/app/slice/OWNERS b/core/java/android/app/slice/OWNERS
new file mode 100644
index 0000000..b0a44fb
--- /dev/null
+++ b/core/java/android/app/slice/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 342804
+
+sunnygoyal@google.com
+dsandler@android.com
+dsandler@google.com
+adamcohen@google.com
diff --git a/core/java/android/app/time/OWNERS b/core/java/android/app/time/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/java/android/app/time/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/app/timedetector/GnssTimeSuggestion.aidl b/core/java/android/app/timedetector/GnssTimeSuggestion.aidl
new file mode 100644
index 0000000..81475ec
--- /dev/null
+++ b/core/java/android/app/timedetector/GnssTimeSuggestion.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2020 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.app.timedetector;
+
+parcelable GnssTimeSuggestion;
diff --git a/core/java/android/app/timedetector/GnssTimeSuggestion.java b/core/java/android/app/timedetector/GnssTimeSuggestion.java
new file mode 100644
index 0000000..6478a2d
--- /dev/null
+++ b/core/java/android/app/timedetector/GnssTimeSuggestion.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2020 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.app.timedetector;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.os.TimestampedValue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * A time signal from a GNSS source.
+ *
+ * <p>{@code utcTime} is the suggested time. The {@code utcTime.value} is the number of milliseconds
+ * elapsed since 1/1/1970 00:00:00 UTC. The {@code utcTime.referenceTimeMillis} is the value of the
+ * elapsed realtime clock when the {@code utcTime.value} was established.
+ * Note that the elapsed realtime clock is considered accurate but it is volatile, so time
+ * suggestions cannot be persisted across device resets.
+ *
+ * <p>{@code debugInfo} contains debugging metadata associated with the suggestion. This is used to
+ * record why the suggestion exists and how it was entered. This information exists only to aid in
+ * debugging and therefore is used by {@link #toString()}, but it is not for use in detection
+ * logic and is not considered in {@link #hashCode()} or {@link #equals(Object)}.
+ *
+ * @hide
+ */
+public final class GnssTimeSuggestion implements Parcelable {
+
+ public static final @NonNull Creator<GnssTimeSuggestion> CREATOR =
+ new Creator<GnssTimeSuggestion>() {
+ public GnssTimeSuggestion createFromParcel(Parcel in) {
+ return GnssTimeSuggestion.createFromParcel(in);
+ }
+
+ public GnssTimeSuggestion[] newArray(int size) {
+ return new GnssTimeSuggestion[size];
+ }
+ };
+
+ @NonNull private final TimestampedValue<Long> mUtcTime;
+ @Nullable private ArrayList<String> mDebugInfo;
+
+ public GnssTimeSuggestion(@NonNull TimestampedValue<Long> utcTime) {
+ mUtcTime = Objects.requireNonNull(utcTime);
+ Objects.requireNonNull(utcTime.getValue());
+ }
+
+ private static GnssTimeSuggestion createFromParcel(Parcel in) {
+ TimestampedValue<Long> utcTime = in.readParcelable(null /* classLoader */);
+ GnssTimeSuggestion suggestion = new GnssTimeSuggestion(utcTime);
+ @SuppressWarnings("unchecked")
+ ArrayList<String> debugInfo = (ArrayList<String>) in.readArrayList(null /* classLoader */);
+ suggestion.mDebugInfo = debugInfo;
+ return suggestion;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
+ dest.writeParcelable(mUtcTime, 0);
+ dest.writeList(mDebugInfo);
+ }
+
+ @NonNull
+ public TimestampedValue<Long> getUtcTime() {
+ return mUtcTime;
+ }
+
+ @NonNull
+ public List<String> getDebugInfo() {
+ return mDebugInfo == null
+ ? Collections.emptyList() : Collections.unmodifiableList(mDebugInfo);
+ }
+
+ /**
+ * Associates information with the instance that can be useful for debugging / logging. The
+ * information is present in {@link #toString()} but is not considered for
+ * {@link #equals(Object)} and {@link #hashCode()}.
+ */
+ public void addDebugInfo(String... debugInfos) {
+ if (mDebugInfo == null) {
+ mDebugInfo = new ArrayList<>();
+ }
+ mDebugInfo.addAll(Arrays.asList(debugInfos));
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GnssTimeSuggestion that = (GnssTimeSuggestion) o;
+ return Objects.equals(mUtcTime, that.mUtcTime);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mUtcTime);
+ }
+
+ @Override
+ public String toString() {
+ return "GnssTimeSuggestion{"
+ + "mUtcTime=" + mUtcTime
+ + ", mDebugInfo=" + mDebugInfo
+ + '}';
+ }
+}
diff --git a/core/java/android/app/timedetector/ITimeDetectorService.aidl b/core/java/android/app/timedetector/ITimeDetectorService.aidl
index 7bea5d7..87e7233 100644
--- a/core/java/android/app/timedetector/ITimeDetectorService.aidl
+++ b/core/java/android/app/timedetector/ITimeDetectorService.aidl
@@ -16,6 +16,7 @@
package android.app.timedetector;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -34,6 +35,7 @@
* {@hide}
*/
interface ITimeDetectorService {
+ void suggestGnssTime(in GnssTimeSuggestion timeSuggestion);
boolean suggestManualTime(in ManualTimeSuggestion timeSuggestion);
void suggestNetworkTime(in NetworkTimeSuggestion timeSuggestion);
void suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion);
diff --git a/core/java/android/app/timedetector/OWNERS b/core/java/android/app/timedetector/OWNERS
new file mode 100644
index 0000000..941eed8
--- /dev/null
+++ b/core/java/android/app/timedetector/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 847766
+mingaleev@google.com
+narayan@google.com
+nfuller@google.com
diff --git a/core/java/android/app/timedetector/TimeDetector.java b/core/java/android/app/timedetector/TimeDetector.java
index 162e182..52016b6 100644
--- a/core/java/android/app/timedetector/TimeDetector.java
+++ b/core/java/android/app/timedetector/TimeDetector.java
@@ -71,4 +71,12 @@
*/
@RequiresPermission(android.Manifest.permission.SET_TIME)
void suggestNetworkTime(NetworkTimeSuggestion timeSuggestion);
+
+ /**
+ * Suggests the time according to a gnss time source.
+ *
+ * @hide
+ */
+ @RequiresPermission(android.Manifest.permission.SET_TIME)
+ void suggestGnssTime(GnssTimeSuggestion timeSuggestion);
}
diff --git a/core/java/android/app/timedetector/TimeDetectorImpl.java b/core/java/android/app/timedetector/TimeDetectorImpl.java
index ac02c89..b0aa3c8 100644
--- a/core/java/android/app/timedetector/TimeDetectorImpl.java
+++ b/core/java/android/app/timedetector/TimeDetectorImpl.java
@@ -74,4 +74,16 @@
throw e.rethrowFromSystemServer();
}
}
+
+ @Override
+ public void suggestGnssTime(GnssTimeSuggestion timeSuggestion) {
+ if (DEBUG) {
+ Log.d(TAG, "suggestGnssTime called: " + timeSuggestion);
+ }
+ try {
+ mITimeDetectorService.suggestGnssTime(timeSuggestion);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
diff --git a/core/java/android/app/timezone/OWNERS b/core/java/android/app/timezone/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/java/android/app/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/app/timezonedetector/OWNERS b/core/java/android/app/timezonedetector/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/java/android/app/timezonedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/app/usage/OWNERS b/core/java/android/app/usage/OWNERS
new file mode 100644
index 0000000..a33d0ad
--- /dev/null
+++ b/core/java/android/app/usage/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 532296
+
+yamasani@google.com
+mwachens@google.com
+varunshah@google.com
diff --git a/core/java/android/attention/OWNERS b/core/java/android/attention/OWNERS
new file mode 100644
index 0000000..dd579b6
--- /dev/null
+++ b/core/java/android/attention/OWNERS
@@ -0,0 +1 @@
+asalo@google.com
diff --git a/core/java/android/bluetooth/OWNERS b/core/java/android/bluetooth/OWNERS
new file mode 100644
index 0000000..3523ee0
--- /dev/null
+++ b/core/java/android/bluetooth/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 27441
+
+zachoverflow@google.com
+siyuanh@google.com
diff --git a/core/java/android/bluetooth/le/OWNERS b/core/java/android/bluetooth/le/OWNERS
new file mode 100644
index 0000000..3523ee0
--- /dev/null
+++ b/core/java/android/bluetooth/le/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 27441
+
+zachoverflow@google.com
+siyuanh@google.com
diff --git a/core/java/android/companion/CompanionDeviceManager.java b/core/java/android/companion/CompanionDeviceManager.java
index c3c270e..59646f10 100644
--- a/core/java/android/companion/CompanionDeviceManager.java
+++ b/core/java/android/companion/CompanionDeviceManager.java
@@ -34,6 +34,7 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
+import android.util.ExceptionUtils;
import android.util.Log;
import java.util.Collections;
@@ -321,6 +322,77 @@
}
}
+ /**
+ * Register to receive callbacks whenever the associated device comes in and out of range.
+ *
+ * The provided device must be {@link #associate associated} with the calling app before
+ * calling this method.
+ *
+ * Caller must implement a single {@link CompanionDeviceService} which will be bound to and
+ * receive callbacks to {@link CompanionDeviceService#onDeviceAppeared} and
+ * {@link CompanionDeviceService#onDeviceDisappeared}.
+ * The app doesn't need to remain running in order to receive its callbacks.
+ *
+ * Calling app must declare uses-permission
+ * {@link android.Manifest.permission#REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE}.
+ *
+ * Calling app must check for feature presence of
+ * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} before calling this API.
+ *
+ * @param deviceAddress a previously-associated companion device's address
+ *
+ * @throws DeviceNotAssociatedException if the given device was not previously associated
+ * with this app.
+ */
+ @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE)
+ public void startObservingDevicePresence(@NonNull String deviceAddress)
+ throws DeviceNotAssociatedException {
+ if (!checkFeaturePresent()) {
+ return;
+ }
+ Objects.requireNonNull(deviceAddress, "address cannot be null");
+ try {
+ mService.registerDevicePresenceListenerService(
+ mContext.getPackageName(), deviceAddress);
+ } catch (RemoteException e) {
+ ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class);
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Unregister for receiving callbacks whenever the associated device comes in and out of range.
+ *
+ * The provided device must be {@link #associate associated} with the calling app before
+ * calling this method.
+ *
+ * Calling app must declare uses-permission
+ * {@link android.Manifest.permission#REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE}.
+ *
+ * Calling app must check for feature presence of
+ * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} before calling this API.
+ *
+ * @param deviceAddress a previously-associated companion device's address
+ *
+ * @throws DeviceNotAssociatedException if the given device was not previously associated
+ * with this app.
+ */
+ @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE)
+ public void stopObservingDevicePresence(@NonNull String deviceAddress)
+ throws DeviceNotAssociatedException {
+ if (!checkFeaturePresent()) {
+ return;
+ }
+ Objects.requireNonNull(deviceAddress, "address cannot be null");
+ try {
+ mService.unregisterDevicePresenceListenerService(
+ mContext.getPackageName(), deviceAddress);
+ } catch (RemoteException e) {
+ ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class);
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
private boolean checkFeaturePresent() {
boolean featurePresent = mService != null;
if (!featurePresent && DEBUG) {
diff --git a/core/java/android/companion/DeviceNotAssociatedException.java b/core/java/android/companion/DeviceNotAssociatedException.java
new file mode 100644
index 0000000..bebb6c9
--- /dev/null
+++ b/core/java/android/companion/DeviceNotAssociatedException.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020 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.companion;
+
+import android.annotation.Nullable;
+
+/**
+ * An exception for a case when a given device was not
+ * {@link CompanionDeviceManager#associate associated} to the calling app.
+ */
+public class DeviceNotAssociatedException extends Exception {
+ /** @hide */
+ public DeviceNotAssociatedException(@Nullable String deviceName) {
+ super("Device not associated with the current app: " + deviceName);
+ }
+}
diff --git a/core/java/android/companion/ICompanionDeviceManager.aidl b/core/java/android/companion/ICompanionDeviceManager.aidl
index bcb9be8..527d8df 100644
--- a/core/java/android/companion/ICompanionDeviceManager.aidl
+++ b/core/java/android/companion/ICompanionDeviceManager.aidl
@@ -45,4 +45,8 @@
boolean isDeviceAssociatedForWifiConnection(in String packageName, in String macAddress,
int userId);
+
+ void registerDevicePresenceListenerService(in String packageName, in String deviceAddress);
+
+ void unregisterDevicePresenceListenerService(in String packageName, in String deviceAddress);
}
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index d920fb3..f3e1a87 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4564,6 +4564,15 @@
public static final String PERMISSION_SERVICE = "permission";
/**
+ * Official published name of the legacy (internal) permission service.
+ *
+ * @see #getSystemService(String)
+ * @hide
+ */
+ //@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public static final String LEGACY_PERMISSION_SERVICE = "legacy_permission";
+
+ /**
* Official published name of the (internal) permission controller service.
*
* @see #getSystemService(String)
diff --git a/core/java/android/content/OWNERS b/core/java/android/content/OWNERS
new file mode 100644
index 0000000..c1e7e41
--- /dev/null
+++ b/core/java/android/content/OWNERS
@@ -0,0 +1,3 @@
+# Remain no owner because multiple modules may touch this file.
+per-file Context.java = *
+per-file ContextWrapper.java = *
diff --git a/core/java/android/content/om/OWNERS b/core/java/android/content/om/OWNERS
new file mode 100644
index 0000000..91a0abf
--- /dev/null
+++ b/core/java/android/content/om/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 568631
+
+toddke@android.com
+toddke@google.com
+patb@google.com
+rtmitchell@google.com
diff --git a/core/java/android/content/pm/OWNERS b/core/java/android/content/pm/OWNERS
index a16bb4f..24872e8 100644
--- a/core/java/android/content/pm/OWNERS
+++ b/core/java/android/content/pm/OWNERS
@@ -1 +1,8 @@
+# Bug component: 36137
+
+toddke@android.com
+toddke@google.com
+patb@google.com
+
per-file PackageParser.java = chiuwinson@google.com
+per-file *Shortcut* = omakoto@google.com, yamasani@google.com, sunnygoyal@google.com, mett@google.com, pinyaoting@google.com
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index cf3f706..bd27099 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -2682,6 +2682,23 @@
/**
* Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature(String, int)}: If this feature is supported, the feature version
+ * specifies a date such that the device is known to pass the OpenGLES dEQP test suite
+ * associated with that date. The date is encoded as follows:
+ * <ul>
+ * <li>Year in bits 31-16</li>
+ * <li>Month in bits 15-8</li>
+ * <li>Day in bits 7-0</li>
+ * </ul>
+ * <p>
+ * Example: 2021-03-01 is encoded as 0x07E50301, and would indicate that the device passes the
+ * OpenGL ES dEQP test suite version that was current on 2021-03-01.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_OPENGLES_DEQP_LEVEL = "android.software.opengles.deqp.level";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device includes broadcast radio tuner.
* @hide
*/
@@ -4438,6 +4455,7 @@
* @throws NameNotFoundException if a package with the given name cannot be
* found on the system.
*/
+ //@Deprecated
public abstract PermissionInfo getPermissionInfo(@NonNull String permName,
@PermissionInfoFlags int flags) throws NameNotFoundException;
@@ -4450,9 +4468,10 @@
* @param flags Additional option flags to modify the data returned.
* @return Returns a list of {@link PermissionInfo} containing information
* about all of the permissions in the given group.
- * @throws NameNotFoundException if a package with the given name cannot be
+ * @throws NameNotFoundException if a group with the given name cannot be
* found on the system.
*/
+ //@Deprecated
@NonNull
public abstract List<PermissionInfo> queryPermissionsByGroup(@NonNull String permissionGroup,
@PermissionInfoFlags int flags) throws NameNotFoundException;
@@ -4481,7 +4500,7 @@
* Retrieve all of the information we know about a particular group of
* permissions.
*
- * @param permName The fully qualified name (i.e.
+ * @param groupName The fully qualified name (i.e.
* com.google.permission_group.APPS) of the permission you are
* interested in.
* @param flags Additional option flags to modify the data returned.
@@ -4490,8 +4509,9 @@
* @throws NameNotFoundException if a package with the given name cannot be
* found on the system.
*/
+ //@Deprecated
@NonNull
- public abstract PermissionGroupInfo getPermissionGroupInfo(@NonNull String permName,
+ public abstract PermissionGroupInfo getPermissionGroupInfo(@NonNull String groupName,
@PermissionGroupInfoFlags int flags) throws NameNotFoundException;
/**
@@ -4501,6 +4521,7 @@
* @return Returns a list of {@link PermissionGroupInfo} containing
* information about all of the known permission groups.
*/
+ //@Deprecated
@NonNull
public abstract List<PermissionGroupInfo> getAllPermissionGroups(
@PermissionGroupInfoFlags int flags);
@@ -4757,6 +4778,7 @@
* @return Whether the permission is restricted by policy.
*/
@CheckResult
+ //@Deprecated
public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName,
@NonNull String packageName);
@@ -4805,6 +4827,7 @@
*
* @see #removePermission(String)
*/
+ //@Deprecated
public abstract boolean addPermission(@NonNull PermissionInfo info);
/**
@@ -4814,6 +4837,7 @@
* expense of no guarantee the added permission will be retained if
* the device is rebooted before it is written.
*/
+ //@Deprecated
public abstract boolean addPermissionAsync(@NonNull PermissionInfo info);
/**
@@ -4829,6 +4853,7 @@
*
* @see #addPermission(PermissionInfo)
*/
+ //@Deprecated
public abstract void removePermission(@NonNull String permName);
/**
@@ -4881,6 +4906,7 @@
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS)
@@ -4908,6 +4934,7 @@
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
@@ -4936,6 +4963,7 @@
*
* @hide
*/
+ //@Deprecated
@SystemApi
@RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
public void revokeRuntimePermission(@NonNull String packageName,
@@ -4953,6 +4981,7 @@
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(anyOf = {
@@ -4976,6 +5005,7 @@
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(anyOf = {
@@ -5040,6 +5070,7 @@
*
* @throws SecurityException if you try to access a whitelist that you have no access to.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public @NonNull Set<String> getWhitelistedRestrictedPermissions(
@@ -5106,6 +5137,7 @@
*
* @throws SecurityException if you try to modify a whitelist that you have no access to.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public boolean addWhitelistedRestrictedPermission(@NonNull String packageName,
@@ -5175,6 +5207,7 @@
*
* @throws SecurityException if you try to modify a whitelist that you have no access to.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public boolean removeWhitelistedRestrictedPermission(@NonNull String packageName,
@@ -5207,6 +5240,7 @@
*
* @throws SecurityException if you you have no access to modify this.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
conditional = true)
public boolean setAutoRevokeWhitelisted(@NonNull String packageName, boolean whitelisted) {
@@ -5234,6 +5268,7 @@
*
* @throws SecurityException if you you have no access to this.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
conditional = true)
public boolean isAutoRevokeWhitelisted(@NonNull String packageName) {
@@ -5252,6 +5287,7 @@
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@UnsupportedAppUsage
public abstract boolean shouldShowRequestPermissionRationale(@NonNull String permName);
@@ -7554,6 +7590,7 @@
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
@@ -7567,6 +7604,7 @@
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 4dfbd75..45f072a 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -53,7 +53,6 @@
import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.pm.permission.SplitPermissionInfoParcelable;
import android.content.pm.split.DefaultSplitAssetLoader;
import android.content.pm.split.SplitAssetDependencyLoader;
import android.content.pm.split.SplitAssetLoader;
@@ -74,6 +73,7 @@
import android.os.Trace;
import android.os.UserHandle;
import android.os.storage.StorageManager;
+import android.permission.PermissionManager;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -2394,17 +2394,13 @@
Slog.i(TAG, newPermsMsg.toString());
}
- List<SplitPermissionInfoParcelable> splitPermissions;
-
- try {
- splitPermissions = ActivityThread.getPermissionManager().getSplitPermissions();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ final List<PermissionManager.SplitPermissionInfo> splitPermissions =
+ ActivityThread.currentApplication().getSystemService(PermissionManager.class)
+ .getSplitPermissions();
final int listSize = splitPermissions.size();
for (int is = 0; is < listSize; is++) {
- final SplitPermissionInfoParcelable spi = splitPermissions.get(is);
+ final PermissionManager.SplitPermissionInfo spi = splitPermissions.get(is);
if (pkg.applicationInfo.targetSdkVersion >= spi.getTargetSdk()
|| !pkg.requestedPermissions.contains(spi.getSplitPermission())) {
continue;
diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java
index cd9ba6a..35f02a8 100644
--- a/core/java/android/content/pm/PermissionInfo.java
+++ b/core/java/android/content/pm/PermissionInfo.java
@@ -65,12 +65,20 @@
@Deprecated
public static final int PROTECTION_SIGNATURE_OR_SYSTEM = 3;
+ /**
+ * System-level value for {@link #protectionLevel}, corresponding
+ * to the <code>internal</code> value of
+ * {@link android.R.attr#protectionLevel}.
+ */
+ public static final int PROTECTION_INTERNAL = 4;
+
/** @hide */
@IntDef(flag = false, prefix = { "PROTECTION_" }, value = {
PROTECTION_NORMAL,
PROTECTION_DANGEROUS,
PROTECTION_SIGNATURE,
PROTECTION_SIGNATURE_OR_SYSTEM,
+ PROTECTION_INTERNAL,
})
@Retention(RetentionPolicy.SOURCE)
public @interface Protection {}
@@ -261,6 +269,15 @@
@SystemApi
public static final int PROTECTION_FLAG_RECENTS = 0x2000000;
+ /**
+ * Additional flag for {@link #protectionLevel}, corresponding to the <code>role</code> value of
+ * {@link android.R.attr#protectionLevel}.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int PROTECTION_FLAG_ROLE = 0x4000000;
+
/** @hide */
@IntDef(flag = true, prefix = { "PROTECTION_FLAG_" }, value = {
PROTECTION_FLAG_PRIVILEGED,
@@ -285,6 +302,7 @@
PROTECTION_FLAG_COMPANION,
PROTECTION_FLAG_RETAIL_DEMO,
PROTECTION_FLAG_RECENTS,
+ PROTECTION_FLAG_ROLE,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ProtectionFlags {}
@@ -317,7 +335,7 @@
* </pre>
*
* <p></p>Base permission types are {@link #PROTECTION_NORMAL},
- * {@link #PROTECTION_DANGEROUS}, {@link #PROTECTION_SIGNATURE}
+ * {@link #PROTECTION_DANGEROUS}, {@link #PROTECTION_SIGNATURE}, {@link #PROTECTION_INTERNAL}
* and the deprecated {@link #PROTECTION_SIGNATURE_OR_SYSTEM}.
* Flags are listed under {@link android.R.attr#protectionLevel}.
*
@@ -479,6 +497,9 @@
case PermissionInfo.PROTECTION_SIGNATURE_OR_SYSTEM:
protLevel.append("signatureOrSystem");
break;
+ case PermissionInfo.PROTECTION_INTERNAL:
+ protLevel.append("internal");
+ break;
default:
protLevel.append("????");
break;
@@ -546,6 +567,9 @@
if ((level & PermissionInfo.PROTECTION_FLAG_RECENTS) != 0) {
protLevel.append("|recents");
}
+ if ((level & PermissionInfo.PROTECTION_FLAG_ROLE) != 0) {
+ protLevel.append("|role");
+ }
return protLevel.toString();
}
diff --git a/core/java/android/content/pm/dex/OWNERS b/core/java/android/content/pm/dex/OWNERS
new file mode 100644
index 0000000..267e5d58
--- /dev/null
+++ b/core/java/android/content/pm/dex/OWNERS
@@ -0,0 +1,7 @@
+# Bug component: 86431
+
+toddke@android.com
+toddke@google.com
+patb@google.com
+calin@google.com
+ngeoffray@google.com
diff --git a/core/java/android/content/pm/parsing/ParsingPackageUtils.java b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
index eae7d45..561a9e3 100644
--- a/core/java/android/content/pm/parsing/ParsingPackageUtils.java
+++ b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
@@ -71,7 +71,6 @@
import android.content.pm.parsing.result.ParseInput.DeferredError;
import android.content.pm.parsing.result.ParseResult;
import android.content.pm.parsing.result.ParseTypeImpl;
-import android.content.pm.permission.SplitPermissionInfoParcelable;
import android.content.pm.split.DefaultSplitAssetLoader;
import android.content.pm.split.SplitAssetDependencyLoader;
import android.content.pm.split.SplitAssetLoader;
@@ -85,9 +84,9 @@
import android.os.Build;
import android.os.Bundle;
import android.os.FileUtils;
-import android.os.RemoteException;
import android.os.Trace;
import android.os.ext.SdkExtensions;
+import android.permission.PermissionManager;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -2664,17 +2663,13 @@
}
private static void convertSplitPermissions(ParsingPackage pkg) {
- List<SplitPermissionInfoParcelable> splitPermissions;
-
- try {
- splitPermissions = ActivityThread.getPermissionManager().getSplitPermissions();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ final List<PermissionManager.SplitPermissionInfo> splitPermissions =
+ ActivityThread.currentApplication().getSystemService(PermissionManager.class)
+ .getSplitPermissions();
final int listSize = splitPermissions.size();
for (int is = 0; is < listSize; is++) {
- final SplitPermissionInfoParcelable spi = splitPermissions.get(is);
+ final PermissionManager.SplitPermissionInfo spi = splitPermissions.get(is);
List<String> requestedPermissions = pkg.getRequestedPermissions();
if (pkg.getTargetSdkVersion() >= spi.getTargetSdk()
|| !requestedPermissions.contains(spi.getSplitPermission())) {
diff --git a/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java b/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java
index 894849a..cbd2c55 100644
--- a/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java
@@ -112,10 +112,12 @@
if ((permission.protectionLevel & PermissionInfo.PROTECTION_FLAG_INSTANT) == 0
&& (permission.protectionLevel & PermissionInfo.PROTECTION_FLAG_RUNTIME_ONLY)
== 0
- && (permission.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE) !=
- PermissionInfo.PROTECTION_SIGNATURE) {
+ && (permission.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE)
+ != PermissionInfo.PROTECTION_SIGNATURE
+ && (permission.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE)
+ != PermissionInfo.PROTECTION_INTERNAL) {
return input.error("<permission> protectionLevel specifies a non-instant flag "
- + "but is not based on signature type");
+ + "but is not based on signature or internal type");
}
}
diff --git a/core/java/android/content/pm/permission/OWNERS b/core/java/android/content/pm/permission/OWNERS
new file mode 100644
index 0000000..cde7b2a
--- /dev/null
+++ b/core/java/android/content/pm/permission/OWNERS
@@ -0,0 +1,11 @@
+# Bug component: 137825
+
+toddke@android.com
+toddke@google.com
+patb@google.com
+moltmann@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
+zhanghai@google.com
+evanseverson@google.com
+ntmyren@google.com
diff --git a/core/java/android/content/pm/split/OWNERS b/core/java/android/content/pm/split/OWNERS
new file mode 100644
index 0000000..3d126d2
--- /dev/null
+++ b/core/java/android/content/pm/split/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 36137
+
+toddke@android.com
+toddke@google.com
+patb@google.com
diff --git a/core/java/android/content/res/OWNERS b/core/java/android/content/res/OWNERS
new file mode 100644
index 0000000..bc2355c
--- /dev/null
+++ b/core/java/android/content/res/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 568761
+
+toddke@android.com
+toddke@google.com
+patb@google.com
+rtmitchell@google.com
diff --git a/core/java/android/content/rollback/OWNERS b/core/java/android/content/rollback/OWNERS
new file mode 100644
index 0000000..3093fd6
--- /dev/null
+++ b/core/java/android/content/rollback/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 557916
+
+narayan@google.com
+nandana@google.com
+olilan@google.com
diff --git a/core/java/android/gesture/OWNERS b/core/java/android/gesture/OWNERS
new file mode 100644
index 0000000..b3b8775
--- /dev/null
+++ b/core/java/android/gesture/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 25700
+
+romainguy@google.com
+alanv@google.com
+adamp@google.com
+aurimas@google.com
+nduca@google.com
+sumir@google.com
diff --git a/core/java/android/hardware/ISensorPrivacyManager.aidl b/core/java/android/hardware/ISensorPrivacyManager.aidl
index 1ba7b98..4e368d0 100644
--- a/core/java/android/hardware/ISensorPrivacyManager.aidl
+++ b/core/java/android/hardware/ISensorPrivacyManager.aidl
@@ -32,4 +32,12 @@
void setSensorPrivacy(boolean enable);
// =============== End of transactions used on native side as well ============================
+
+ // TODO(evanseverson) add to native interface
+ boolean isIndividualSensorPrivacyEnabled(int sensor);
+
+ // TODO(evanseverson) add to native interface
+ void setIndividualSensorPrivacy(int sensor, boolean enable);
+
+ // TODO(evanseverson) listeners
}
\ No newline at end of file
diff --git a/core/java/android/hardware/OWNERS b/core/java/android/hardware/OWNERS
index 47dbf2d..3295042 100644
--- a/core/java/android/hardware/OWNERS
+++ b/core/java/android/hardware/OWNERS
@@ -1,2 +1,5 @@
# Camera
per-file *Camera*=cychen@google.com,epeev@google.com,etalvala@google.com,shuzhenwang@google.com,yinchiayeh@google.com,zhijunhe@google.com,jchowdhary@google.com
+
+# Sensor Privacy
+per-file *SensorPrivacy* = file:platform/frameworks/native:/libs/sensorprivacy/OWNERS
diff --git a/core/java/android/hardware/SensorPrivacyManager.java b/core/java/android/hardware/SensorPrivacyManager.java
index 274202f..c647239 100644
--- a/core/java/android/hardware/SensorPrivacyManager.java
+++ b/core/java/android/hardware/SensorPrivacyManager.java
@@ -16,6 +16,7 @@
package android.hardware;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemService;
@@ -23,10 +24,14 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.service.SensorPrivacyIndividualEnabledSensorProto;
import android.util.ArrayMap;
import com.android.internal.annotations.GuardedBy;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* This class provides access to the sensor privacy services; sensor privacy allows the
* user to disable access to all sensors on the device. This class provides methods to query the
@@ -38,6 +43,25 @@
@SystemService(Context.SENSOR_PRIVACY_SERVICE)
public final class SensorPrivacyManager {
+ /** Microphone */
+ public static final int INDIVIDUAL_SENSOR_MICROPHONE =
+ SensorPrivacyIndividualEnabledSensorProto.MICROPHONE;
+
+ /** Camera */
+ public static final int INDIVIDUAL_SENSOR_CAMERA =
+ SensorPrivacyIndividualEnabledSensorProto.CAMERA;
+
+ /**
+ * Individual sensors not listed in {@link Sensor}
+ * @hide
+ */
+ @IntDef(prefix = "INDIVIDUAL_SENSOR_", value = {
+ INDIVIDUAL_SENSOR_MICROPHONE,
+ INDIVIDUAL_SENSOR_CAMERA
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface IndividualSensor {}
+
/**
* A class implementing this interface can register with the {@link
* android.hardware.SensorPrivacyManager} to receive notification when the sensor privacy
@@ -168,4 +192,31 @@
throw e.rethrowFromSystemServer();
}
}
+
+ /**
+ * Returns whether sensor privacy is currently enabled for a specific sensor.
+ *
+ * @return true if sensor privacy is currently enabled, false otherwise.
+ */
+ public boolean isIndividualSensorPrivacyEnabled(@IndividualSensor int sensor) {
+ try {
+ return mService.isIndividualSensorPrivacyEnabled(sensor);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Sets sensor privacy to the specified state for an individual sensor.
+ *
+ * @param enable the state to which sensor privacy should be set.
+ */
+ @RequiresPermission(android.Manifest.permission.MANAGE_SENSOR_PRIVACY)
+ public void setIndividualSensorPrivacy(@IndividualSensor int sensor, boolean enable) {
+ try {
+ mService.setIndividualSensorPrivacy(sensor, enable);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
diff --git a/core/java/android/hardware/biometrics/OWNERS b/core/java/android/hardware/biometrics/OWNERS
new file mode 100644
index 0000000..33527f8
--- /dev/null
+++ b/core/java/android/hardware/biometrics/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 879035
+
+jaggies@google.com
diff --git a/core/java/android/hardware/camera2/CameraCaptureSession.java b/core/java/android/hardware/camera2/CameraCaptureSession.java
index e858159..bd47463 100644
--- a/core/java/android/hardware/camera2/CameraCaptureSession.java
+++ b/core/java/android/hardware/camera2/CameraCaptureSession.java
@@ -964,12 +964,20 @@
* <p>Closing a session frees up the target output Surfaces of the session for reuse with either
* a new session, or to other APIs that can draw to Surfaces.</p>
*
- * <p>Note that creating a new capture session with {@link CameraDevice#createCaptureSession}
+ * <p>Note that for common usage scenarios like creating a new session or closing the camera
+ * device, it is faster to call respective APIs directly (see below for more details) without
+ * calling into this method. This API is only useful when application wants to uncofigure the
+ * camera but keep the device open for later use.</p>
+ *
+ * <p>Creating a new capture session with {@link CameraDevice#createCaptureSession}
* will close any existing capture session automatically, and call the older session listener's
* {@link StateCallback#onClosed} callback. Using {@link CameraDevice#createCaptureSession}
* directly without closing is the recommended approach for quickly switching to a new session,
* since unchanged target outputs can be reused more efficiently.</p>
*
+ * <p>Closing the device with {@link CameraDevice#close} directly without calling this API is
+ * also recommended for quickly closing the camera.</p>
+ *
* <p>Once a session is closed, all methods on it will throw an IllegalStateException, and any
* repeating requests or bursts are stopped (as if {@link #stopRepeating()} was called).
* However, any in-progress capture requests submitted to the session will be completed as
diff --git a/core/java/android/hardware/camera2/CameraManager.java b/core/java/android/hardware/camera2/CameraManager.java
index 8469f5f..cdfdc1f 100644
--- a/core/java/android/hardware/camera2/CameraManager.java
+++ b/core/java/android/hardware/camera2/CameraManager.java
@@ -20,6 +20,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
+import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.content.Context;
@@ -850,13 +851,17 @@
* A camera device has been opened by an application.
*
* <p>The default implementation of this method does nothing.</p>
- *
- * @param cameraId The unique identifier of the new camera.
+ * android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER is required to receive this
+ * callback
+ * @param cameraId The unique identifier of the camera opened.
* @param packageId The package Id of the application opening the camera.
*
* @see #onCameraClosed
+ * @hide
*/
- /** @hide */
+ @SystemApi
+ @TestApi
+ @RequiresPermission(android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER)
public void onCameraOpened(@NonNull String cameraId, @NonNull String packageId) {
// default empty implementation
}
@@ -865,10 +870,14 @@
* A previously-opened camera has been closed.
*
* <p>The default implementation of this method does nothing.</p>
- *
+ * android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER is required to receive this
+ * callback.
* @param cameraId The unique identifier of the closed camera.
+ * @hide
*/
- /** @hide */
+ @SystemApi
+ @TestApi
+ @RequiresPermission(android.Manifest.permission.CAMERA_OPEN_CLOSE_LISTENER)
public void onCameraClosed(@NonNull String cameraId) {
// default empty implementation
}
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 7afba1a..41cc12f 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -2856,10 +2856,10 @@
* respective color channel provided in
* {@link CaptureRequest#SENSOR_TEST_PATTERN_DATA android.sensor.testPatternData}.</p>
* <p>For example:</p>
- * <pre><code>android.testPatternData = [0, 0xFFFFFFFF, 0xFFFFFFFF, 0]
+ * <pre><code>android.control.testPatternData = [0, 0xFFFFFFFF, 0xFFFFFFFF, 0]
* </code></pre>
* <p>All green pixels are 100% green. All red/blue pixels are black.</p>
- * <pre><code>android.testPatternData = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0]
+ * <pre><code>android.control.testPatternData = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0]
* </code></pre>
* <p>All red pixels are 100% red. Only the odd green pixels
* are 100% green. All blue pixels are 100% black.</p>
diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
index 19f4cd6..5cc7bf8 100644
--- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
+++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
@@ -1719,37 +1719,25 @@
private static native long nativeAllocateCopy(long ptr)
throws NullPointerException;
- @FastNative
private static synchronized native void nativeWriteToParcel(Parcel dest, long ptr);
- @FastNative
private static synchronized native void nativeReadFromParcel(Parcel source, long ptr);
- @FastNative
private static synchronized native void nativeSwap(long ptr, long otherPtr)
throws NullPointerException;
- @FastNative
private static synchronized native void nativeClose(long ptr);
- @FastNative
private static synchronized native boolean nativeIsEmpty(long ptr);
- @FastNative
private static synchronized native int nativeGetEntryCount(long ptr);
- @FastNative
private static synchronized native long nativeGetBufferSize(long ptr);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @FastNative
private static synchronized native byte[] nativeReadValues(int tag, long ptr);
- @FastNative
private static synchronized native void nativeWriteValues(int tag, byte[] src, long ptr);
private static synchronized native void nativeDump(long ptr) throws IOException; // dump to LOGD
- @FastNative
private static synchronized native ArrayList nativeGetAllVendorKeys(long ptr, Class keyClass);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @FastNative
private static synchronized native int nativeGetTagFromKeyLocal(long ptr, String keyName)
throws IllegalArgumentException;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @FastNative
private static synchronized native int nativeGetTypeFromTagLocal(long ptr, int tag)
throws IllegalArgumentException;
@FastNative
diff --git a/core/java/android/hardware/display/OWNERS b/core/java/android/hardware/display/OWNERS
index 9ca3910..5bcd9bb8 100644
--- a/core/java/android/hardware/display/OWNERS
+++ b/core/java/android/hardware/display/OWNERS
@@ -1,2 +1,6 @@
+# Bug component: 345010
+
+include /services/core/java/com/android/server/display/OWNERS
+
michaelwr@google.com
santoscordon@google.com
diff --git a/core/java/android/hardware/face/OWNERS b/core/java/android/hardware/face/OWNERS
new file mode 100644
index 0000000..33527f8
--- /dev/null
+++ b/core/java/android/hardware/face/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 879035
+
+jaggies@google.com
diff --git a/core/java/android/hardware/fingerprint/OWNERS b/core/java/android/hardware/fingerprint/OWNERS
new file mode 100644
index 0000000..dcead40
--- /dev/null
+++ b/core/java/android/hardware/fingerprint/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 114777
+
+jaggies@google.com
diff --git a/core/java/android/hardware/hdmi/HdmiDeviceInfo.java b/core/java/android/hardware/hdmi/HdmiDeviceInfo.java
index c6007f1..a8cafef 100644
--- a/core/java/android/hardware/hdmi/HdmiDeviceInfo.java
+++ b/core/java/android/hardware/hdmi/HdmiDeviceInfo.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.hardware.hdmi.HdmiControlManager.HdmiCecVersion;
import android.os.Parcel;
import android.os.Parcelable;
@@ -107,6 +108,8 @@
// CEC only parameters.
private final int mLogicalAddress;
private final int mDeviceType;
+ @HdmiCecVersion
+ private final int mHdmiCecVersion;
private final int mVendorId;
private final String mDisplayName;
private final int mDevicePowerStatus;
@@ -133,8 +136,9 @@
int vendorId = source.readInt();
int powerStatus = source.readInt();
String displayName = source.readString();
+ int cecVersion = source.readInt();
return new HdmiDeviceInfo(logicalAddress, physicalAddress, portId,
- deviceType, vendorId, displayName, powerStatus);
+ deviceType, vendorId, displayName, powerStatus, cecVersion);
case HDMI_DEVICE_TYPE_MHL:
int deviceId = source.readInt();
int adopterId = source.readInt();
@@ -167,7 +171,7 @@
* @hide
*/
public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType,
- int vendorId, String displayName, int powerStatus) {
+ int vendorId, String displayName, int powerStatus, int hdmiCecVersion) {
mHdmiDeviceType = HDMI_DEVICE_TYPE_CEC;
mPhysicalAddress = physicalAddress;
mPortId = portId;
@@ -175,6 +179,7 @@
mId = idForCecDevice(logicalAddress);
mLogicalAddress = logicalAddress;
mDeviceType = deviceType;
+ mHdmiCecVersion = hdmiCecVersion;
mVendorId = vendorId;
mDevicePowerStatus = powerStatus;
mDisplayName = displayName;
@@ -192,12 +197,31 @@
* @param deviceType type of device
* @param vendorId vendor id of device. Used for vendor specific command.
* @param displayName name of device
+ * @param powerStatus device power status
+ * @hide
+ */
+ public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType,
+ int vendorId, String displayName, int powerStatus) {
+ this(logicalAddress, physicalAddress, portId, deviceType,
+ vendorId, displayName, powerStatus, HdmiControlManager.HDMI_CEC_VERSION_1_4_b);
+ }
+
+ /**
+ * Constructor. Used to initialize the instance for CEC device.
+ *
+ * @param logicalAddress logical address of HDMI-CEC device
+ * @param physicalAddress physical address of HDMI-CEC device
+ * @param portId HDMI port ID (1 for HDMI1)
+ * @param deviceType type of device
+ * @param vendorId vendor id of device. Used for vendor specific command.
+ * @param displayName name of device
* @hide
*/
public HdmiDeviceInfo(int logicalAddress, int physicalAddress, int portId, int deviceType,
int vendorId, String displayName) {
this(logicalAddress, physicalAddress, portId, deviceType,
- vendorId, displayName, HdmiControlManager.POWER_STATUS_UNKNOWN);
+ vendorId, displayName, HdmiControlManager.POWER_STATUS_UNKNOWN,
+ HdmiControlManager.HDMI_CEC_VERSION_1_4_b);
}
/**
@@ -215,6 +239,7 @@
mId = idForHardware(portId);
mLogicalAddress = -1;
mDeviceType = DEVICE_RESERVED;
+ mHdmiCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_b;
mVendorId = 0;
mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
mDisplayName = "HDMI" + portId;
@@ -240,6 +265,7 @@
mId = idForMhlDevice(portId);
mLogicalAddress = -1;
mDeviceType = DEVICE_RESERVED;
+ mHdmiCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_b;
mVendorId = 0;
mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
mDisplayName = "Mobile";
@@ -261,6 +287,7 @@
mLogicalAddress = -1;
mDeviceType = DEVICE_INACTIVE;
+ mHdmiCecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_b;
mPortId = PORT_INVALID;
mDevicePowerStatus = HdmiControlManager.POWER_STATUS_UNKNOWN;
mDisplayName = "Inactive";
@@ -339,6 +366,16 @@
}
/**
+ * Returns the CEC version the device supports.
+ *
+ * @hide
+ */
+ @HdmiCecVersion
+ public int getCecVersion() {
+ return mHdmiCecVersion;
+ }
+
+ /**
* Returns device's power status. It should be one of the following values.
* <ul>
* <li>{@link HdmiControlManager#POWER_STATUS_ON}
@@ -448,6 +485,7 @@
dest.writeInt(mVendorId);
dest.writeInt(mDevicePowerStatus);
dest.writeString(mDisplayName);
+ dest.writeInt(mHdmiCecVersion);
break;
case HDMI_DEVICE_TYPE_MHL:
dest.writeInt(mDeviceId);
@@ -470,6 +508,7 @@
s.append("logical_address: ").append(String.format("0x%02X", mLogicalAddress));
s.append(" ");
s.append("device_type: ").append(mDeviceType).append(" ");
+ s.append("cec_version: ").append(mHdmiCecVersion).append(" ");
s.append("vendor_id: ").append(mVendorId).append(" ");
s.append("display_name: ").append(mDisplayName).append(" ");
s.append("power_status: ").append(mDevicePowerStatus).append(" ");
@@ -507,6 +546,7 @@
&& mPortId == other.mPortId
&& mLogicalAddress == other.mLogicalAddress
&& mDeviceType == other.mDeviceType
+ && mHdmiCecVersion == other.mHdmiCecVersion
&& mVendorId == other.mVendorId
&& mDevicePowerStatus == other.mDevicePowerStatus
&& mDisplayName.equals(other.mDisplayName)
@@ -522,6 +562,7 @@
mPortId,
mLogicalAddress,
mDeviceType,
+ mHdmiCecVersion,
mVendorId,
mDevicePowerStatus,
mDisplayName,
diff --git a/core/java/android/hardware/hdmi/HdmiPortInfo.java b/core/java/android/hardware/hdmi/HdmiPortInfo.java
index e4b311a..625a6a5 100644
--- a/core/java/android/hardware/hdmi/HdmiPortInfo.java
+++ b/core/java/android/hardware/hdmi/HdmiPortInfo.java
@@ -192,6 +192,7 @@
@Override
public int hashCode() {
- return mId;
+ return java.util.Objects.hash(
+ mId, mType, mAddress, mCecSupported, mArcSupported, mMhlSupported);
}
}
diff --git a/core/java/android/hardware/hdmi/OWNERS b/core/java/android/hardware/hdmi/OWNERS
new file mode 100644
index 0000000..16c15e3
--- /dev/null
+++ b/core/java/android/hardware/hdmi/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 826094
+
+include /services/core/java/com/android/server/display/OWNERS
+
+marvinramin@google.com
+nchalko@google.com
diff --git a/core/java/android/hardware/input/IInputManager.aidl b/core/java/android/hardware/input/IInputManager.aidl
index dc6f579..57c0398 100644
--- a/core/java/android/hardware/input/IInputManager.aidl
+++ b/core/java/android/hardware/input/IInputManager.aidl
@@ -22,6 +22,7 @@
import android.hardware.input.IInputDevicesChangedListener;
import android.hardware.input.ITabletModeChangedListener;
import android.hardware.input.TouchCalibration;
+import android.os.CombinedVibrationEffect;
import android.os.IBinder;
import android.os.VibrationEffect;
import android.view.InputDevice;
@@ -85,7 +86,10 @@
// Input device vibrator control.
void vibrate(int deviceId, in VibrationEffect effect, IBinder token);
+ void vibrateCombined(int deviceId, in CombinedVibrationEffect effect, IBinder token);
void cancelVibrate(int deviceId, IBinder token);
+ int[] getVibratorIds(int deviceId);
+ boolean isVibrating(int deviceId);
void setPointerIconType(int typeId);
void setCustomPointerIcon(in PointerIcon icon);
diff --git a/core/java/android/hardware/input/InputDeviceVibrator.java b/core/java/android/hardware/input/InputDeviceVibrator.java
new file mode 100644
index 0000000..c60d6ce
--- /dev/null
+++ b/core/java/android/hardware/input/InputDeviceVibrator.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2020 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.hardware.input;
+
+import android.annotation.CallbackExecutor;
+import android.annotation.NonNull;
+import android.os.Binder;
+import android.os.VibrationAttributes;
+import android.os.VibrationEffect;
+import android.os.Vibrator;
+
+import java.util.concurrent.Executor;
+
+/**
+ * Vibrator implementation that communicates with the input device vibrators.
+ */
+final class InputDeviceVibrator extends Vibrator {
+ // mDeviceId represents InputDevice ID the vibrator belongs to
+ private final int mDeviceId;
+ private final int mVibratorId;
+ private final Binder mToken;
+ private final InputManager mInputManager;
+
+ InputDeviceVibrator(InputManager inputManager, int deviceId, int vibratorId) {
+ mInputManager = inputManager;
+ mDeviceId = deviceId;
+ mVibratorId = vibratorId;
+ mToken = new Binder();
+ }
+
+ @Override
+ public boolean hasVibrator() {
+ return true;
+ }
+
+ @Override
+ public boolean isVibrating() {
+ return mInputManager.isVibrating(mDeviceId);
+ }
+
+ /* TODO: b/161634264 Support Vibrator listener API in input devices */
+ @Override
+ public void addVibratorStateListener(@NonNull OnVibratorStateChangedListener listener) {
+ throw new UnsupportedOperationException(
+ "addVibratorStateListener not supported in InputDeviceVibrator");
+ }
+
+ @Override
+ public void addVibratorStateListener(
+ @NonNull @CallbackExecutor Executor executor,
+ @NonNull OnVibratorStateChangedListener listener) {
+ throw new UnsupportedOperationException(
+ "addVibratorStateListener not supported in InputDeviceVibrator");
+ }
+
+ @Override
+ public void removeVibratorStateListener(@NonNull OnVibratorStateChangedListener listener) {
+ throw new UnsupportedOperationException(
+ "removeVibratorStateListener not supported in InputDeviceVibrator");
+ }
+
+ @Override
+ public boolean hasAmplitudeControl() {
+ return true;
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public void vibrate(int uid, String opPkg, @NonNull VibrationEffect effect,
+ String reason, @NonNull VibrationAttributes attributes) {
+ mInputManager.vibrate(mDeviceId, effect, mToken);
+ }
+
+ @Override
+ public void cancel() {
+ mInputManager.cancelVibrate(mDeviceId, mToken);
+ }
+}
diff --git a/core/java/android/hardware/input/InputDeviceVibratorManager.java b/core/java/android/hardware/input/InputDeviceVibratorManager.java
new file mode 100644
index 0000000..a381b02
--- /dev/null
+++ b/core/java/android/hardware/input/InputDeviceVibratorManager.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2020 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.hardware.input;
+
+import android.os.Binder;
+import android.os.CombinedVibrationEffect;
+import android.os.NullVibrator;
+import android.os.Vibrator;
+import android.os.VibratorManager;
+import android.util.SparseArray;
+import android.view.InputDevice;
+
+import com.android.internal.annotations.GuardedBy;
+
+/**
+ * Vibrator manager implementation that communicates with the input device vibrators.
+ *
+ * @hide
+ */
+public class InputDeviceVibratorManager extends VibratorManager
+ implements InputManager.InputDeviceListener {
+ private static final String TAG = "InputDeviceVibratorManager";
+ private static final boolean DEBUG = false;
+
+ private final Binder mToken;
+ private final InputManager mInputManager;
+
+ // The input device Id.
+ private final int mDeviceId;
+ // Vibrator map from Vibrator Id to Vibrator
+ @GuardedBy("mVibrators")
+ private final SparseArray<Vibrator> mVibrators = new SparseArray<>();
+
+ public InputDeviceVibratorManager(InputManager inputManager, int deviceId) {
+ mInputManager = inputManager;
+ mDeviceId = deviceId;
+ mToken = new Binder();
+
+ initializeVibrators();
+ }
+
+ private void initializeVibrators() {
+ synchronized (mVibrators) {
+ mVibrators.clear();
+ InputDevice inputDevice = InputDevice.getDevice(mDeviceId);
+ final int[] vibratorIds =
+ mInputManager.getVibratorIds(mDeviceId);
+ for (int i = 0; i < vibratorIds.length; i++) {
+ mVibrators.put(vibratorIds[i],
+ new InputDeviceVibrator(mInputManager, mDeviceId, vibratorIds[i]));
+ }
+ }
+ }
+
+ @Override
+ public void onInputDeviceAdded(int deviceId) {
+ }
+
+ @Override
+ public void onInputDeviceRemoved(int deviceId) {
+ synchronized (mVibrators) {
+ if (deviceId == mDeviceId) {
+ mVibrators.clear();
+ }
+ }
+ }
+
+ @Override
+ public void onInputDeviceChanged(int deviceId) {
+ if (deviceId == mDeviceId) {
+ initializeVibrators();
+ }
+ }
+
+ @Override
+ public int[] getVibratorIds() {
+ synchronized (mVibrators) {
+ int[] vibratorIds = new int[mVibrators.size()];
+ for (int idx = 0; idx < mVibrators.size(); idx++) {
+ vibratorIds[idx++] = mVibrators.keyAt(idx);
+ }
+ return vibratorIds;
+ }
+ }
+
+ @Override
+ public Vibrator getVibrator(int vibratorId) {
+ synchronized (mVibrators) {
+ if (mVibrators.contains(vibratorId)) {
+ return mVibrators.get(vibratorId);
+ }
+ }
+ return NullVibrator.getInstance();
+ }
+
+ @Override
+ public Vibrator getDefaultVibrator() {
+ // Returns vibrator ID 0
+ synchronized (mVibrators) {
+ if (mVibrators.size() > 0) {
+ return mVibrators.valueAt(0);
+ }
+ }
+ return NullVibrator.getInstance();
+ }
+
+ @Override
+ public void vibrate(CombinedVibrationEffect effect) {
+ mInputManager.vibrate(mDeviceId, effect, mToken);
+ }
+}
diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java
index 81ea2f5..40c7e9a 100644
--- a/core/java/android/hardware/input/InputManager.java
+++ b/core/java/android/hardware/input/InputManager.java
@@ -17,7 +17,6 @@
package android.hardware.input;
import android.Manifest;
-import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -29,9 +28,9 @@
import android.compat.annotation.ChangeId;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
-import android.os.Binder;
import android.os.BlockUntrustedTouchesMode;
import android.os.Build;
+import android.os.CombinedVibrationEffect;
import android.os.Handler;
import android.os.IBinder;
import android.os.InputEventInjectionSync;
@@ -41,9 +40,9 @@
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.os.SystemClock;
-import android.os.VibrationAttributes;
import android.os.VibrationEffect;
import android.os.Vibrator;
+import android.os.VibratorManager;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Log;
@@ -64,7 +63,6 @@
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.Executor;
/**
* Provides information about input devices and available key layouts.
@@ -210,6 +208,14 @@
public static final long BLOCK_UNTRUSTED_TOUCHES = 158002302L;
/**
+ * Check whether apps are using FLAG_SLIPPERY for their windows. We expect that this flag is
+ * only used by the system components. If so, we can lock it down.
+ * @hide
+ */
+ @ChangeId
+ public static final long BLOCK_FLAG_SLIPPERY = android.os.IInputConstants.BLOCK_FLAG_SLIPPERY;
+
+ /**
* Input Event Injection Synchronization Mode: None.
* Never blocks. Injection is asynchronous and is assumed always to be successful.
* @hide
@@ -1287,8 +1293,75 @@
* @return The vibrator, never null.
* @hide
*/
- public Vibrator getInputDeviceVibrator(int deviceId) {
- return new InputDeviceVibrator(deviceId);
+ public Vibrator getInputDeviceVibrator(int deviceId, int vibratorId) {
+ return new InputDeviceVibrator(this, deviceId, vibratorId);
+ }
+
+ /**
+ * Gets a vibrator manager service associated with an input device, always create a new
+ * instance.
+ * @return The vibrator manager, never null.
+ * @hide
+ */
+ @NonNull
+ public VibratorManager getInputDeviceVibratorManager(int deviceId) {
+ return new InputDeviceVibratorManager(InputManager.this, deviceId);
+ }
+
+ /*
+ * Get the list of device vibrators
+ * @return The list of vibrators IDs
+ */
+ int[] getVibratorIds(int deviceId) {
+ try {
+ return mIm.getVibratorIds(deviceId);
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
+ /*
+ * Perform vibration effect
+ */
+ void vibrate(int deviceId, VibrationEffect effect, IBinder token) {
+ try {
+ mIm.vibrate(deviceId, effect, token);
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
+ /*
+ * Perform combined vibration effect
+ */
+ void vibrate(int deviceId, CombinedVibrationEffect effect, IBinder token) {
+ try {
+ mIm.vibrateCombined(deviceId, effect, token);
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
+ /*
+ * Cancel an ongoing vibration
+ */
+ void cancelVibrate(int deviceId, IBinder token) {
+ try {
+ mIm.cancelVibrate(deviceId, token);
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
+ }
+
+ /*
+ * Check if input device is vibrating
+ */
+ boolean isVibrating(int deviceId) {
+ try {
+ return mIm.isVibrating(deviceId);
+ } catch (RemoteException ex) {
+ throw ex.rethrowFromSystemServer();
+ }
}
/**
@@ -1401,72 +1474,4 @@
}
}
}
-
- private final class InputDeviceVibrator extends Vibrator {
- private final int mDeviceId;
- private final Binder mToken;
-
- public InputDeviceVibrator(int deviceId) {
- mDeviceId = deviceId;
- mToken = new Binder();
- }
-
- @Override
- public boolean hasVibrator() {
- return true;
- }
-
- @Override
- public boolean isVibrating() {
- throw new UnsupportedOperationException(
- "isVibrating not supported in InputDeviceVibrator");
- }
-
- @Override
- public void addVibratorStateListener(@NonNull OnVibratorStateChangedListener listener) {
- throw new UnsupportedOperationException(
- "addVibratorStateListener not supported in InputDeviceVibrator");
- }
-
- @Override
- public void addVibratorStateListener(
- @NonNull @CallbackExecutor Executor executor,
- @NonNull OnVibratorStateChangedListener listener) {
- throw new UnsupportedOperationException(
- "addVibratorStateListener not supported in InputDeviceVibrator");
- }
-
- @Override
- public void removeVibratorStateListener(@NonNull OnVibratorStateChangedListener listener) {
- throw new UnsupportedOperationException(
- "removeVibratorStateListener not supported in InputDeviceVibrator");
- }
-
- @Override
- public boolean hasAmplitudeControl() {
- return true;
- }
-
- /**
- * @hide
- */
- @Override
- public void vibrate(int uid, String opPkg, @NonNull VibrationEffect effect,
- String reason, @NonNull VibrationAttributes attributes) {
- try {
- mIm.vibrate(mDeviceId, effect, mToken);
- } catch (RemoteException ex) {
- throw ex.rethrowFromSystemServer();
- }
- }
-
- @Override
- public void cancel() {
- try {
- mIm.cancelVibrate(mDeviceId, mToken);
- } catch (RemoteException ex) {
- throw ex.rethrowFromSystemServer();
- }
- }
- }
}
diff --git a/core/java/android/hardware/input/OWNERS b/core/java/android/hardware/input/OWNERS
index 0313a40..25e02e1 100644
--- a/core/java/android/hardware/input/OWNERS
+++ b/core/java/android/hardware/input/OWNERS
@@ -1,2 +1,6 @@
+# Bug component: 136048
+
+include /services/core/java/com/android/server/input/OWNERS
+
michaelwr@google.com
svv@google.com
diff --git a/core/java/android/hardware/iris/OWNERS b/core/java/android/hardware/iris/OWNERS
new file mode 100644
index 0000000..33527f8
--- /dev/null
+++ b/core/java/android/hardware/iris/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 879035
+
+jaggies@google.com
diff --git a/core/java/android/hardware/lights/OWNERS b/core/java/android/hardware/lights/OWNERS
new file mode 100644
index 0000000..cb46a80
--- /dev/null
+++ b/core/java/android/hardware/lights/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/lights/OWNERS
diff --git a/core/java/android/hardware/location/OWNERS b/core/java/android/hardware/location/OWNERS
new file mode 100644
index 0000000..383321b
--- /dev/null
+++ b/core/java/android/hardware/location/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 880425
+
+mstogaitis@google.com
+wyattriley@google.com
+etn@google.com
+weiwa@google.com
diff --git a/core/java/android/hardware/soundtrigger/OWNERS b/core/java/android/hardware/soundtrigger/OWNERS
new file mode 100644
index 0000000..816bc6b
--- /dev/null
+++ b/core/java/android/hardware/soundtrigger/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/media/soundtrigger/OWNERS
diff --git a/core/java/android/hardware/usb/OWNERS b/core/java/android/hardware/usb/OWNERS
index 8ee72b5..8f2b39d 100644
--- a/core/java/android/hardware/usb/OWNERS
+++ b/core/java/android/hardware/usb/OWNERS
@@ -1,6 +1,4 @@
-badhri@google.com
-elaurent@google.com
+# Bug component: 175220
+
moltmann@google.com
-albertccwang@google.com
-jameswei@google.com
-howardyen@google.com
\ No newline at end of file
+badhri@google.com
diff --git a/core/java/android/inputmethodservice/OWNERS b/core/java/android/inputmethodservice/OWNERS
index 4447197..e6a04da 100644
--- a/core/java/android/inputmethodservice/OWNERS
+++ b/core/java/android/inputmethodservice/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 34867
set noparent
-include ../../../../services/core/java/com/android/server/inputmethod/OWNERS
+include /services/core/java/com/android/server/inputmethod/OWNERS
diff --git a/core/java/android/metrics/OWNERS b/core/java/android/metrics/OWNERS
new file mode 100644
index 0000000..ba867e0
--- /dev/null
+++ b/core/java/android/metrics/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 26805
+
+cwren@android.com
+cwren@google.com
diff --git a/core/java/android/net/NetworkAgent.java b/core/java/android/net/NetworkAgent.java
index 0676ad4..6780167 100644
--- a/core/java/android/net/NetworkAgent.java
+++ b/core/java/android/net/NetworkAgent.java
@@ -51,7 +51,7 @@
* An agent manages the life cycle of a network. A network starts its
* life cycle when {@link register} is called on NetworkAgent. The network
* is then connecting. When full L3 connectivity has been established,
- * the agent shoud call {@link markConnected} to inform the system that
+ * the agent should call {@link markConnected} to inform the system that
* this network is ready to use. When the network disconnects its life
* ends and the agent should call {@link unregister}, at which point the
* system will clean up and free resources.
@@ -94,12 +94,6 @@
@Nullable
private volatile Network mNetwork;
- // Whether this NetworkAgent is using the legacy (never unhidden) API. The difference is
- // that the legacy API uses NetworkInfo to convey the state, while the current API is
- // exposing methods to manage it and generate it internally instead.
- // TODO : remove this as soon as all agents have been converted.
- private final boolean mIsLegacy;
-
private final Handler mHandler;
private volatile AsyncChannel mAsyncChannel;
private final String LOG_TAG;
@@ -110,8 +104,6 @@
private static final long BW_REFRESH_MIN_WIN_MS = 500;
private boolean mBandwidthUpdateScheduled = false;
private AtomicBoolean mBandwidthUpdatePending = new AtomicBoolean(false);
- // Not used by legacy agents. Non-legacy agents use this to convert the NetworkAgent system API
- // into the internal API of ConnectivityService.
@NonNull
private NetworkInfo mNetworkInfo;
@NonNull
@@ -337,35 +329,6 @@
*/
public static final int CMD_REMOVE_KEEPALIVE_PACKET_FILTER = BASE + 17;
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score) {
- this(looper, context, logTag, ni, nc, lp, score, null, NetworkProvider.ID_NONE);
- // Register done by the constructor called in the previous line
- }
-
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score, NetworkAgentConfig config) {
- this(looper, context, logTag, ni, nc, lp, score, config, NetworkProvider.ID_NONE);
- // Register done by the constructor called in the previous line
- }
-
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score, int providerId) {
- this(looper, context, logTag, ni, nc, lp, score, null, providerId);
- // Register done by the constructor called in the previous line
- }
-
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score, NetworkAgentConfig config,
- int providerId) {
- this(looper, context, logTag, nc, lp, score, config, providerId, ni, true /* legacy */);
- register();
- }
-
private static NetworkInfo getLegacyNetworkInfo(final NetworkAgentConfig config) {
// The subtype can be changed with (TODO) setLegacySubtype, but it starts
// with 0 (TelephonyManager.NETWORK_TYPE_UNKNOWN) and an empty description.
@@ -393,7 +356,7 @@
@NonNull NetworkAgentConfig config, @Nullable NetworkProvider provider) {
this(looper, context, logTag, nc, lp, score, config,
provider == null ? NetworkProvider.ID_NONE : provider.getProviderId(),
- getLegacyNetworkInfo(config), false /* legacy */);
+ getLegacyNetworkInfo(config));
}
private static class InitialConfiguration {
@@ -418,11 +381,9 @@
private NetworkAgent(@NonNull Looper looper, @NonNull Context context, @NonNull String logTag,
@NonNull NetworkCapabilities nc, @NonNull LinkProperties lp, int score,
- @NonNull NetworkAgentConfig config, int providerId, @NonNull NetworkInfo ni,
- boolean legacy) {
+ @NonNull NetworkAgentConfig config, int providerId, @NonNull NetworkInfo ni) {
mHandler = new NetworkAgentHandler(looper);
LOG_TAG = logTag;
- mIsLegacy = legacy;
mNetworkInfo = new NetworkInfo(ni);
this.providerId = providerId;
if (ni == null || nc == null || lp == null) {
@@ -696,11 +657,6 @@
* Call {@link #unregister} to disconnect.
*/
public void markConnected() {
- if (mIsLegacy) {
- throw new UnsupportedOperationException(
- "Legacy agents can't call markConnected.");
- }
- // |reason| cannot be used by the non-legacy agents
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, null /* reason */,
mNetworkInfo.getExtraInfo());
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
@@ -713,9 +669,6 @@
* the network is torn down and this agent can no longer be used.
*/
public void unregister() {
- if (mIsLegacy) {
- throw new UnsupportedOperationException("Legacy agents can't call unregister.");
- }
// When unregistering an agent nobody should use the extrainfo (or reason) any more.
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null /* reason */,
null /* extraInfo */);
@@ -735,9 +688,6 @@
*/
@Deprecated
public void setLegacySubtype(final int legacySubtype, @NonNull final String legacySubtypeName) {
- if (mIsLegacy) {
- throw new UnsupportedOperationException("Legacy agents can't call setLegacySubtype.");
- }
mNetworkInfo.setSubtype(legacySubtype, legacySubtypeName);
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
}
@@ -760,9 +710,6 @@
*/
@Deprecated
public void setLegacyExtraInfo(@Nullable final String extraInfo) {
- if (mIsLegacy) {
- throw new UnsupportedOperationException("Legacy agents can't call setLegacyExtraInfo.");
- }
mNetworkInfo.setExtraInfo(extraInfo);
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
}
@@ -773,9 +720,6 @@
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public final void sendNetworkInfo(NetworkInfo networkInfo) {
- if (!mIsLegacy) {
- throw new UnsupportedOperationException("Only legacy agents can call sendNetworkInfo.");
- }
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, new NetworkInfo(networkInfo));
}
diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java
index 8dad11f..1a37fb9 100644
--- a/core/java/android/net/NetworkCapabilities.java
+++ b/core/java/android/net/NetworkCapabilities.java
@@ -975,6 +975,10 @@
return mOwnerUid;
}
+ private boolean equalsOwnerUid(@NonNull final NetworkCapabilities nc) {
+ return mOwnerUid == nc.mOwnerUid;
+ }
+
/**
* UIDs of packages that are administrators of this network, or empty if none.
*
@@ -1684,6 +1688,7 @@
&& equalsTransportInfo(that)
&& equalsUids(that)
&& equalsSSID(that)
+ && equalsOwnerUid(that)
&& equalsPrivateDnsBroken(that)
&& equalsRequestor(that)
&& equalsAdministratorUids(that);
@@ -1697,17 +1702,18 @@
+ ((int) (mUnwantedNetworkCapabilities >> 32) * 7)
+ ((int) (mTransportTypes & 0xFFFFFFFF) * 11)
+ ((int) (mTransportTypes >> 32) * 13)
- + (mLinkUpBandwidthKbps * 17)
- + (mLinkDownBandwidthKbps * 19)
+ + mLinkUpBandwidthKbps * 17
+ + mLinkDownBandwidthKbps * 19
+ Objects.hashCode(mNetworkSpecifier) * 23
- + (mSignalStrength * 29)
- + Objects.hashCode(mUids) * 31
- + Objects.hashCode(mSSID) * 37
- + Objects.hashCode(mTransportInfo) * 41
- + Objects.hashCode(mPrivateDnsBroken) * 43
- + Objects.hashCode(mRequestorUid) * 47
- + Objects.hashCode(mRequestorPackageName) * 53
- + Arrays.hashCode(mAdministratorUids) * 59;
+ + mSignalStrength * 29
+ + mOwnerUid * 31
+ + Objects.hashCode(mUids) * 37
+ + Objects.hashCode(mSSID) * 41
+ + Objects.hashCode(mTransportInfo) * 43
+ + Objects.hashCode(mPrivateDnsBroken) * 47
+ + Objects.hashCode(mRequestorUid) * 53
+ + Objects.hashCode(mRequestorPackageName) * 59
+ + Arrays.hashCode(mAdministratorUids) * 61;
}
@Override
diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java
index a0faafa..d84ee2a 100644
--- a/core/java/android/net/NetworkUtils.java
+++ b/core/java/android/net/NetworkUtils.java
@@ -35,7 +35,6 @@
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
-import java.util.Collection;
import java.util.Locale;
import java.util.TreeSet;
@@ -342,20 +341,6 @@
}
/**
- * Create a string array of host addresses from a collection of InetAddresses
- * @param addrs a Collection of InetAddresses
- * @return an array of Strings containing their host addresses
- */
- public static String[] makeStrings(Collection<InetAddress> addrs) {
- String[] result = new String[addrs.size()];
- int i = 0;
- for (InetAddress addr : addrs) {
- result[i++] = addr.getHostAddress();
- }
- return result;
- }
-
- /**
* Trim leading zeros from IPv4 address strings
* Our base libraries will interpret that as octel..
* Must leave non v4 addresses and host names alone.
diff --git a/core/java/android/net/OWNERS b/core/java/android/net/OWNERS
index 5e2a718..4ea8a54 100644
--- a/core/java/android/net/OWNERS
+++ b/core/java/android/net/OWNERS
@@ -1,11 +1,5 @@
set noparent
-codewiz@google.com
-jchalard@google.com
-jsharkey@android.com
-junyulai@google.com
-lorenzo@google.com
-reminv@google.com
-satk@google.com
+include platform/frameworks/base:/services/core/java/com/android/server/net/OWNERS
per-file SSL*, Uri*, Url* = prb@google.com, dauletz@google.com, narayan@google.com, ngeoffray@google.com
diff --git a/core/java/android/net/Proxy.java b/core/java/android/net/Proxy.java
index f1d9669..20ccc07 100644
--- a/core/java/android/net/Proxy.java
+++ b/core/java/android/net/Proxy.java
@@ -205,7 +205,7 @@
if (host.equalsIgnoreCase("localhost")) {
return true;
}
- if (NetworkUtils.numericToInetAddress(host).isLoopbackAddress()) {
+ if (InetAddresses.parseNumericAddress(host).isLoopbackAddress()) {
return true;
}
}
diff --git a/core/java/android/net/TcpRepairWindow.java b/core/java/android/net/TcpRepairWindow.java
index 86034f0..f062fa9 100644
--- a/core/java/android/net/TcpRepairWindow.java
+++ b/core/java/android/net/TcpRepairWindow.java
@@ -16,12 +16,15 @@
package android.net;
+import android.annotation.SystemApi;
+
/**
* Corresponds to C's {@code struct tcp_repair_window} from
* include/uapi/linux/tcp.h
*
* @hide
*/
+@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public final class TcpRepairWindow {
public final int sndWl1;
public final int sndWnd;
diff --git a/core/java/android/nfc/OWNERS b/core/java/android/nfc/OWNERS
new file mode 100644
index 0000000..6aaf039
--- /dev/null
+++ b/core/java/android/nfc/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 48448
+
+zachoverflow@google.com
+alisher@google.com
diff --git a/core/java/android/nfc/cardemulation/OWNERS b/core/java/android/nfc/cardemulation/OWNERS
new file mode 100644
index 0000000..6aaf039
--- /dev/null
+++ b/core/java/android/nfc/cardemulation/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 48448
+
+zachoverflow@google.com
+alisher@google.com
diff --git a/core/java/android/nfc/dta/OWNERS b/core/java/android/nfc/dta/OWNERS
new file mode 100644
index 0000000..6aaf039
--- /dev/null
+++ b/core/java/android/nfc/dta/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 48448
+
+zachoverflow@google.com
+alisher@google.com
diff --git a/core/java/android/nfc/tech/OWNERS b/core/java/android/nfc/tech/OWNERS
new file mode 100644
index 0000000..6aaf039
--- /dev/null
+++ b/core/java/android/nfc/tech/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 48448
+
+zachoverflow@google.com
+alisher@google.com
diff --git a/core/java/android/os/BatteryConsumer.java b/core/java/android/os/BatteryConsumer.java
index d00c3c3..74880b2 100644
--- a/core/java/android/os/BatteryConsumer.java
+++ b/core/java/android/os/BatteryConsumer.java
@@ -49,6 +49,28 @@
public static final int FIRST_CUSTOM_POWER_COMPONENT_ID = 1000;
public static final int LAST_CUSTOM_POWER_COMPONENT_ID = 9999;
+ /**
+ * Time usage component, describing the particular part of the system
+ * that was used for the corresponding amount of time.
+ *
+ * @hide
+ */
+ @IntDef(prefix = {"TIME_COMPONENT_"}, value = {
+ TIME_COMPONENT_CPU,
+ TIME_COMPONENT_CPU_FOREGROUND,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public static @interface TimeComponent {
+ }
+
+ public static final int TIME_COMPONENT_CPU = 0;
+ public static final int TIME_COMPONENT_CPU_FOREGROUND = 1;
+
+ public static final int TIME_COMPONENT_COUNT = 2;
+
+ public static final int FIRST_CUSTOM_TIME_COMPONENT_ID = 1000;
+ public static final int LAST_CUSTOM_TIME_COMPONENT_ID = 9999;
+
private final PowerComponents mPowerComponents;
protected BatteryConsumer(@NonNull PowerComponents powerComponents) {
@@ -83,6 +105,29 @@
return mPowerComponents.getConsumedPowerForCustomComponent(componentId);
}
+ /**
+ * Returns the amount of time since BatteryStats reset used by the specified component, e.g.
+ * CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationMillis(@TimeComponent int componentId) {
+ return mPowerComponents.getUsageDurationMillis(componentId);
+ }
+
+ /**
+ * Returns the amount of usage time attributed to the specified custom component
+ * since BatteryStats reset.
+ *
+ * @param componentId The ID of the custom power component.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationForCustomComponentMillis(int componentId) {
+ return mPowerComponents.getUsageDurationForCustomComponentMillis(componentId);
+ }
+
protected void writeToParcel(Parcel dest, int flags) {
mPowerComponents.writeToParcel(dest, flags);
}
diff --git a/core/java/android/os/BatteryUsageStats.java b/core/java/android/os/BatteryUsageStats.java
index 3f036cd..79f58f6 100644
--- a/core/java/android/os/BatteryUsageStats.java
+++ b/core/java/android/os/BatteryUsageStats.java
@@ -35,7 +35,11 @@
private BatteryUsageStats(@NonNull Builder builder) {
mConsumedPower = builder.mConsumedPower;
mDischargePercentage = builder.mDischargePercentage;
- mUidBatteryConsumers = builder.mUidBatteryConsumers;
+ final int uidBatteryConsumerCount = builder.mUidBatteryConsumerBuilders.size();
+ mUidBatteryConsumers = new ArrayList<>(uidBatteryConsumerCount);
+ for (int i = 0; i < uidBatteryConsumerCount; i++) {
+ mUidBatteryConsumers.add(builder.mUidBatteryConsumerBuilders.get(i).build());
+ }
}
/**
@@ -95,7 +99,8 @@
public static final class Builder {
private double mConsumedPower;
private int mDischargePercentage;
- private final ArrayList<UidBatteryConsumer> mUidBatteryConsumers = new ArrayList<>();
+ private final ArrayList<UidBatteryConsumer.Builder> mUidBatteryConsumerBuilders =
+ new ArrayList<>();
/**
* Constructs a read-only object using the Builder values.
@@ -130,9 +135,15 @@
* individual UID.
*/
@NonNull
- public Builder addUidBatteryConsumer(@NonNull UidBatteryConsumer uidBatteryConsumer) {
- mUidBatteryConsumers.add(uidBatteryConsumer);
+ public Builder addUidBatteryConsumerBuilder(
+ @NonNull UidBatteryConsumer.Builder uidBatteryConsumer) {
+ mUidBatteryConsumerBuilders.add(uidBatteryConsumer);
return this;
}
+
+ @NonNull
+ public List<UidBatteryConsumer.Builder> getUidBatteryConsumerBuilders() {
+ return mUidBatteryConsumerBuilders;
+ }
}
}
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index bd18150..8148c45 100755
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -107,12 +107,24 @@
public static final String HARDWARE = getString("ro.hardware");
/**
- * The hardware variant (SKU), if available.
+ * The SKU of the hardware (from the kernel command line). The SKU is reported by the bootloader
+ * to configure system software features.
*/
@NonNull
public static final String SKU = getString("ro.boot.hardware.sku");
/**
+ * The SKU of the device as set by the original design manufacturer (ODM). This is a
+ * runtime-initialized property set during startup to configure device services.
+ *
+ * <p>The ODM SKU may have multiple variants for the same system SKU in case a manufacturer
+ * produces variants of the same design. For example, the same build may be released with
+ * variations in physical keyboard and/or display hardware, each with a different ODM SKU.
+ */
+ @NonNull
+ public static final String ODM_SKU = getString("ro.boot.product.hardware.sku");
+
+ /**
* Whether this build was for an emulator device.
* @hide
*/
diff --git a/core/java/android/os/CombinedVibrationEffect.java b/core/java/android/os/CombinedVibrationEffect.java
index c9ebc1b..7ec7fff 100644
--- a/core/java/android/os/CombinedVibrationEffect.java
+++ b/core/java/android/os/CombinedVibrationEffect.java
@@ -30,8 +30,6 @@
* Vibrator Vibrators}.
*
* These effects may be any number of things, from single shot vibrations to complex waveforms.
- *
- * @hide
* @see VibrationEffect
*/
@SuppressWarnings({"ParcelNotFinal", "ParcelCreator"}) // Parcel only extended here.
@@ -94,7 +92,6 @@
/**
* A combination of haptic effects that should be played in multiple vibrators in sync.
*
- * @hide
* @see CombinedVibrationEffect#startSynced()
*/
public static final class SyncedCombination {
@@ -144,7 +141,6 @@
/**
* A combination of haptic effects that should be played in multiple vibrators in sequence.
*
- * @hide
* @see CombinedVibrationEffect#startSequential()
*/
public static final class SequentialCombination {
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index e1d9005..25d84ba 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -321,16 +321,6 @@
void setFirewallChainEnabled(int chain, boolean enable);
/**
- * Set all packets from users in ranges to go through VPN specified by netId.
- */
- void addVpnUidRanges(int netId, in UidRange[] ranges);
-
- /**
- * Clears the special VPN rules for users in ranges and VPN specified by netId.
- */
- void removeVpnUidRanges(int netId, in UidRange[] ranges);
-
- /**
* Start listening for mobile activity state changes.
*/
void registerNetworkActivityListener(INetworkActivityListener listener);
@@ -361,7 +351,5 @@
void removeInterfaceFromLocalNetwork(String iface);
int removeRoutesFromLocalNetwork(in List<RouteInfo> routes);
- void setAllowOnlyVpnForUids(boolean enable, in UidRange[] uidRanges);
-
boolean isNetworkRestricted(int uid);
}
diff --git a/core/java/android/os/IVibratorManagerService.aidl b/core/java/android/os/IVibratorManagerService.aidl
index 08d2019..804dc10 100644
--- a/core/java/android/os/IVibratorManagerService.aidl
+++ b/core/java/android/os/IVibratorManagerService.aidl
@@ -18,10 +18,14 @@
import android.os.CombinedVibrationEffect;
import android.os.VibrationAttributes;
+import android.os.VibratorInfo;
/** {@hide} */
interface IVibratorManagerService {
int[] getVibratorIds();
+ VibratorInfo getVibratorInfo(int vibratorId);
+ boolean setAlwaysOnEffect(int uid, String opPkg, int alwaysOnId,
+ in CombinedVibrationEffect effect, in VibrationAttributes attributes);
void vibrate(int uid, String opPkg, in CombinedVibrationEffect effect,
in VibrationAttributes attributes, String reason, IBinder token);
void cancelVibrate(IBinder token);
diff --git a/core/java/android/os/IVibratorService.aidl b/core/java/android/os/IVibratorService.aidl
index 615ae65..1cd48dc 100644
--- a/core/java/android/os/IVibratorService.aidl
+++ b/core/java/android/os/IVibratorService.aidl
@@ -18,6 +18,7 @@
import android.os.VibrationEffect;
import android.os.VibrationAttributes;
+import android.os.VibratorInfo;
import android.os.IVibratorStateListener;
/** {@hide} */
@@ -25,13 +26,10 @@
{
boolean hasVibrator();
boolean isVibrating();
+ VibratorInfo getVibratorInfo();
boolean registerVibratorStateListener(in IVibratorStateListener listener);
boolean unregisterVibratorStateListener(in IVibratorStateListener listener);
boolean hasAmplitudeControl();
- int[] areEffectsSupported(in int[] effectIds);
- boolean[] arePrimitivesSupported(in int[] primitiveIds);
- boolean setAlwaysOnEffect(int uid, String opPkg, int alwaysOnId, in VibrationEffect effect,
- in VibrationAttributes attributes);
void vibrate(int uid, String opPkg, in VibrationEffect effect,
in VibrationAttributes attributes, String reason, IBinder token);
void cancelVibrate(IBinder token);
diff --git a/core/java/android/os/OWNERS b/core/java/android/os/OWNERS
index 91eb2a5..3b334a7 100644
--- a/core/java/android/os/OWNERS
+++ b/core/java/android/os/OWNERS
@@ -16,7 +16,16 @@
per-file PowerManager.java = michaelwr@google.com, santoscordon@google.com
per-file PowerManagerInternal.java = michaelwr@google.com, santoscordon@google.com
-# Zygote
-per-file ZygoteProcess.java = calin@google.com, chriswailes@google.com, maco@google.com, narayan@google.com, ngeoffray@google.com
+# BatteryStats
+per-file *BatteryConsumer* = file:/BATTERY_STATS_OWNERS
+per-file BatteryManager* = file:/BATTERY_STATS_OWNERS
+per-file BatteryStats* = file:/BATTERY_STATS_OWNERS
+per-file BatteryUsageStats* = file:/BATTERY_STATS_OWNERS
+per-file PowerComponents.java = file:/BATTERY_STATS_OWNERS
per-file GraphicsEnvironment.java = chrisforbes@google.com, cnorthrop@google.com, lpy@google.com, timvp@google.com, zzyiwei@google.com
+
+per-file *Network* = file:/services/core/java/com/android/server/net/OWNERS
+per-file *Power* = file:/services/core/java/com/android/server/power/OWNERS
+per-file *Telephony* = file:/telephony/OWNERS
+per-file *Zygote* = file:/ZYGOTE_OWNERS
diff --git a/core/java/android/os/PowerComponents.java b/core/java/android/os/PowerComponents.java
index 42ba1ff..c18fff6 100644
--- a/core/java/android/os/PowerComponents.java
+++ b/core/java/android/os/PowerComponents.java
@@ -29,21 +29,25 @@
private final double mTotalPowerConsumed;
private final double[] mPowerComponents;
+ private final long[] mTimeComponents;
PowerComponents(@NonNull Builder builder) {
mTotalPowerConsumed = builder.mTotalPowerConsumed;
mPowerComponents = builder.mPowerComponents;
+ mTimeComponents = builder.mTimeComponents;
}
PowerComponents(@NonNull Parcel source) {
mTotalPowerConsumed = source.readDouble();
mPowerComponents = source.createDoubleArray();
+ mTimeComponents = source.createLongArray();
}
/** Writes contents to Parcel */
void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeDouble(mTotalPowerConsumed);
dest.writeDoubleArray(mPowerComponents);
+ dest.writeLongArray(mTimeComponents);
}
/**
@@ -94,15 +98,58 @@
}
/**
+ * Returns the amount of time used by the specified component, e.g. CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationMillis(@UidBatteryConsumer.TimeComponent int componentId) {
+ if (componentId >= UidBatteryConsumer.TIME_COMPONENT_COUNT) {
+ throw new IllegalArgumentException(
+ "Unsupported time component ID: " + componentId);
+ }
+ try {
+ return mTimeComponents[componentId];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException("Unsupported power component ID: " + componentId);
+ }
+ }
+
+ /**
+ * Returns the amount of usage time attributed to the specified custom component.
+ *
+ * @param componentId The ID of the custom power component.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationForCustomComponentMillis(int componentId) {
+ if (componentId < UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ try {
+ return mTimeComponents[
+ UidBatteryConsumer.TIME_COMPONENT_COUNT + componentId
+ - UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ }
+
+ /**
* Builder for PowerComponents.
*/
static final class Builder {
private double mTotalPowerConsumed;
private final double[] mPowerComponents;
+ private final long[] mTimeComponents;
- Builder(int customPowerComponentCount) {
- mPowerComponents = new double[BatteryConsumer.POWER_COMPONENT_COUNT
+ Builder(int customPowerComponentCount, int customTimeComponentCount) {
+ mPowerComponents = new double[UidBatteryConsumer.POWER_COMPONENT_COUNT
+ customPowerComponentCount];
+ mTimeComponents = new long[UidBatteryConsumer.TIME_COMPONENT_COUNT
+ + customTimeComponentCount];
}
/**
@@ -160,6 +207,53 @@
}
/**
+ * Sets the amount of time used by the specified component, e.g. CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationMillis(@UidBatteryConsumer.TimeComponent int componentId,
+ long componentUsageDurationMillis) {
+ if (componentId >= UidBatteryConsumer.TIME_COMPONENT_COUNT) {
+ throw new IllegalArgumentException(
+ "Unsupported time component ID: " + componentId);
+ }
+ try {
+ mTimeComponents[componentId] = componentUsageDurationMillis;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException(
+ "Unsupported time component ID: " + componentId);
+ }
+ return this;
+ }
+
+ /**
+ * Sets the amount of time used by the specified custom component.
+ *
+ * @param componentId The ID of the custom power component.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationForCustomComponentMillis(int componentId,
+ long componentUsageDurationMillis) {
+ if (componentId < UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ try {
+ mTimeComponents[UidBatteryConsumer.TIME_COMPONENT_COUNT + componentId
+ - UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID] =
+ componentUsageDurationMillis;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ return this;
+ }
+
+ /**
* Creates a read-only object out of the Builder values.
*/
@NonNull
diff --git a/core/java/android/os/RemoteException.java b/core/java/android/os/RemoteException.java
index 98c66d1..e9fc2f3 100644
--- a/core/java/android/os/RemoteException.java
+++ b/core/java/android/os/RemoteException.java
@@ -37,6 +37,11 @@
super(message, cause, enableSuppression, writableStackTrace);
}
+ /** @hide */
+ public RemoteException(Throwable cause) {
+ this(cause.getMessage(), cause, true, false);
+ }
+
/**
* Rethrow this as an unchecked runtime exception.
* <p>
diff --git a/core/java/android/os/StatFs.java b/core/java/android/os/StatFs.java
index eb8e717..bb6066e 100644
--- a/core/java/android/os/StatFs.java
+++ b/core/java/android/os/StatFs.java
@@ -109,7 +109,7 @@
* The total number of blocks that are free on the file system, including
* reserved blocks (that are not available to normal applications). This
* corresponds to the Unix {@code statvfs.f_bfree} field. Most applications
- * will want to use {@link #getAvailableBlocks()} instead.
+ * will want to use {@link #getAvailableBlocksLong()} instead.
*/
public long getFreeBlocksLong() {
return mStat.f_bfree;
diff --git a/core/java/android/os/SystemVibrator.java b/core/java/android/os/SystemVibrator.java
index 5c9067a..0330500 100644
--- a/core/java/android/os/SystemVibrator.java
+++ b/core/java/android/os/SystemVibrator.java
@@ -18,6 +18,7 @@
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.media.AudioAttributes;
@@ -38,8 +39,12 @@
private static final String TAG = "Vibrator";
private final IVibratorService mService;
+ private final IVibratorManagerService mManagerService;
+ private final Object mLock = new Object();
private final Binder mToken = new Binder();
private final Context mContext;
+ @GuardedBy("mLock")
+ private VibratorInfo mVibratorInfo;
@GuardedBy("mDelegates")
private final ArrayMap<OnVibratorStateChangedListener,
@@ -49,6 +54,8 @@
public SystemVibrator() {
mContext = null;
mService = IVibratorService.Stub.asInterface(ServiceManager.getService("vibrator"));
+ mManagerService = IVibratorManagerService.Stub.asInterface(
+ ServiceManager.getService("vibrator_manager"));
}
@UnsupportedAppUsage
@@ -56,6 +63,8 @@
super(context);
mContext = context;
mService = IVibratorService.Stub.asInterface(ServiceManager.getService("vibrator"));
+ mManagerService = IVibratorManagerService.Stub.asInterface(
+ ServiceManager.getService("vibrator_manager"));
}
@Override
@@ -207,13 +216,14 @@
@Override
public boolean setAlwaysOnEffect(int uid, String opPkg, int alwaysOnId, VibrationEffect effect,
AudioAttributes attributes) {
- if (mService == null) {
+ if (mManagerService == null) {
Log.w(TAG, "Failed to set always-on effect; no vibrator service.");
return false;
}
try {
VibrationAttributes atr = new VibrationAttributes.Builder(attributes, effect).build();
- return mService.setAlwaysOnEffect(uid, opPkg, alwaysOnId, effect, atr);
+ CombinedVibrationEffect combinedEffect = CombinedVibrationEffect.createSynced(effect);
+ return mManagerService.setAlwaysOnEffect(uid, opPkg, alwaysOnId, combinedEffect, atr);
} catch (RemoteException e) {
Log.w(TAG, "Failed to set always-on effect.", e);
}
@@ -236,26 +246,28 @@
@Override
public int[] areEffectsSupported(@VibrationEffect.EffectType int... effectIds) {
- try {
- return mService.areEffectsSupported(effectIds);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to query effect support");
- throw e.rethrowAsRuntimeException();
+ VibratorInfo vibratorInfo = getVibratorInfo();
+ int[] supported = new int[effectIds.length];
+ for (int i = 0; i < effectIds.length; i++) {
+ supported[i] = vibratorInfo == null
+ ? Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN
+ : vibratorInfo.isEffectSupported(effectIds[i]);
}
+ return supported;
}
@Override
public boolean[] arePrimitivesSupported(
@NonNull @VibrationEffect.Composition.Primitive int... primitiveIds) {
- try {
- return mService.arePrimitivesSupported(primitiveIds);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to query effect support");
- throw e.rethrowAsRuntimeException();
+ VibratorInfo vibratorInfo = getVibratorInfo();
+ boolean[] supported = new boolean[primitiveIds.length];
+ for (int i = 0; i < primitiveIds.length; i++) {
+ supported[i] = vibratorInfo == null
+ ? false : vibratorInfo.isPrimitiveSupported(primitiveIds[i]);
}
+ return supported;
}
-
@Override
public void cancel() {
if (mService == null) {
@@ -267,4 +279,22 @@
Log.w(TAG, "Failed to cancel vibration.", e);
}
}
+
+ @Nullable
+ private VibratorInfo getVibratorInfo() {
+ try {
+ synchronized (mLock) {
+ if (mVibratorInfo != null) {
+ return mVibratorInfo;
+ }
+ if (mService == null) {
+ return null;
+ }
+ return mVibratorInfo = mService.getVibratorInfo();
+ }
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed to query vibrator info");
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
diff --git a/core/java/android/os/UidBatteryConsumer.java b/core/java/android/os/UidBatteryConsumer.java
index 7dcbf7d..d12ccb5 100644
--- a/core/java/android/os/UidBatteryConsumer.java
+++ b/core/java/android/os/UidBatteryConsumer.java
@@ -82,12 +82,24 @@
*/
public static final class Builder {
private final PowerComponents.Builder mPowerComponentsBuilder;
+ private final BatteryStats.Uid mBatteryStatsUid;
private final int mUid;
private String mPackageWithHighestDrain;
- public Builder(int customPowerComponentCount, int uid) {
- mPowerComponentsBuilder = new PowerComponents.Builder(customPowerComponentCount);
- mUid = uid;
+ public Builder(int customPowerComponentCount, int customTimeComponentCount,
+ BatteryStats.Uid batteryStatsUid) {
+ mPowerComponentsBuilder = new PowerComponents.Builder(customPowerComponentCount,
+ customTimeComponentCount);
+ mBatteryStatsUid = batteryStatsUid;
+ mUid = batteryStatsUid.getUid();
+ }
+
+ public BatteryStats.Uid getBatteryStatsUid() {
+ return mBatteryStatsUid;
+ }
+
+ public int getUid() {
+ return mUid;
}
/**
@@ -102,7 +114,7 @@
* Sets the amount of drain attributed to the specified drain type, e.g. CPU, WiFi etc.
*
* @param componentId The ID of the power component, e.g.
- * {@link BatteryConsumer#POWER_COMPONENT_CPU}.
+ * {@link BatteryConsumer#POWER_COMPONENT_CPU}.
* @param componentPower Amount of consumed power in mAh.
*/
@NonNull
@@ -133,6 +145,35 @@
}
/**
+ * Sets the amount of time used by the specified component, e.g. CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationMillis(@UidBatteryConsumer.TimeComponent int componentId,
+ long componentUsageDurationMillis) {
+ mPowerComponentsBuilder.setUsageDurationMillis(componentId,
+ componentUsageDurationMillis);
+ return this;
+ }
+
+ /**
+ * Sets the amount of time used by the specified custom component.
+ *
+ * @param componentId The ID of the custom power component.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationForCustomComponentMillis(int componentId,
+ long componentUsageDurationMillis) {
+ mPowerComponentsBuilder.setUsageDurationForCustomComponentMillis(componentId,
+ componentUsageDurationMillis);
+ return this;
+ }
+
+ /**
* Sets the name of the package owned by this UID that consumed the highest amount
* of power since BatteryStats reset.
*/
diff --git a/core/java/android/os/UserHandle.java b/core/java/android/os/UserHandle.java
index d672024..7e50ebc 100644
--- a/core/java/android/os/UserHandle.java
+++ b/core/java/android/os/UserHandle.java
@@ -223,6 +223,14 @@
}
/**
+ * Whether a UID belongs to a shared app gid.
+ * @hide
+ */
+ public static boolean isSharedAppGid(int uid) {
+ return getAppIdFromSharedAppGid(uid) != -1;
+ }
+
+ /**
* Returns the user for a given uid.
* @param uid A uid for an application running in a particular user.
* @return A {@link UserHandle} for that user.
diff --git a/core/java/android/os/VibrationEffect.java b/core/java/android/os/VibrationEffect.java
index f76eb86..b57418d 100644
--- a/core/java/android/os/VibrationEffect.java
+++ b/core/java/android/os/VibrationEffect.java
@@ -477,6 +477,28 @@
}
/** @hide */
+ public static String effectIdToString(int effectId) {
+ switch (effectId) {
+ case EFFECT_CLICK:
+ return "CLICK";
+ case EFFECT_TICK:
+ return "TICK";
+ case EFFECT_HEAVY_CLICK:
+ return "HEAVY_CLICK";
+ case EFFECT_DOUBLE_CLICK:
+ return "DOUBLE_CLICK";
+ case EFFECT_POP:
+ return "POP";
+ case EFFECT_THUD:
+ return "THUD";
+ case EFFECT_TEXTURE_TICK:
+ return "TEXTURE_TICK";
+ default:
+ return Integer.toString(effectId);
+ }
+ }
+
+ /** @hide */
@TestApi
public static class OneShot extends VibrationEffect implements Parcelable {
private final long mDuration;
@@ -1201,10 +1223,8 @@
return "PRIMITIVE_QUICK_FALL";
case PRIMITIVE_TICK:
return "PRIMITIVE_TICK";
-
default:
return Integer.toString(id);
-
}
}
diff --git a/core/java/android/os/VibratorInfo.aidl b/core/java/android/os/VibratorInfo.aidl
new file mode 100644
index 0000000..9a7cb13
--- /dev/null
+++ b/core/java/android/os/VibratorInfo.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2020 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.os;
+
+parcelable VibratorInfo;
diff --git a/core/java/android/os/VibratorInfo.java b/core/java/android/os/VibratorInfo.java
new file mode 100644
index 0000000..07272e7
--- /dev/null
+++ b/core/java/android/os/VibratorInfo.java
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2020 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.os;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.util.SparseBooleanArray;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * A VibratorInfo describes the capabilities of a {@link Vibrator}.
+ *
+ * This description includes its capabilities, list of supported effects and composition primitives.
+ *
+ * @hide
+ */
+public final class VibratorInfo implements Parcelable {
+
+ /**
+ * Capability to set amplitude values to vibrations.
+ * @hide
+ */
+ // Internally this maps to the HAL constant IVibrator::CAP_AMPLITUDE_CONTROL
+ public static final int CAPABILITY_AMPLITUDE_CONTROL = 4;
+
+ /**
+ * Capability to compose primitives into a single effect.
+ * @hide
+ */
+ // Internally this maps to the HAL constant IVibrator::CAP_COMPOSE_EFFECTS
+ public static final int CAPABILITY_COMPOSE_EFFECTS = 32;
+
+ private final int mId;
+ private final long mCapabilities;
+ @Nullable
+ private final SparseBooleanArray mSupportedEffects;
+ @Nullable
+ private final SparseBooleanArray mSupportedPrimitives;
+
+ VibratorInfo(Parcel in) {
+ mId = in.readInt();
+ mCapabilities = in.readLong();
+ mSupportedEffects = in.readSparseBooleanArray();
+ mSupportedPrimitives = in.readSparseBooleanArray();
+ }
+
+ /** @hide */
+ public VibratorInfo(int id, long capabilities, int[] supportedEffects,
+ int[] supportedPrimitives) {
+ mId = id;
+ mCapabilities = capabilities;
+ mSupportedEffects = toSparseBooleanArray(supportedEffects);
+ mSupportedPrimitives = toSparseBooleanArray(supportedPrimitives);
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mId);
+ dest.writeLong(mCapabilities);
+ dest.writeSparseBooleanArray(mSupportedEffects);
+ dest.writeSparseBooleanArray(mSupportedPrimitives);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof VibratorInfo)) {
+ return false;
+ }
+ VibratorInfo that = (VibratorInfo) o;
+ return mId == that.mId && mCapabilities == that.mCapabilities
+ && Objects.equals(mSupportedEffects, that.mSupportedEffects)
+ && Objects.equals(mSupportedPrimitives, that.mSupportedPrimitives);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mId, mCapabilities, mSupportedEffects, mSupportedPrimitives);
+ }
+
+ @Override
+ public String toString() {
+ return "VibratorInfo{"
+ + "mId=" + mId
+ + ", mCapabilities=" + Arrays.toString(getCapabilitiesNames())
+ + ", mCapabilities flags=" + mCapabilities
+ + ", mSupportedEffects=" + Arrays.toString(getSupportedEffectsNames())
+ + ", mSupportedPrimitives=" + Arrays.toString(getSupportedPrimitivesNames())
+ + '}';
+ }
+
+ /** Return the id of this vibrator. */
+ public int getId() {
+ return mId;
+ }
+
+ /**
+ * Check whether the vibrator has amplitude control.
+ *
+ * @return True if the hardware can control the amplitude of the vibrations, otherwise false.
+ */
+ public boolean hasAmplitudeControl() {
+ return hasCapability(CAPABILITY_AMPLITUDE_CONTROL);
+ }
+
+ /**
+ * Query whether the vibrator supports the given effect.
+ *
+ * @param effectId Which effects to query for.
+ * @return {@link Vibrator#VIBRATION_EFFECT_SUPPORT_YES} if the effect is supported,
+ * {@link Vibrator#VIBRATION_EFFECT_SUPPORT_NO} if it isn't supported, or
+ * {@link Vibrator#VIBRATION_EFFECT_SUPPORT_UNKNOWN} if the system can't determine whether it's
+ * supported or not.
+ */
+ @Vibrator.VibrationEffectSupport
+ public int isEffectSupported(@VibrationEffect.EffectType int effectId) {
+ if (mSupportedEffects == null) {
+ return Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN;
+ }
+ return mSupportedEffects.get(effectId, false) ? Vibrator.VIBRATION_EFFECT_SUPPORT_YES
+ : Vibrator.VIBRATION_EFFECT_SUPPORT_NO;
+ }
+
+ /**
+ * Query whether the vibrator supports the given primitive.
+ *
+ * @param primitiveId Which primitives to query for.
+ * @return Whether the primitive is supported.
+ */
+ public boolean isPrimitiveSupported(@VibrationEffect.Composition.Primitive int primitiveId) {
+ return hasCapability(CAPABILITY_COMPOSE_EFFECTS) && mSupportedPrimitives != null
+ && mSupportedPrimitives.get(primitiveId, false);
+ }
+
+ /**
+ * Check against this vibrator capabilities.
+ *
+ * @param capability one of IVibrator.CAP_*
+ * @return true if this vibrator has this capability, false otherwise
+ * @hide
+ */
+ public boolean hasCapability(long capability) {
+ return (mCapabilities & capability) == capability;
+ }
+
+ private String[] getCapabilitiesNames() {
+ List<String> names = new ArrayList<>();
+ if (hasCapability(CAPABILITY_AMPLITUDE_CONTROL)) {
+ names.add("AMPLITUDE_CONTROL");
+ }
+ if (hasCapability(CAPABILITY_COMPOSE_EFFECTS)) {
+ names.add("COMPOSE_EFFECTS");
+ }
+ return names.toArray(new String[names.size()]);
+ }
+
+ private String[] getSupportedEffectsNames() {
+ if (mSupportedEffects == null) {
+ return new String[0];
+ }
+ String[] names = new String[mSupportedEffects.size()];
+ for (int i = 0; i < mSupportedEffects.size(); i++) {
+ names[i] = VibrationEffect.effectIdToString(mSupportedEffects.keyAt(i));
+ }
+ return names;
+ }
+
+ private String[] getSupportedPrimitivesNames() {
+ if (mSupportedPrimitives == null) {
+ return new String[0];
+ }
+ String[] names = new String[mSupportedPrimitives.size()];
+ for (int i = 0; i < mSupportedPrimitives.size(); i++) {
+ names[i] = VibrationEffect.Composition.primitiveToString(mSupportedPrimitives.keyAt(i));
+ }
+ return names;
+ }
+
+ @Nullable
+ private static SparseBooleanArray toSparseBooleanArray(int[] values) {
+ if (values == null) {
+ return null;
+ }
+ SparseBooleanArray array = new SparseBooleanArray();
+ for (int value : values) {
+ array.put(value, true);
+ }
+ return array;
+ }
+
+ @NonNull
+ public static final Creator<VibratorInfo> CREATOR =
+ new Creator<VibratorInfo>() {
+ @Override
+ public VibratorInfo createFromParcel(Parcel in) {
+ return new VibratorInfo(in);
+ }
+
+ @Override
+ public VibratorInfo[] newArray(int size) {
+ return new VibratorInfo[size];
+ }
+ };
+}
diff --git a/core/java/android/os/VibratorManager.java b/core/java/android/os/VibratorManager.java
new file mode 100644
index 0000000..1d5a587
--- /dev/null
+++ b/core/java/android/os/VibratorManager.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2020 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.os;
+
+import android.annotation.NonNull;
+
+/**
+ * VibratorManager provides access to multiple vibrators, as well as the ability to run them in
+ * a synchronized fashion.
+ */
+public abstract class VibratorManager {
+ /** @hide */
+ protected static final String TAG = "VibratorManager";
+
+ /**
+ * {@hide}
+ */
+ public VibratorManager() {
+ }
+
+ /**
+ * This method lists all available actuator ids, returning a possible empty list.
+ * If the device has only a single actuator, this should return a single entry with a
+ * default id.
+ */
+ @NonNull
+ public abstract int[] getVibratorIds();
+
+ /**
+ * Returns a Vibrator service for given id.
+ * This allows users to perform a vibration effect on a single actuator.
+ */
+ @NonNull
+ public abstract Vibrator getVibrator(int vibratorId);
+
+ /**
+ * Returns the system default Vibrator service.
+ */
+ @NonNull
+ public abstract Vibrator getDefaultVibrator();
+
+ /**
+ * Vibrates all actuators by passing each VibrationEffect within CombinedVibrationEffect
+ * to the respective actuator, in sync.
+ */
+ public abstract void vibrate(@NonNull CombinedVibrationEffect effect);
+}
diff --git a/core/java/android/os/connectivity/OWNERS b/core/java/android/os/connectivity/OWNERS
new file mode 100644
index 0000000..a0f0238
--- /dev/null
+++ b/core/java/android/os/connectivity/OWNERS
@@ -0,0 +1 @@
+dplotnikov@google.com
diff --git a/core/java/android/os/health/OWNERS b/core/java/android/os/health/OWNERS
new file mode 100644
index 0000000..6045344
--- /dev/null
+++ b/core/java/android/os/health/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 26805
+
+dplotnikov@google.com
+mwachens@google.com
diff --git a/core/java/android/os/image/OWNERS b/core/java/android/os/image/OWNERS
new file mode 100644
index 0000000..389b55b
--- /dev/null
+++ b/core/java/android/os/image/OWNERS
@@ -0,0 +1 @@
+andrewhsieh@google.com
diff --git a/core/java/android/os/storage/OWNERS b/core/java/android/os/storage/OWNERS
new file mode 100644
index 0000000..8af7de5
--- /dev/null
+++ b/core/java/android/os/storage/OWNERS
@@ -0,0 +1,7 @@
+# Bug component: 95221
+
+narayan@google.com
+nandana@google.com
+corinac@google.com
+zezeozue@google.com
+maco@google.com
diff --git a/core/java/android/permission/ILegacyPermissionManager.aidl b/core/java/android/permission/ILegacyPermissionManager.aidl
new file mode 100644
index 0000000..3bd4bf5
--- /dev/null
+++ b/core/java/android/permission/ILegacyPermissionManager.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2019 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.permission;
+
+import android.content.pm.ParceledListSlice;
+import android.content.pm.PermissionGroupInfo;
+import android.content.pm.PermissionInfo;
+import android.content.pm.permission.SplitPermissionInfoParcelable;
+import android.os.UserHandle;
+import android.permission.IOnPermissionsChangeListener;
+
+/**
+ * Interface to communicate directly with the legacy permission manager service.
+ *
+ * @see PermissionManager
+ * @hide
+ */
+interface ILegacyPermissionManager {
+ int checkDeviceIdentifierAccess(String packageName, String callingFeatureId, String message, int pid, int uid);
+
+ void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
+
+ void grantDefaultPermissionsToEnabledImsServices(in String[] packageNames, int userId);
+
+ void grantDefaultPermissionsToEnabledTelephonyDataServices(
+ in String[] packageNames, int userId);
+
+ void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ in String[] packageNames, int userId);
+
+ void grantDefaultPermissionsToActiveLuiApp(in String packageName, int userId);
+
+ void revokeDefaultPermissionsFromLuiApps(in String[] packageNames, int userId);
+}
diff --git a/core/java/android/permission/IPermissionManager.aidl b/core/java/android/permission/IPermissionManager.aidl
index a94077d..4ad17ef 100644
--- a/core/java/android/permission/IPermissionManager.aidl
+++ b/core/java/android/permission/IPermissionManager.aidl
@@ -52,8 +52,6 @@
int checkUidPermission(String permName, int uid);
- int checkDeviceIdentifierAccess(String packageName, String callingFeatureId, String message, int pid, int uid);
-
void addOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
void removeOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
@@ -73,20 +71,6 @@
void resetRuntimePermissions();
- void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
-
- void grantDefaultPermissionsToEnabledImsServices(in String[] packageNames, int userId);
-
- void grantDefaultPermissionsToEnabledTelephonyDataServices(
- in String[] packageNames, int userId);
-
- void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- in String[] packageNames, int userId);
-
- void grantDefaultPermissionsToActiveLuiApp(in String packageName, int userId);
-
- void revokeDefaultPermissionsFromLuiApps(in String[] packageNames, int userId);
-
boolean shouldShowRequestPermissionRationale(String permName,
String packageName, int userId);
diff --git a/core/java/android/permission/LegacyPermissionManager.java b/core/java/android/permission/LegacyPermissionManager.java
new file mode 100644
index 0000000..b66dd82
--- /dev/null
+++ b/core/java/android/permission/LegacyPermissionManager.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2018 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.permission;
+
+import android.Manifest;
+import android.annotation.CallbackExecutor;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
+import android.annotation.SystemService;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.UserHandle;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.util.concurrent.Executor;
+import java.util.function.Consumer;
+
+/**
+ * System level service for accessing the permission capabilities of the platform, version 2.
+ *
+ * @hide
+ */
+//@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+@SystemService(Context.LEGACY_PERMISSION_SERVICE)
+public final class LegacyPermissionManager {
+ private final ILegacyPermissionManager mLegacyPermissionManager;
+
+ /**
+ * Creates a new instance.
+ *
+ * @hide
+ */
+ public LegacyPermissionManager() throws ServiceManager.ServiceNotFoundException {
+ this(ILegacyPermissionManager.Stub.asInterface(ServiceManager.getServiceOrThrow(
+ "legacy_permission")));
+ }
+
+ /**
+ * Creates a new instance with the provided instantiation of the ILegacyPermissionManager.
+ *
+ * @param legacyPermissionManager injectable legacy permission manager service
+ *
+ * @hide
+ */
+ @VisibleForTesting
+ public LegacyPermissionManager(@NonNull ILegacyPermissionManager legacyPermissionManager) {
+ mLegacyPermissionManager = legacyPermissionManager;
+ }
+
+ /**
+ * Checks whether the package with the given pid/uid can read device identifiers.
+ *
+ * @param packageName the name of the package to be checked for identifier access
+ * @param message the message to be used for logging during identifier access
+ * verification
+ * @param callingFeatureId the feature in the package
+ * @param pid the process id of the package to be checked
+ * @param uid the uid of the package to be checked
+ * @return {@link PackageManager#PERMISSION_GRANTED} if the package is allowed identifier
+ * access, {@link PackageManager#PERMISSION_DENIED} otherwise
+ * @hide
+ */
+ //@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
+ @Nullable String callingFeatureId, int pid, int uid) {
+ try {
+ return mLegacyPermissionManager.checkDeviceIdentifierAccess(packageName, message,
+ callingFeatureId, pid, uid);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently active LUI app
+ * @param packageName The package name for the LUI app
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToLuiApp(
+ @NonNull String packageName, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToActiveLuiApp(
+ packageName, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Revoke default permissions to currently active LUI app
+ * @param packageNames The package names for the LUI apps
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void revokeDefaultPermissionsFromLuiApps(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.revokeDefaultPermissionsFromLuiApps(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently active Ims services
+ * @param packageNames The package names for the Ims services
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToEnabledImsServices(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToEnabledImsServices(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently enabled telephony data services
+ * @param packageNames The package name for the services
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToEnabledTelephonyDataServices(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToEnabledTelephonyDataServices(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Revoke default permissions to currently active telephony data services
+ * @param packageNames The package name for the services
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when revoke completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently enabled carrier apps
+ * @param packageNames Package names of the apps to be granted permissions
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToEnabledCarrierApps(@NonNull String[] packageNames,
+ @NonNull UserHandle user, @NonNull @CallbackExecutor Executor executor,
+ @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToEnabledCarrierApps(packageNames,
+ user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+}
diff --git a/core/java/android/permission/OWNERS b/core/java/android/permission/OWNERS
new file mode 100644
index 0000000..d09f351
--- /dev/null
+++ b/core/java/android/permission/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 137825
+
+moltmann@google.com
+evanseverson@google.com
+ntmyren@google.com
+zhanghai@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/permission/PermissionManager.java b/core/java/android/permission/PermissionManager.java
index e4220dd..d31e012 100644
--- a/core/java/android/permission/PermissionManager.java
+++ b/core/java/android/permission/PermissionManager.java
@@ -19,7 +19,7 @@
import static android.os.Build.VERSION_CODES.S;
import android.Manifest;
-import android.annotation.CallbackExecutor;
+import android.annotation.CheckResult;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -29,6 +29,7 @@
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityThread;
+import android.app.AppGlobals;
import android.app.IActivityManager;
import android.app.PropertyInvalidatedCache;
import android.compat.annotation.ChangeId;
@@ -36,15 +37,25 @@
import android.content.Context;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
+import android.content.pm.ParceledListSlice;
+import android.content.pm.PermissionGroupInfo;
+import android.content.pm.PermissionInfo;
import android.content.pm.permission.SplitPermissionInfoParcelable;
+import android.os.Build;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
+import android.util.ArrayMap;
+import android.util.ArraySet;
+import android.util.DebugUtils;
+import android.util.Log;
import android.util.Slog;
import com.android.internal.annotations.Immutable;
-import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.CollectionUtils;
import java.util.ArrayList;
@@ -52,8 +63,6 @@
import java.util.List;
import java.util.Objects;
import java.util.Set;
-import java.util.concurrent.Executor;
-import java.util.function.Consumer;
/**
* System level service for accessing the permission capabilities of the platform.
@@ -63,7 +72,7 @@
@SystemApi
@SystemService(Context.PERMISSION_SERVICE)
public final class PermissionManager {
- private static final String TAG = PermissionManager.class.getName();
+ private static final String LOG_TAG = PermissionManager.class.getName();
/** @hide */
public static final String KILL_APP_REASON_PERMISSIONS_REVOKED =
@@ -83,41 +92,688 @@
@EnabledAfter(targetSdkVersion = S)
public static final long CANNOT_INSTALL_WITH_BAD_PERMISSION_GROUPS = 146211400;
+ /**
+ * Note: Changing this won't do anything on its own - you should also change the filtering in
+ * {@link #shouldTraceGrant}.
+ *
+ * @hide
+ */
+ public static final boolean DEBUG_TRACE_GRANTS = false;
+ /**
+ * @hide
+ */
+ public static final boolean DEBUG_TRACE_PERMISSION_UPDATES = false;
+
private final @NonNull Context mContext;
private final IPackageManager mPackageManager;
private final IPermissionManager mPermissionManager;
+ private final LegacyPermissionManager mLegacyPermissionManager;
+
+ private final ArrayMap<PackageManager.OnPermissionsChangedListener,
+ IOnPermissionsChangeListener> mPermissionListeners = new ArrayMap<>();
+
private List<SplitPermissionInfo> mSplitPermissionInfos;
/**
* Creates a new instance.
*
- * @param context The current context in which to operate.
+ * @param context The current context in which to operate
+ *
* @hide
*/
- public PermissionManager(@NonNull Context context, IPackageManager packageManager)
+ public PermissionManager(@NonNull Context context)
throws ServiceManager.ServiceNotFoundException {
- this(context, packageManager, IPermissionManager.Stub.asInterface(
- ServiceManager.getServiceOrThrow("permissionmgr")));
+ mContext = context;
+ mPackageManager = AppGlobals.getPackageManager();
+ mPermissionManager = IPermissionManager.Stub.asInterface(ServiceManager.getServiceOrThrow(
+ "permissionmgr"));
+ mLegacyPermissionManager = context.getSystemService(LegacyPermissionManager.class);
}
/**
- * Creates a new instance with the provided instantiation of the IPermissionManager.
+ * Retrieve all of the information we know about a particular permission.
*
- * @param context the current context in which to operate
- * @param packageManager package manager service to be used for package related permission
- * requests
- * @param permissionManager injectable permission manager service
+ * @param permissionName the fully qualified name (e.g. com.android.permission.LOGIN) of the
+ * permission you are interested in
+ * @param flags additional option flags to modify the data returned
+ * @return a {@link PermissionInfo} containing information about the permission, or {@code null}
+ * if not found
+ *
+ * @hide Pending API
+ */
+ @Nullable
+ public PermissionInfo getPermissionInfo(@NonNull String permissionName,
+ @PackageManager.PermissionInfoFlags int flags) {
+ try {
+ final String packageName = mContext.getOpPackageName();
+ return mPermissionManager.getPermissionInfo(permissionName, packageName, flags);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Query for all of the permissions associated with a particular group.
+ *
+ * @param groupName the fully qualified name (e.g. com.android.permission.LOGIN) of the
+ * permission group you are interested in. Use {@code null} to find all of the
+ * permissions not associated with a group
+ * @param flags additional option flags to modify the data returned
+ * @return a list of {@link PermissionInfo} containing information about all of the permissions
+ * in the given group, or {@code null} if the group is not found
+ *
+ * @hide Pending API
+ */
+ @Nullable
+ public List<PermissionInfo> queryPermissionsByGroup(@NonNull String groupName,
+ @PackageManager.PermissionInfoFlags int flags) {
+ try {
+ final ParceledListSlice<PermissionInfo> parceledList =
+ mPermissionManager.queryPermissionsByGroup(groupName, flags);
+ if (parceledList == null) {
+ return null;
+ }
+ return parceledList.getList();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Add a new dynamic permission to the system. For this to work, your package must have defined
+ * a permission tree through the
+ * {@link android.R.styleable#AndroidManifestPermissionTree <permission-tree>} tag in its
+ * manifest. A package can only add permissions to trees that were defined by either its own
+ * package or another with the same user id; a permission is in a tree if it matches the name of
+ * the permission tree + ".": for example, "com.foo.bar" is a member of the permission tree
+ * "com.foo".
+ * <p>
+ * It is good to make your permission tree name descriptive, because you are taking possession
+ * of that entire set of permission names. Thus, it must be under a domain you control, with a
+ * suffix that will not match any normal permissions that may be declared in any applications
+ * that are part of that domain.
+ * <p>
+ * New permissions must be added before any .apks are installed that use those permissions.
+ * Permissions you add through this method are remembered across reboots of the device. If the
+ * given permission already exists, the info you supply here will be used to update it.
+ *
+ * @param permissionInfo description of the permission to be added
+ * @param async whether the persistence of the permission should be asynchronous, allowing it to
+ * return quicker and batch a series of adds, at the expense of no guarantee the
+ * added permission will be retained if the device is rebooted before it is
+ * written.
+ * @return {@code true} if a new permission was created, {@code false} if an existing one was
+ * updated
+ * @throws SecurityException if you are not allowed to add the given permission name
+ *
+ * @see #removePermission(String)
+ *
+ * @hide Pending API
+ */
+ public boolean addPermission(@NonNull PermissionInfo permissionInfo, boolean async) {
+ try {
+ return mPermissionManager.addPermission(permissionInfo, async);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Removes a permission that was previously added with
+ * {@link #addPermission(PermissionInfo, boolean)}. The same ownership rules apply -- you are
+ * only allowed to remove permissions that you are allowed to add.
+ *
+ * @param permissionName the name of the permission to remove
+ * @throws SecurityException if you are not allowed to remove the given permission name
+ *
+ * @see #addPermission(PermissionInfo, boolean)
+ *
+ * @hide Pending API
+ */
+ public void removePermission(@NonNull String permissionName) {
+ try {
+ mPermissionManager.removePermission(permissionName);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Retrieve all of the information we know about a particular group of permissions.
+ *
+ * @param groupName the fully qualified name (e.g. com.android.permission_group.APPS) of the
+ * permission you are interested in
+ * @param flags additional option flags to modify the data returned
+ * @return a {@link PermissionGroupInfo} containing information about the permission, or
+ * {@code null} if not found
+ *
+ * @hide Pending API
+ */
+ @Nullable
+ public PermissionGroupInfo getPermissionGroupInfo(@NonNull String groupName,
+ @PackageManager.PermissionGroupInfoFlags int flags) {
+ try {
+ return mPermissionManager.getPermissionGroupInfo(groupName, flags);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Retrieve all of the known permission groups in the system.
+ *
+ * @param flags additional option flags to modify the data returned
+ * @return a list of {@link PermissionGroupInfo} containing information about all of the known
+ * permission groups
+ *
+ * @hide Pending API
+ */
+ @NonNull
+ public List<PermissionGroupInfo> getAllPermissionGroups(
+ @PackageManager.PermissionGroupInfoFlags int flags) {
+ try {
+ final ParceledListSlice<PermissionGroupInfo> parceledList =
+ mPermissionManager.getAllPermissionGroups(flags);
+ if (parceledList == null) {
+ return Collections.emptyList();
+ }
+ return parceledList.getList();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Checks whether a particular permissions has been revoked for a package by policy. Typically
+ * the device owner or the profile owner may apply such a policy. The user cannot grant policy
+ * revoked permissions, hence the only way for an app to get such a permission is by a policy
+ * change.
+ *
+ * @param packageName the name of the package you are checking against
+ * @param permissionName the name of the permission you are checking for
+ *
+ * @return whether the permission is restricted by policy
+ *
+ * @hide Pending API
+ */
+ @CheckResult
+ public boolean isPermissionRevokedByPolicy(@NonNull String packageName,
+ @NonNull String permissionName) {
+ try {
+ return mPermissionManager.isPermissionRevokedByPolicy(permissionName, packageName,
+ mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /** @hide */
+ public static boolean shouldTraceGrant(String packageName, String permissionName, int userId) {
+ // To be modified when debugging
+ return false;
+ }
+
+ /**
+ * Grant a runtime permission to an application which the application does not already have. The
+ * permission must have been requested by the application. If the application is not allowed to
+ * hold the permission, a {@link java.lang.SecurityException} is thrown. If the package or
+ * permission is invalid, a {@link java.lang.IllegalArgumentException} is thrown.
+ * <p>
+ * <strong>Note: </strong>Using this API requires holding
+ * {@code android.permission.GRANT_RUNTIME_PERMISSIONS} and if the user ID is not the current
+ * user {@code android.permission.INTERACT_ACROSS_USERS_FULL}.
+ *
+ * @param packageName the package to which to grant the permission
+ * @param permissionName the permission name to grant
+ * @param user the user for which to grant the permission
+ *
+ * @see #revokeRuntimePermission(String, String, android.os.UserHandle)
+ *
* @hide
*/
- @VisibleForTesting
- public PermissionManager(@NonNull Context context, IPackageManager packageManager,
- IPermissionManager permissionManager) {
- mContext = context;
- mPackageManager = packageManager;
- mPermissionManager = permissionManager;
+ @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS)
+ //@SystemApi
+ public void grantRuntimePermission(@NonNull String packageName,
+ @NonNull String permissionName, @NonNull UserHandle user) {
+ if (DEBUG_TRACE_GRANTS
+ && shouldTraceGrant(packageName, permissionName, user.getIdentifier())) {
+ Log.i(LOG_TAG, "App " + mContext.getPackageName() + " is granting " + packageName + " "
+ + permissionName + " for user " + user.getIdentifier(), new RuntimeException());
+ }
+ try {
+ mPermissionManager.grantRuntimePermission(packageName, permissionName,
+ user.getIdentifier());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Revoke a runtime permission that was previously granted by
+ * {@link #grantRuntimePermission(String, String, android.os.UserHandle)}. The permission must
+ * have been requested by and granted to the application. If the application is not allowed to
+ * hold the permission, a {@link java.lang.SecurityException} is thrown. If the package or
+ * permission is invalid, a {@link java.lang.IllegalArgumentException} is thrown.
+ * <p>
+ * <strong>Note: </strong>Using this API requires holding
+ * {@code android.permission.REVOKE_RUNTIME_PERMISSIONS} and if the user ID is not the current
+ * user {@code android.permission.INTERACT_ACROSS_USERS_FULL}.
+ *
+ * @param packageName the package from which to revoke the permission
+ * @param permName the permission name to revoke
+ * @param user the user for which to revoke the permission
+ * @param reason the reason for the revoke, or {@code null} for unspecified
+ *
+ * @see #grantRuntimePermission(String, String, android.os.UserHandle)
+ *
+ * @hide
+ */
+ @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
+ //@SystemApi
+ public void revokeRuntimePermission(@NonNull String packageName,
+ @NonNull String permName, @NonNull UserHandle user, @Nullable String reason) {
+ if (DEBUG_TRACE_PERMISSION_UPDATES
+ && shouldTraceGrant(packageName, permName, user.getIdentifier())) {
+ Log.i(LOG_TAG, "App " + mContext.getPackageName() + " is revoking " + packageName + " "
+ + permName + " for user " + user.getIdentifier() + " with reason "
+ + reason, new RuntimeException());
+ }
+ try {
+ mPermissionManager
+ .revokeRuntimePermission(packageName, permName, user.getIdentifier(), reason);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Gets the state flags associated with a permission.
+ *
+ * @param packageName the package name for which to get the flags
+ * @param permissionName the permission for which to get the flags
+ * @param user the user for which to get permission flags
+ * @return the permission flags
+ *
+ * @hide
+ */
+ @PackageManager.PermissionFlags
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS,
+ android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS,
+ android.Manifest.permission.GET_RUNTIME_PERMISSIONS
+ })
+ //@SystemApi
+ public int getPermissionFlags(@NonNull String packageName, @NonNull String permissionName,
+ @NonNull UserHandle user) {
+ try {
+ return mPermissionManager.getPermissionFlags(permissionName, packageName,
+ user.getIdentifier());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Updates the flags associated with a permission by replacing the flags in the specified mask
+ * with the provided flag values.
+ *
+ * @param packageName The package name for which to update the flags
+ * @param permissionName The permission for which to update the flags
+ * @param flagMask The flags which to replace
+ * @param flagValues The flags with which to replace
+ * @param user The user for which to update the permission flags
+ *
+ * @hide
+ */
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS,
+ android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS
+ })
+ //@SystemApi
+ public void updatePermissionFlags(@NonNull String packageName, @NonNull String permissionName,
+ @PackageManager.PermissionFlags int flagMask,
+ @PackageManager.PermissionFlags int flagValues, @NonNull UserHandle user) {
+ if (DEBUG_TRACE_PERMISSION_UPDATES && shouldTraceGrant(packageName, permissionName,
+ user.getIdentifier())) {
+ Log.i(LOG_TAG, "App " + mContext.getPackageName() + " is updating flags for "
+ + packageName + " " + permissionName + " for user "
+ + user.getIdentifier() + ": " + DebugUtils.flagsToString(
+ PackageManager.class, "FLAG_PERMISSION_", flagMask) + " := "
+ + DebugUtils.flagsToString(PackageManager.class, "FLAG_PERMISSION_",
+ flagValues), new RuntimeException());
+ }
+ try {
+ final boolean checkAdjustPolicyFlagPermission =
+ mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q;
+ mPermissionManager.updatePermissionFlags(permissionName, packageName, flagMask,
+ flagValues, checkAdjustPolicyFlagPermission, user.getIdentifier());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Gets the restricted permissions that have been allowlisted and the app is allowed to have
+ * them granted in their full form.
+ * <p>
+ * Permissions can be hard restricted which means that the app cannot hold them or soft
+ * restricted where the app can hold the permission but in a weaker form. Whether a permission
+ * is {@link PermissionInfo#FLAG_HARD_RESTRICTED hard restricted} or
+ * {@link PermissionInfo#FLAG_SOFT_RESTRICTED soft restricted} depends on the permission
+ * declaration. Allowlisting a hard restricted permission allows for the to hold that permission
+ * and allowlisting a soft restricted permission allows the app to hold the permission in its
+ * full, unrestricted form.
+ * <p>
+ * There are four allowlists:
+ * <ol>
+ * <li>
+ * One for cases where the system permission policy allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM} flag. Can only be
+ * accessed by pre-installed holders of a dedicated permission.
+ * <li>
+ * One for cases where the system allowlists the permission when upgrading from an OS version in
+ * which the permission was not restricted to an OS version in which the permission is
+ * restricted. This list corresponds to the
+ * {@link PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE} flag. Can be accessed by
+ * pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the installer of the package allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the system exempts the permission when granting a role. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission.
+ * </ol>
+ *
+ * @param packageName the app for which to get allowlisted permissions
+ * @param allowlistFlag the flag to determine which allowlist to query. Only one flag can be
+ * passed.
+ * @return the allowlisted permissions that are on any of the allowlists you query for
+ * @throws SecurityException if you try to access a allowlist that you have no access to
+ *
+ * @see #addAllowlistedRestrictedPermission(String, String, int)
+ * @see #removeAllowlistedRestrictedPermission(String, String, int)
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER
+ * @see PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE
+ *
+ * @hide Pending API
+ */
+ @NonNull
+ @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
+ conditional = true)
+ public Set<String> getAllowlistedRestrictedPermissions(@NonNull String packageName,
+ @PackageManager.PermissionWhitelistFlags int allowlistFlag) {
+ try {
+ final List<String> allowlist = mPermissionManager.getWhitelistedRestrictedPermissions(
+ packageName, allowlistFlag, mContext.getUserId());
+ if (allowlist == null) {
+ return Collections.emptySet();
+ }
+ return new ArraySet<>(allowlist);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Adds a allowlisted restricted permission for an app.
+ * <p>
+ * Permissions can be hard restricted which means that the app cannot hold them or soft
+ * restricted where the app can hold the permission but in a weaker form. Whether a permission
+ * is {@link PermissionInfo#FLAG_HARD_RESTRICTED hard restricted} or
+ * {@link PermissionInfo#FLAG_SOFT_RESTRICTED soft restricted} depends on the permission
+ * declaration. Allowlisting a hard restricted permission allows for the to hold that permission
+ * and allowlisting a soft restricted permission allows the app to hold the permission in its
+ * full, unrestricted form.
+ * <p>There are four allowlists:
+ * <ol>
+ * <li>
+ * One for cases where the system permission policy allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM} flag. Can only be
+ * accessed by pre-installed holders of a dedicated permission.
+ * <li>
+ * One for cases where the system allowlists the permission when upgrading from an OS version in
+ * which the permission was not restricted to an OS version in which the permission is
+ * restricted. This list corresponds to the
+ * {@link PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE} flag. Can be accessed by
+ * pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the installer of the package allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the system exempts the permission when granting a role. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission.
+ * </ol>
+ * <p>
+ * You need to specify the allowlists for which to set the allowlisted permissions which will
+ * clear the previous allowlisted permissions and replace them with the provided ones.
+ *
+ * @param packageName the app for which to get allowlisted permissions
+ * @param permissionName the allowlisted permission to add
+ * @param allowlistFlags the allowlists to which to add. Passing multiple flags updates all
+ * specified allowlists.
+ * @return whether the permission was added to the allowlist
+ * @throws SecurityException if you try to modify a allowlist that you have no access to.
+ *
+ * @see #getAllowlistedRestrictedPermissions(String, int)
+ * @see #removeAllowlistedRestrictedPermission(String, String, int)
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER
+ * @see PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE
+ *
+ * @hide Pending API
+ */
+ @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
+ conditional = true)
+ public boolean addAllowlistedRestrictedPermission(@NonNull String packageName,
+ @NonNull String permissionName,
+ @PackageManager.PermissionWhitelistFlags int allowlistFlags) {
+ try {
+ return mPermissionManager.addWhitelistedRestrictedPermission(packageName,
+ permissionName, allowlistFlags, mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Removes a allowlisted restricted permission for an app.
+ * <p>
+ * Permissions can be hard restricted which means that the app cannot hold them or soft
+ * restricted where the app can hold the permission but in a weaker form. Whether a permission
+ * is {@link PermissionInfo#FLAG_HARD_RESTRICTED hard restricted} or
+ * {@link PermissionInfo#FLAG_SOFT_RESTRICTED soft restricted} depends on the permission
+ * declaration. Allowlisting a hard restricted permission allows for the to hold that permission
+ * and allowlisting a soft restricted permission allows the app to hold the permission in its
+ * full, unrestricted form.
+ * <p>There are four allowlists:
+ * <ol>
+ * <li>
+ * One for cases where the system permission policy allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM} flag. Can only be
+ * accessed by pre-installed holders of a dedicated permission.
+ * <li>
+ * One for cases where the system allowlists the permission when upgrading from an OS version in
+ * which the permission was not restricted to an OS version in which the permission is
+ * restricted. This list corresponds to the
+ * {@link PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE} flag. Can be accessed by
+ * pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the installer of the package allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the system exempts the permission when granting a role. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission.
+ * </ol>
+ * <p>
+ * You need to specify the allowlists for which to set the allowlisted permissions which will
+ * clear the previous allowlisted permissions and replace them with the provided ones.
+ *
+ * @param packageName the app for which to get allowlisted permissions
+ * @param permissionName the allowlisted permission to remove
+ * @param allowlistFlags the allowlists from which to remove. Passing multiple flags updates all
+ * specified allowlists.
+ * @return whether the permission was removed from the allowlist
+ * @throws SecurityException if you try to modify a allowlist that you have no access to.
+ *
+ * @see #getAllowlistedRestrictedPermissions(String, int)
+ * @see #addAllowlistedRestrictedPermission(String, String, int)
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER
+ * @see PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE
+ *
+ * @hide Pending API
+ */
+ @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
+ conditional = true)
+ public boolean removeAllowlistedRestrictedPermission(@NonNull String packageName,
+ @NonNull String permissionName,
+ @PackageManager.PermissionWhitelistFlags int allowlistFlags) {
+ try {
+ return mPermissionManager.removeWhitelistedRestrictedPermission(packageName,
+ permissionName, allowlistFlags, mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Checks whether an application is exempted from having its permissions be automatically
+ * revoked when the app is unused for an extended period of time.
+ * <p>
+ * Only the installer on record that installed the given package, or a holder of
+ * {@code WHITELIST_AUTO_REVOKE_PERMISSIONS} is allowed to call this.
+ *
+ * @param packageName the app for which to set exemption
+ * @return whether the app is exempted
+ * @throws SecurityException if you you have no access to this
+ *
+ * @see #setAutoRevokeExempted
+ *
+ * @hide Pending API
+ */
+ @RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
+ conditional = true)
+ public boolean isAutoRevokeExempted(@NonNull String packageName) {
+ try {
+ return mPermissionManager.isAutoRevokeWhitelisted(packageName, mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Marks an application exempted from having its permissions be automatically revoked when the
+ * app is unused for an extended period of time.
+ * <p>
+ * Only the installer on record that installed the given package is allowed to call this.
+ * <p>
+ * Packages start in exempted state, and it is the installer's responsibility to un-exempt the
+ * packages it installs, unless auto-revoking permissions from that package would cause
+ * breakages beyond having to re-request the permission(s).
+ *
+ * @param packageName the app for which to set exemption
+ * @param exempted whether the app should be exempted
+ * @return whether any change took effect
+ * @throws SecurityException if you you have no access to modify this
+ *
+ * @see #isAutoRevokeExempted
+ *
+ * @hide Pending API
+ */
+ @RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
+ conditional = true)
+ public boolean setAutoRevokeExempted(@NonNull String packageName, boolean exempted) {
+ try {
+ return mPermissionManager.setAutoRevokeWhitelisted(packageName, exempted,
+ mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Get whether you should show UI with rationale for requesting a permission. You should do this
+ * only if you do not have the permission and the context in which the permission is requested
+ * does not clearly communicate to the user what would be the benefit from grating this
+ * permission.
+ *
+ * @param permissionName a permission your app wants to request
+ * @return whether you can show permission rationale UI
+ *
+ * @hide
+ */
+ //@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public boolean shouldShowRequestPermissionRationale(@NonNull String permissionName) {
+ try {
+ final String packageName = mContext.getPackageName();
+ return mPermissionManager.shouldShowRequestPermissionRationale(permissionName,
+ packageName, mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Add a listener for permission changes for installed packages.
+ *
+ * @param listener the listener to add
+ *
+ * @hide
+ */
+ //@SystemApi
+ @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
+ public void addOnPermissionsChangeListener(
+ @NonNull PackageManager.OnPermissionsChangedListener listener) {
+ synchronized (mPermissionListeners) {
+ if (mPermissionListeners.get(listener) != null) {
+ return;
+ }
+ final OnPermissionsChangeListenerDelegate delegate =
+ new OnPermissionsChangeListenerDelegate(listener, Looper.getMainLooper());
+ try {
+ mPermissionManager.addOnPermissionsChangeListener(delegate);
+ mPermissionListeners.put(listener, delegate);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+ }
+
+ /**
+ * Remove a listener for permission changes for installed packages.
+ *
+ * @param listener the listener to remove
+ *
+ * @hide
+ */
+ //@SystemApi
+ @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
+ public void removeOnPermissionsChangeListener(
+ @NonNull PackageManager.OnPermissionsChangedListener listener) {
+ synchronized (mPermissionListeners) {
+ final IOnPermissionsChangeListener delegate = mPermissionListeners.get(listener);
+ if (delegate != null) {
+ try {
+ mPermissionManager.removeOnPermissionsChangeListener(delegate);
+ mPermissionListeners.remove(listener);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+ }
}
/**
@@ -188,7 +844,7 @@
try {
parcelableList = ActivityThread.getPermissionManager().getSplitPermissions();
} catch (RemoteException e) {
- Slog.e(TAG, "Error getting split permissions", e);
+ Slog.e(LOG_TAG, "Error getting split permissions", e);
return Collections.emptyList();
}
@@ -198,132 +854,6 @@
}
/**
- * Grant default permissions to currently active LUI app
- * @param packageName The package name for the LUI app
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
- */
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToLuiApp(
- @NonNull String packageName, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
- try {
- mPermissionManager.grantDefaultPermissionsToActiveLuiApp(
- packageName, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Revoke default permissions to currently active LUI app
- * @param packageNames The package names for the LUI apps
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
- */
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void revokeDefaultPermissionsFromLuiApps(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
- try {
- mPermissionManager.revokeDefaultPermissionsFromLuiApps(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Grant default permissions to currently active Ims services
- * @param packageNames The package names for the Ims services
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
- */
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToEnabledImsServices(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
- try {
- mPermissionManager.grantDefaultPermissionsToEnabledImsServices(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Grant default permissions to currently enabled telephony data services
- * @param packageNames The package name for the services
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
- */
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToEnabledTelephonyDataServices(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
- try {
- mPermissionManager.grantDefaultPermissionsToEnabledTelephonyDataServices(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Revoke default permissions to currently active telephony data services
- * @param packageNames The package name for the services
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when revoke completes
- * @hide
- */
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
- try {
- mPermissionManager.revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
- }
-
- /**
- * Grant default permissions to currently enabled carrier apps
- * @param packageNames Package names of the apps to be granted permissions
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
- */
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToEnabledCarrierApps(@NonNull String[] packageNames,
- @NonNull UserHandle user, @NonNull @CallbackExecutor Executor executor,
- @NonNull Consumer<Boolean> callback) {
- try {
- mPermissionManager.grantDefaultPermissionsToEnabledCarrierApps(packageNames,
- user.getIdentifier());
- executor.execute(() -> callback.accept(true));
- } catch (RemoteException e) {
- e.rethrowFromSystemServer();
- }
- }
-
- /**
* Gets the list of packages that have permissions that specified
* {@code requestDontAutoRevokePermissions=true} in their
* {@code application} manifest declaration.
@@ -530,12 +1060,8 @@
@SystemApi
public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
@Nullable String callingFeatureId, int pid, int uid) {
- try {
- return mPermissionManager.checkDeviceIdentifierAccess(packageName, message,
- callingFeatureId, pid, uid);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return mLegacyPermissionManager.checkDeviceIdentifierAccess(packageName, message,
+ callingFeatureId, pid, uid);
}
/* @hide */
@@ -547,10 +1073,11 @@
// permission this is.
final int appId = UserHandle.getAppId(uid);
if (appId == Process.ROOT_UID || appId == Process.SYSTEM_UID) {
- Slog.w(TAG, "Missing ActivityManager; assuming " + uid + " holds " + permission);
+ Slog.w(LOG_TAG, "Missing ActivityManager; assuming " + uid + " holds "
+ + permission);
return PackageManager.PERMISSION_GRANTED;
}
- Slog.w(TAG, "Missing ActivityManager; assuming " + uid + " does not hold "
+ Slog.w(LOG_TAG, "Missing ActivityManager; assuming " + uid + " does not hold "
+ permission);
return PackageManager.PERMISSION_DENIED;
}
@@ -730,4 +1257,35 @@
sPackageNamePermissionCache.disableLocal();
}
+ private final class OnPermissionsChangeListenerDelegate
+ extends IOnPermissionsChangeListener.Stub implements Handler.Callback{
+ private static final int MSG_PERMISSIONS_CHANGED = 1;
+
+ private final PackageManager.OnPermissionsChangedListener mListener;
+ private final Handler mHandler;
+
+ public OnPermissionsChangeListenerDelegate(
+ PackageManager.OnPermissionsChangedListener listener, Looper looper) {
+ mListener = listener;
+ mHandler = new Handler(looper, this);
+ }
+
+ @Override
+ public void onPermissionsChanged(int uid) {
+ mHandler.obtainMessage(MSG_PERMISSIONS_CHANGED, uid, 0).sendToTarget();
+ }
+
+ @Override
+ public boolean handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_PERMISSIONS_CHANGED: {
+ final int uid = msg.arg1;
+ mListener.onPermissionsChanged(uid);
+ return true;
+ }
+ default:
+ return false;
+ }
+ }
+ }
}
diff --git a/core/java/android/permissionpresenterservice/OWNERS b/core/java/android/permissionpresenterservice/OWNERS
new file mode 100644
index 0000000..d09f351
--- /dev/null
+++ b/core/java/android/permissionpresenterservice/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 137825
+
+moltmann@google.com
+evanseverson@google.com
+ntmyren@google.com
+zhanghai@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/print/OWNERS b/core/java/android/print/OWNERS
new file mode 100644
index 0000000..72f0983
--- /dev/null
+++ b/core/java/android/print/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 47273
+
+moltmann@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/print/pdf/OWNERS b/core/java/android/print/pdf/OWNERS
new file mode 100644
index 0000000..72f0983
--- /dev/null
+++ b/core/java/android/print/pdf/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 47273
+
+moltmann@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/printservice/OWNERS b/core/java/android/printservice/OWNERS
new file mode 100644
index 0000000..72f0983
--- /dev/null
+++ b/core/java/android/printservice/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 47273
+
+moltmann@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/printservice/recommendation/OWNERS b/core/java/android/printservice/recommendation/OWNERS
new file mode 100644
index 0000000..72f0983
--- /dev/null
+++ b/core/java/android/printservice/recommendation/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 47273
+
+moltmann@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index 105ffaa..d1aa489 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -17,7 +17,14 @@
package android.provider;
+import android.Manifest;
+import android.annotation.CallbackExecutor;
+import android.annotation.IntDef;
import android.annotation.LongDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
+import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ContentProvider;
import android.content.ContentResolver;
@@ -30,6 +37,9 @@
import android.location.CountryDetector;
import android.net.Uri;
import android.os.Build;
+import android.os.OutcomeReceiver;
+import android.os.ParcelFileDescriptor;
+import android.os.ParcelableException;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.ContactsContract.CommonDataKinds.Callable;
@@ -44,9 +54,15 @@
import android.text.TextUtils;
import android.util.Log;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.Executor;
/**
* The CallLog provider contains information about placed and received calls.
@@ -63,6 +79,12 @@
public static final Uri CONTENT_URI =
Uri.parse("content://" + AUTHORITY);
+ /** @hide */
+ public static final String CALL_COMPOSER_SEGMENT = "call_composer";
+
+ /** @hide */
+ public static final Uri CALL_COMPOSER_PICTURE_URI =
+ CONTENT_URI.buildUpon().appendPath(CALL_COMPOSER_SEGMENT).build();
/**
* The "shadow" provider stores calllog when the real calllog provider is encrypted. The
@@ -75,6 +97,172 @@
public static final String SHADOW_AUTHORITY = "call_log_shadow";
/**
+ * Describes an error encountered while storing a call composer picture in the call log.
+ * @hide
+ */
+ @SystemApi
+ public static class CallComposerLoggingException extends Throwable {
+ /**
+ * Indicates an unknown error.
+ */
+ public static final int ERROR_UNKNOWN = 0;
+
+ /**
+ * Indicates that the process hosting the call log died or otherwise encountered an
+ * unrecoverable error while storing the picture.
+ *
+ * The caller should retry if this error is encountered.
+ */
+ public static final int ERROR_REMOTE_END_CLOSED = 1;
+
+ /**
+ * Indicates that the device has insufficient space to store this picture.
+ *
+ * The caller should not retry if this error is encountered.
+ */
+ public static final int ERROR_STORAGE_FULL = 2;
+
+ /**
+ * Indicates that the {@link InputStream} passed to {@link #storeCallComposerPictureAsUser}
+ * was closed.
+ *
+ * The caller should retry if this error is encountered, and be sure to not close the stream
+ * before the callback is called this time.
+ */
+ public static final int ERROR_INPUT_CLOSED = 3;
+
+ /** @hide */
+ @IntDef(prefix = {"ERROR_"}, value = {
+ ERROR_UNKNOWN,
+ ERROR_REMOTE_END_CLOSED,
+ ERROR_STORAGE_FULL,
+ ERROR_INPUT_CLOSED,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface CallComposerLoggingError { }
+
+ private final int mErrorCode;
+
+ /** @hide */
+ public CallComposerLoggingException(@CallComposerLoggingError int errorCode) {
+ mErrorCode = errorCode;
+ }
+
+ /**
+ * @return The error code for this exception.
+ */
+ public @CallComposerLoggingError int getErrorCode() {
+ return mErrorCode;
+ }
+ }
+
+ /**
+ * Supplies a call composer picture to the call log for persistent storage.
+ *
+ * This method is used by Telephony to store pictures selected by the user or sent from the
+ * remote party as part of a voice call with call composer. The {@link Uri} supplied in the
+ * callback can be used to retrieve the image via {@link ContentResolver#openFile} or stored in
+ * the {@link Calls} table in the TODO: link column name.
+ *
+ * The caller is responsible for closing the {@link InputStream} after the callback indicating
+ * success or failure.
+ *
+ * @param context An instance of {@link Context}.
+ * @param user The user for whom the picture is stored. If {@code null}, the picture will be
+ * stored for all users.
+ * @param input An input stream from which the picture to store should be read. The input data
+ * must be decodeable as either a JPEG, PNG, or GIF image.
+ * @param executor The {@link Executor} on which to perform the file transfer operation and
+ * call the supplied callback.
+ * @param callback Callback that's called after the picture is successfully stored or when an
+ * error occurs.
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.WRITE_CALL_LOG)
+ public static void storeCallComposerPictureAsUser(@NonNull Context context,
+ @Nullable UserHandle user,
+ @NonNull InputStream input,
+ @CallbackExecutor @NonNull Executor executor,
+ @NonNull OutcomeReceiver<Uri, CallComposerLoggingException> callback) {
+ Objects.requireNonNull(context);
+ Objects.requireNonNull(input);
+ Objects.requireNonNull(executor);
+ Objects.requireNonNull(callback);
+
+ executor.execute(() -> {
+ Uri pictureFileUri;
+ Uri pictureInsertionUri = context.getSystemService(UserManager.class)
+ .isUserUnlocked() ? CALL_COMPOSER_PICTURE_URI
+ : CALL_COMPOSER_PICTURE_URI.buildUpon().authority(SHADOW_AUTHORITY).build();
+ try {
+ // ContentResolver#insert says that the second argument is nullable. It is in fact
+ // not nullable.
+ ContentValues cv = new ContentValues();
+ pictureFileUri = context.getContentResolver().insert(pictureInsertionUri, cv);
+ } catch (ParcelableException e) {
+ // Most likely an IOException. We don't have a good way of distinguishing them so
+ // just return an unknown error.
+ sendCallComposerError(callback, CallComposerLoggingException.ERROR_UNKNOWN);
+ return;
+ }
+ if (pictureFileUri == null) {
+ // If the call log provider returns null, it means that there's not enough space
+ // left to store the maximum-sized call composer image.
+ sendCallComposerError(callback, CallComposerLoggingException.ERROR_STORAGE_FULL);
+ return;
+ }
+
+ boolean wroteSuccessfully = false;
+ try (ParcelFileDescriptor pfd =
+ context.getContentResolver().openFileDescriptor(pictureFileUri, "w")) {
+ FileOutputStream output = new FileOutputStream(pfd.getFileDescriptor());
+ byte[] buffer = new byte[1024];
+ int bytesRead;
+ while (true) {
+ try {
+ bytesRead = input.read(buffer);
+ } catch (IOException e) {
+ sendCallComposerError(callback,
+ CallComposerLoggingException.ERROR_INPUT_CLOSED);
+ throw e;
+ }
+ if (bytesRead < 0) {
+ break;
+ }
+ try {
+ output.write(buffer, 0, bytesRead);
+ } catch (IOException e) {
+ sendCallComposerError(callback,
+ CallComposerLoggingException.ERROR_REMOTE_END_CLOSED);
+ throw e;
+ }
+ }
+ wroteSuccessfully = true;
+ } catch (FileNotFoundException e) {
+ callback.onError(new CallComposerLoggingException(
+ CallComposerLoggingException.ERROR_UNKNOWN));
+ } catch (IOException e) {
+ Log.e(LOG_TAG, "IOException while writing call composer pic to call log: "
+ + e);
+ }
+
+ if (wroteSuccessfully) {
+ callback.onResult(pictureFileUri);
+ } else {
+ // Clean up our mess if we didn't successfully write the file.
+ context.getContentResolver().delete(pictureFileUri, null);
+ }
+ });
+ }
+
+ // Only call on the correct executor.
+ private static void sendCallComposerError(OutcomeReceiver<?, CallComposerLoggingException> cb,
+ int error) {
+ cb.onError(new CallComposerLoggingException(error));
+ }
+
+ /**
* Contains the recent calls.
*/
public static class Calls implements BaseColumns {
diff --git a/core/java/android/provider/OWNERS b/core/java/android/provider/OWNERS
index 97e0156..792ff20 100644
--- a/core/java/android/provider/OWNERS
+++ b/core/java/android/provider/OWNERS
@@ -2,4 +2,8 @@
per-file DeviceConfig.java = hackbod@google.com
per-file DeviceConfig.java = schfan@google.com
-
+per-file CallLog.java = file:/telephony/OWNERS
+per-file DocumentsContract.java = file:/core/java/android/os/storage/OWNERS
+per-file DocumentsProvider.java = file:/core/java/android/os/storage/OWNERS
+per-file MediaStore.java = file:/core/java/android/os/storage/OWNERS
+per-file Telephony.java = file:/telephony/OWNERS
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index fb0aea0..daa17aa 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3060,6 +3060,7 @@
// com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
private static final float DEFAULT_FONT_SCALE = 1.0f;
+ private static final int DEFAULT_FONT_WEIGHT = 0;
/**
* The content:// style URL for this table
@@ -3581,9 +3582,7 @@
outConfig.fontScale = DEFAULT_FONT_SCALE;
}
outConfig.fontWeightAdjustment = Settings.Secure.getIntForUser(
- cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT,
- Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED,
- userHandle);
+ cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT, DEFAULT_FONT_WEIGHT, userHandle);
final String localeValue =
Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
@@ -7761,6 +7760,32 @@
"minimal_post_processing_allowed";
/**
+ * No mode switching will happen.
+ *
+ * @see #MATCH_CONTENT_FRAME_RATE
+ * @hide
+ */
+ public static final int MATCH_CONTENT_FRAMERATE_NEVER = 0;
+
+ /**
+ * Allow only refresh rate switching between modes in the same configuration group.
+ * This way only switches without visual interruptions for the user will be allowed.
+ *
+ * @see #MATCH_CONTENT_FRAME_RATE
+ * @hide
+ */
+ public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 1;
+
+ /**
+ * Allow refresh rate switching between all refresh rates even if the switch will have
+ * visual interruptions for the user.
+ *
+ * @see #MATCH_CONTENT_FRAME_RATE
+ * @hide
+ */
+ public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 2;
+
+ /**
* User's preference for refresh rate switching.
*
* <p>Values:
@@ -7770,6 +7795,9 @@
* for the user.
*
* @see android.view.Surface#setFrameRate
+ * @see #MATCH_CONTENT_FRAMERATE_NEVER
+ * @see #MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY
+ * @see #MATCH_CONTENT_FRAMERATE_ALWAYS
* @hide
*/
public static final String MATCH_CONTENT_FRAME_RATE =
diff --git a/core/java/android/se/OWNERS b/core/java/android/se/OWNERS
new file mode 100644
index 0000000..f1539dc
--- /dev/null
+++ b/core/java/android/se/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 456592
+
+cbrubaker@google.com
+vishwath@google.com
diff --git a/core/java/android/se/omapi/OWNERS b/core/java/android/se/omapi/OWNERS
new file mode 100644
index 0000000..f1539dc
--- /dev/null
+++ b/core/java/android/se/omapi/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 456592
+
+cbrubaker@google.com
+vishwath@google.com
diff --git a/core/java/android/security/OWNERS b/core/java/android/security/OWNERS
index 7120376..3f8d75e 100644
--- a/core/java/android/security/OWNERS
+++ b/core/java/android/security/OWNERS
@@ -1,3 +1,8 @@
+# Bug component: 36824
+
+cbrubaker@google.com
+vishwath@google.com
+
per-file NetworkSecurityPolicy.java = cbrubaker@google.com
per-file NetworkSecurityPolicy.java = klyubin@google.com
per-file FrameworkNetworkSecurityPolicy.java = cbrubaker@google.com
diff --git a/core/java/android/security/keymaster/KeymasterDefs.java b/core/java/android/security/keymaster/KeymasterDefs.java
index 6ef9e7e..017f405 100644
--- a/core/java/android/security/keymaster/KeymasterDefs.java
+++ b/core/java/android/security/keymaster/KeymasterDefs.java
@@ -16,18 +16,18 @@
package android.security.keymaster;
-import android.hardware.keymint.Algorithm;
-import android.hardware.keymint.BlockMode;
-import android.hardware.keymint.Digest;
-import android.hardware.keymint.ErrorCode;
-import android.hardware.keymint.HardwareAuthenticatorType;
-import android.hardware.keymint.KeyFormat;
-import android.hardware.keymint.KeyOrigin;
-import android.hardware.keymint.KeyPurpose;
-import android.hardware.keymint.PaddingMode;
-import android.hardware.keymint.SecurityLevel;
-import android.hardware.keymint.Tag;
-import android.hardware.keymint.TagType;
+import android.hardware.security.keymint.Algorithm;
+import android.hardware.security.keymint.BlockMode;
+import android.hardware.security.keymint.Digest;
+import android.hardware.security.keymint.ErrorCode;
+import android.hardware.security.keymint.HardwareAuthenticatorType;
+import android.hardware.security.keymint.KeyFormat;
+import android.hardware.security.keymint.KeyOrigin;
+import android.hardware.security.keymint.KeyPurpose;
+import android.hardware.security.keymint.PaddingMode;
+import android.hardware.security.keymint.SecurityLevel;
+import android.hardware.security.keymint.Tag;
+import android.hardware.security.keymint.TagType;
import java.util.HashMap;
import java.util.Map;
diff --git a/core/java/android/security/keymaster/OWNERS b/core/java/android/security/keymaster/OWNERS
new file mode 100644
index 0000000..65129a4
--- /dev/null
+++ b/core/java/android/security/keymaster/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 189335
+
+swillden@google.com
+jdanis@google.com
+jbires@google.com
diff --git a/core/java/android/security/keystore/OWNERS b/core/java/android/security/keystore/OWNERS
index bb487fb..65129a4 100644
--- a/core/java/android/security/keystore/OWNERS
+++ b/core/java/android/security/keystore/OWNERS
@@ -1,4 +1,5 @@
-aseemk@google.com
-bozhu@google.com
-dementyev@google.com
-robertberry@google.com
+# Bug component: 189335
+
+swillden@google.com
+jdanis@google.com
+jbires@google.com
diff --git a/core/java/android/security/keystore/recovery/OWNERS b/core/java/android/security/keystore/recovery/OWNERS
new file mode 100644
index 0000000..65129a4
--- /dev/null
+++ b/core/java/android/security/keystore/recovery/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 189335
+
+swillden@google.com
+jdanis@google.com
+jbires@google.com
diff --git a/core/java/android/security/net/OWNERS b/core/java/android/security/net/OWNERS
new file mode 100644
index 0000000..d828164
--- /dev/null
+++ b/core/java/android/security/net/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 36824
+
+cbrubaker@google.com
+brambonne@google.com
diff --git a/core/java/android/security/net/config/OWNERS b/core/java/android/security/net/config/OWNERS
index 5350373..85ce3c6 100644
--- a/core/java/android/security/net/config/OWNERS
+++ b/core/java/android/security/net/config/OWNERS
@@ -1,3 +1,5 @@
+# Bug component: 36824
set noparent
+
cbrubaker@google.com
-klyubin@google.com
+brambonne@google.com
diff --git a/core/java/android/service/appprediction/OWNERS b/core/java/android/service/appprediction/OWNERS
new file mode 100644
index 0000000..fe012da
--- /dev/null
+++ b/core/java/android/service/appprediction/OWNERS
@@ -0,0 +1,2 @@
+adamcohen@google.com
+sunnygoyal@google.com
diff --git a/core/java/android/service/attention/OWNERS b/core/java/android/service/attention/OWNERS
new file mode 100644
index 0000000..dd579b6
--- /dev/null
+++ b/core/java/android/service/attention/OWNERS
@@ -0,0 +1 @@
+asalo@google.com
diff --git a/core/java/android/service/autofill/OWNERS b/core/java/android/service/autofill/OWNERS
new file mode 100644
index 0000000..a088632
--- /dev/null
+++ b/core/java/android/service/autofill/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 351486
+
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/service/autofill/augmented/OWNERS b/core/java/android/service/autofill/augmented/OWNERS
new file mode 100644
index 0000000..a088632
--- /dev/null
+++ b/core/java/android/service/autofill/augmented/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 351486
+
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/service/carrier/OWNERS b/core/java/android/service/carrier/OWNERS
new file mode 100644
index 0000000..d768ef4
--- /dev/null
+++ b/core/java/android/service/carrier/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+fionaxu@google.com
diff --git a/core/java/android/service/chooser/OWNERS b/core/java/android/service/chooser/OWNERS
new file mode 100644
index 0000000..a5acba5
--- /dev/null
+++ b/core/java/android/service/chooser/OWNERS
@@ -0,0 +1,4 @@
+asc@google.com
+mpietal@google.com
+dsandler@android.com
+dsandler@google.com
diff --git a/core/java/android/service/contentcapture/OWNERS b/core/java/android/service/contentcapture/OWNERS
new file mode 100644
index 0000000..6337327
--- /dev/null
+++ b/core/java/android/service/contentcapture/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 544200
+
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/service/contentsuggestions/OWNERS b/core/java/android/service/contentsuggestions/OWNERS
new file mode 100644
index 0000000..46b5ea0
--- /dev/null
+++ b/core/java/android/service/contentsuggestions/OWNERS
@@ -0,0 +1,7 @@
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/service/dreams/OWNERS b/core/java/android/service/dreams/OWNERS
index 708ab4c..f831805 100644
--- a/core/java/android/service/dreams/OWNERS
+++ b/core/java/android/service/dreams/OWNERS
@@ -1,4 +1,3 @@
-dsandler@android.com
-michaelwr@google.com
-roosa@google.com
-galinap@google.com
+# Bug component: 78010
+
+dsandler@google.com
diff --git a/core/java/android/service/gatekeeper/OWNERS b/core/java/android/service/gatekeeper/OWNERS
new file mode 100644
index 0000000..2ca52cd
--- /dev/null
+++ b/core/java/android/service/gatekeeper/OWNERS
@@ -0,0 +1,3 @@
+swillden@google.com
+jdanis@google.com
+jbires@google.com
diff --git a/core/java/android/service/media/OWNERS b/core/java/android/service/media/OWNERS
new file mode 100644
index 0000000..916fc36
--- /dev/null
+++ b/core/java/android/service/media/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 137631
+
+hdmoon@google.com
+insun@google.com
+jaewan@google.com
+jinpark@google.com
+klhyun@google.com
+gyumin@google.com
diff --git a/core/java/android/service/notification/OWNERS b/core/java/android/service/notification/OWNERS
index 2e94be5..debb493 100644
--- a/core/java/android/service/notification/OWNERS
+++ b/core/java/android/service/notification/OWNERS
@@ -1,4 +1,6 @@
+# Bug component: 34005
+
juliacr@google.com
-beverlyt@google.com
+pixel@google.com
dsandler@android.com
-pixel@google.com
\ No newline at end of file
+dsandler@google.com
diff --git a/core/java/android/service/quicksettings/OWNERS b/core/java/android/service/quicksettings/OWNERS
new file mode 100644
index 0000000..12eb7c7
--- /dev/null
+++ b/core/java/android/service/quicksettings/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 78010
+
+kozynski@google.com
+pixel@google.com
+dsandler@android.com
+dsandler@google.com
diff --git a/core/java/android/service/resolver/OWNERS b/core/java/android/service/resolver/OWNERS
new file mode 100644
index 0000000..10150c37
--- /dev/null
+++ b/core/java/android/service/resolver/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 78010
+
+asc@google.com
+mpietal@google.com
+dsandler@android.com
+dsandler@google.com
diff --git a/core/java/android/service/restrictions/OWNERS b/core/java/android/service/restrictions/OWNERS
new file mode 100644
index 0000000..eaba2e9
--- /dev/null
+++ b/core/java/android/service/restrictions/OWNERS
@@ -0,0 +1 @@
+yamasani@google.com
diff --git a/core/java/android/service/textclassifier/OWNERS b/core/java/android/service/textclassifier/OWNERS
new file mode 100644
index 0000000..a535f52
--- /dev/null
+++ b/core/java/android/service/textclassifier/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 709498
+
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/service/textservice/OWNERS b/core/java/android/service/textservice/OWNERS
new file mode 100644
index 0000000..10b8b76
--- /dev/null
+++ b/core/java/android/service/textservice/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 34867
+
+include ../../inputmethodservice/OWNERS
\ No newline at end of file
diff --git a/core/java/android/service/trust/OWNERS b/core/java/android/service/trust/OWNERS
new file mode 100644
index 0000000..affe471
--- /dev/null
+++ b/core/java/android/service/trust/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 36824
+
+cbrubaker@google.com
+vishwath@google.com
diff --git a/core/java/android/service/voice/OWNERS b/core/java/android/service/voice/OWNERS
new file mode 100644
index 0000000..46b5ea0
--- /dev/null
+++ b/core/java/android/service/voice/OWNERS
@@ -0,0 +1,7 @@
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/service/voice/VoiceInteractionSession.java b/core/java/android/service/voice/VoiceInteractionSession.java
index 0b6d371..c1b66c7 100644
--- a/core/java/android/service/voice/VoiceInteractionSession.java
+++ b/core/java/android/service/voice/VoiceInteractionSession.java
@@ -1220,7 +1220,7 @@
* your UI, which will eventually culminate in {@link #onShow}. This is similar to calling
* {@link VoiceInteractionService#showSession VoiceInteractionService.showSession}.
* @param args Arbitrary arguments that will be propagated {@link #onShow}.
- * @param flags Indicates additional optional behavior that should be performed. May
+ * @param flags Indicates additional optional behavior that should be performed. May
* be any combination of
* {@link VoiceInteractionSession#SHOW_WITH_ASSIST VoiceInteractionSession.SHOW_WITH_ASSIST} and
* {@link VoiceInteractionSession#SHOW_WITH_SCREENSHOT
@@ -1583,6 +1583,11 @@
*
* @param args The arguments that were supplied to
* {@link VoiceInteractionService#showSession VoiceInteractionService.showSession}.
+ * Some example keys include : "invocation_type", "invocation_phone_state",
+ * "invocation_time_ms", Intent.EXTRA_TIME ("android.intent.extra.TIME") indicating timing
+ * in milliseconds of the KeyEvent that triggered Assistant and
+ * Intent.EXTRA_ASSIST_INPUT_DEVICE_ID (android.intent.extra.ASSIST_INPUT_DEVICE_ID)
+ * referring to the device that sent the request.
* @param showFlags The show flags originally provided to
* {@link VoiceInteractionService#showSession VoiceInteractionService.showSession}.
*/
diff --git a/core/java/android/service/wallpaper/OWNERS b/core/java/android/service/wallpaper/OWNERS
new file mode 100644
index 0000000..756eef8
--- /dev/null
+++ b/core/java/android/service/wallpaper/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 78010
+
+dupin@google.com
+dsandler@android.com
+dsandler@google.com
diff --git a/core/java/android/service/watchdog/OWNERS b/core/java/android/service/watchdog/OWNERS
new file mode 100644
index 0000000..1c045e1
--- /dev/null
+++ b/core/java/android/service/watchdog/OWNERS
@@ -0,0 +1,3 @@
+narayan@google.com
+nandana@google.com
+olilan@google.com
diff --git a/core/java/android/telephony/OWNERS b/core/java/android/telephony/OWNERS
new file mode 100644
index 0000000..640baf2
--- /dev/null
+++ b/core/java/android/telephony/OWNERS
@@ -0,0 +1 @@
+include /telephony/OWNERS
diff --git a/core/java/android/telephony/TelephonyRegistryManager.java b/core/java/android/telephony/TelephonyRegistryManager.java
index cc3284a..a9548b0 100644
--- a/core/java/android/telephony/TelephonyRegistryManager.java
+++ b/core/java/android/telephony/TelephonyRegistryManager.java
@@ -786,6 +786,21 @@
}
}
+ /**
+ * Notify that the data enabled has changed.
+ *
+ * @param enabled True if data is enabled, otherwise disabled.
+ * @param reason Reason for data enabled/disabled. See {@code REASON_*} in
+ * {@link TelephonyManager}.
+ */
+ public void notifyDataEnabled(boolean enabled, @TelephonyManager.DataEnabledReason int reason) {
+ try {
+ sRegistry.notifyDataEnabled(enabled, reason);
+ } catch (RemoteException ex) {
+ // system server crash
+ }
+ }
+
public @NonNull Set<Integer> getEventsFromListener(@NonNull PhoneStateListener listener) {
Set<Integer> eventList = new ArraySet<>();
diff --git a/core/java/android/timezone/OWNERS b/core/java/android/timezone/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/java/android/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/transition/OWNERS b/core/java/android/transition/OWNERS
new file mode 100644
index 0000000..eb5a581
--- /dev/null
+++ b/core/java/android/transition/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 25700
+
+romainguy@google.com
+mount@google.com
+alanv@google.com
+adamp@google.com
diff --git a/core/java/android/util/ExceptionUtils.java b/core/java/android/util/ExceptionUtils.java
index 1a397b3..4b511ac 100644
--- a/core/java/android/util/ExceptionUtils.java
+++ b/core/java/android/util/ExceptionUtils.java
@@ -98,4 +98,6 @@
}
return t;
}
+
+
}
\ No newline at end of file
diff --git a/core/java/android/util/TypedXmlPullParser.java b/core/java/android/util/TypedXmlPullParser.java
index b3b51b5..aa68bf4 100644
--- a/core/java/android/util/TypedXmlPullParser.java
+++ b/core/java/android/util/TypedXmlPullParser.java
@@ -30,67 +30,168 @@
*/
public interface TypedXmlPullParser extends XmlPullParser {
/**
- * @return decoded strongly-typed {@link #getAttributeValue}
- * @throws XmlPullParserException if the value is malformed or undefined
+ * @return index of requested attribute, otherwise {@code -1} if undefined
*/
- @NonNull byte[] getAttributeBytesHex(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default int getAttributeIndex(@Nullable String namespace, @NonNull String name) {
+ final boolean namespaceNull = (namespace == null);
+ final int count = getAttributeCount();
+ for (int i = 0; i < count; i++) {
+ if ((namespaceNull || namespace.equals(getAttributeNamespace(i)))
+ && name.equals(getAttributeName(i))) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * @return index of requested attribute
+ * @throws XmlPullParserException if the value is undefined
+ */
+ default int getAttributeIndexOrThrow(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) {
+ throw new XmlPullParserException("Missing attribute " + name);
+ } else {
+ return index;
+ }
+ }
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ @NonNull byte[] getAttributeBytesHex(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ @NonNull byte[] getAttributeBytesBase64(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ int getAttributeInt(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ int getAttributeIntHex(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ long getAttributeLong(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ long getAttributeLongHex(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ float getAttributeFloat(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ double getAttributeDouble(int index) throws XmlPullParserException;
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed
+ */
+ boolean getAttributeBoolean(int index) throws XmlPullParserException;
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- @NonNull byte[] getAttributeBytesBase64(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default @NonNull byte[] getAttributeBytesHex(@Nullable String namespace,
+ @NonNull String name) throws XmlPullParserException {
+ return getAttributeBytesHex(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- int getAttributeInt(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default @NonNull byte[] getAttributeBytesBase64(@Nullable String namespace,
+ @NonNull String name) throws XmlPullParserException {
+ return getAttributeBytesBase64(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- int getAttributeIntHex(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default int getAttributeInt(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ return getAttributeInt(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- long getAttributeLong(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default int getAttributeIntHex(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ return getAttributeIntHex(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- long getAttributeLongHex(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default long getAttributeLong(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ return getAttributeLong(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- float getAttributeFloat(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default long getAttributeLongHex(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ return getAttributeLongHex(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- double getAttributeDouble(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default float getAttributeFloat(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ return getAttributeFloat(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}
* @throws XmlPullParserException if the value is malformed or undefined
*/
- boolean getAttributeBoolean(@Nullable String namespace, @NonNull String name)
- throws XmlPullParserException;
+ default double getAttributeDouble(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ return getAttributeDouble(getAttributeIndexOrThrow(namespace, name));
+ }
+
+ /**
+ * @return decoded strongly-typed {@link #getAttributeValue}
+ * @throws XmlPullParserException if the value is malformed or undefined
+ */
+ default boolean getAttributeBoolean(@Nullable String namespace, @NonNull String name)
+ throws XmlPullParserException {
+ return getAttributeBoolean(getAttributeIndexOrThrow(namespace, name));
+ }
/**
* @return decoded strongly-typed {@link #getAttributeValue}, otherwise
@@ -98,8 +199,10 @@
*/
default @Nullable byte[] getAttributeBytesHex(@Nullable String namespace,
@NonNull String name, @Nullable byte[] defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeBytesHex(namespace, name);
+ return getAttributeBytesHex(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -111,8 +214,10 @@
*/
default @Nullable byte[] getAttributeBytesBase64(@Nullable String namespace,
@NonNull String name, @Nullable byte[] defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeBytesBase64(namespace, name);
+ return getAttributeBytesBase64(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -124,8 +229,10 @@
*/
default int getAttributeInt(@Nullable String namespace, @NonNull String name,
int defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeInt(namespace, name);
+ return getAttributeInt(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -137,8 +244,10 @@
*/
default int getAttributeIntHex(@Nullable String namespace, @NonNull String name,
int defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeIntHex(namespace, name);
+ return getAttributeIntHex(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -150,8 +259,10 @@
*/
default long getAttributeLong(@Nullable String namespace, @NonNull String name,
long defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeLong(namespace, name);
+ return getAttributeLong(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -163,8 +274,10 @@
*/
default long getAttributeLongHex(@Nullable String namespace, @NonNull String name,
long defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeLongHex(namespace, name);
+ return getAttributeLongHex(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -176,8 +289,10 @@
*/
default float getAttributeFloat(@Nullable String namespace, @NonNull String name,
float defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeFloat(namespace, name);
+ return getAttributeFloat(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -189,8 +304,10 @@
*/
default double getAttributeDouble(@Nullable String namespace, @NonNull String name,
double defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeDouble(namespace, name);
+ return getAttributeDouble(index);
} catch (Exception ignored) {
return defaultValue;
}
@@ -202,8 +319,10 @@
*/
default boolean getAttributeBoolean(@Nullable String namespace, @NonNull String name,
boolean defaultValue) {
+ final int index = getAttributeIndex(namespace, name);
+ if (index == -1) return defaultValue;
try {
- return getAttributeBoolean(namespace, name);
+ return getAttributeBoolean(index);
} catch (Exception ignored) {
return defaultValue;
}
diff --git a/core/java/android/util/proto/OWNERS b/core/java/android/util/proto/OWNERS
new file mode 100644
index 0000000..1eb6abf
--- /dev/null
+++ b/core/java/android/util/proto/OWNERS
@@ -0,0 +1,2 @@
+dplotnikov@google.com
+mwachens@google.com
diff --git a/core/java/android/view/IPinnedStackListener.aidl b/core/java/android/view/IPinnedStackListener.aidl
index 84dd8af..29c9c15 100644
--- a/core/java/android/view/IPinnedStackListener.aidl
+++ b/core/java/android/view/IPinnedStackListener.aidl
@@ -58,19 +58,6 @@
void onActivityHidden(in ComponentName componentName);
/**
- * Called when the window manager has detected change on DisplayInfo, or
- * when the listener is first registered to allow the listener to synchronized its state with
- * the controller.
- */
- void onDisplayInfoChanged(in DisplayInfo displayInfo);
-
- /**
- * Called by the window manager at the beginning of a configuration update cascade
- * since the metrics from these resources are used for bounds calculations.
- */
- void onConfigurationChanged();
-
- /**
* Called by the window manager when the aspect ratio is reset.
*/
void onAspectRatioChanged(float aspectRatio);
diff --git a/core/java/android/view/IRecentsAnimationController.aidl b/core/java/android/view/IRecentsAnimationController.aidl
index f209d88..cac91a9 100644
--- a/core/java/android/view/IRecentsAnimationController.aidl
+++ b/core/java/android/view/IRecentsAnimationController.aidl
@@ -136,4 +136,13 @@
* @return {@code true} when target removed successfully, {@code false} otherwise.
*/
boolean removeTask(int taskId);
+
+ /**
+ * Detach navigation bar from app.
+ *
+ * The system reparents the leash of navigation bar to the app when the recents animation starts
+ * and Launcher should call this method to let system restore the navigation bar to its
+ * original position when the quick switch gesture is finished.
+ */
+ void detachNavigationBarFromApp();
}
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java
index 8da833a..df96dc3 100644
--- a/core/java/android/view/InputDevice.java
+++ b/core/java/android/view/InputDevice.java
@@ -17,6 +17,7 @@
package android.view;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
@@ -28,7 +29,9 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Vibrator;
+import android.os.VibratorManager;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import java.lang.annotation.Retention;
@@ -72,6 +75,9 @@
private Vibrator mVibrator; // guarded by mMotionRanges during initialization
+ @GuardedBy("mMotionRanges")
+ private VibratorManager mVibratorManager;
+
/**
* A mask for input source classes.
*
@@ -415,6 +421,8 @@
private static final int MAX_RANGES = 1000;
+ private static final int VIBRATOR_ID_ALL = -1;
+
public static final @android.annotation.NonNull Parcelable.Creator<InputDevice> CREATOR =
new Parcelable.Creator<InputDevice>() {
public InputDevice createFromParcel(Parcel in) {
@@ -785,7 +793,8 @@
synchronized (mMotionRanges) {
if (mVibrator == null) {
if (mHasVibrator) {
- mVibrator = InputManager.getInstance().getInputDeviceVibrator(mId);
+ mVibrator = InputManager.getInstance().getInputDeviceVibrator(mId,
+ VIBRATOR_ID_ALL);
} else {
mVibrator = NullVibrator.getInstance();
}
@@ -795,6 +804,24 @@
}
/**
+ * Gets the vibrator manager associated with the device.
+ * Even if the device does not have a vibrator manager, the result is never null.
+ * Use {@link VibratorManager#getVibratorIds} to determine whether any vibrator is
+ * present.
+ *
+ * @return The vibrator manager associated with the device, never null.
+ */
+ @NonNull
+ public VibratorManager getVibratorManager() {
+ synchronized (mMotionRanges) {
+ if (mVibratorManager == null) {
+ mVibratorManager = InputManager.getInstance().getInputDeviceVibratorManager(mId);
+ }
+ }
+ return mVibratorManager;
+ }
+
+ /**
* Returns true if input device is enabled.
* @return Whether the input device is enabled.
*/
diff --git a/core/java/android/view/InsetsAnimationThreadControlRunner.java b/core/java/android/view/InsetsAnimationThreadControlRunner.java
index 4a5fa0f..0939336 100644
--- a/core/java/android/view/InsetsAnimationThreadControlRunner.java
+++ b/core/java/android/view/InsetsAnimationThreadControlRunner.java
@@ -81,6 +81,7 @@
SyncRtSurfaceTransactionApplier.SurfaceParams surfaceParams = params[i];
applyParams(t, surfaceParams, mTmpFloat9);
}
+ t.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
t.apply();
t.close();
}
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index a8d2615..52b7cff 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -477,6 +477,14 @@
public static final int FLAG_IS_GENERATED_GESTURE = 0x8;
/**
+ * This flag associated with {@link #ACTION_POINTER_UP}, this indicates that the pointer
+ * has been canceled. Typically this is used for palm event when the user has accidental
+ * touches.
+ * @hide
+ */
+ public static final int FLAG_CANCELED = 0x20;
+
+ /**
* Private flag that indicates when the system has detected that this motion event
* may be inconsistent with respect to the sequence of previously delivered motion events,
* such as when a pointer move event is sent but the pointer is not down.
@@ -3477,7 +3485,8 @@
} else if (newPointerCount == 1) {
// The first/last pointer went down/up.
newAction = oldActionMasked == ACTION_POINTER_DOWN
- ? ACTION_DOWN : ACTION_UP;
+ ? ACTION_DOWN
+ : (getFlags() & FLAG_CANCELED) == 0 ? ACTION_UP : ACTION_CANCEL;
} else {
// A secondary pointer went down/up.
newAction = oldActionMasked
diff --git a/core/java/android/view/OWNERS b/core/java/android/view/OWNERS
index 7b60f2e..72fa4c3 100644
--- a/core/java/android/view/OWNERS
+++ b/core/java/android/view/OWNERS
@@ -1,15 +1,74 @@
+# Bug component: 25700
+
+romainguy@google.com
+alanv@google.com
+adamp@google.com
+aurimas@google.com
+nduca@google.com
+sumir@google.com
+ogunwale@google.com
+jjaggi@google.com
+roosa@google.com
+
# Display
-per-file Display.java = michaelwr@google.com, santoscordon@google.com
-per-file DisplayInfo.java = michaelwr@google.com, santoscordon@google.com
+per-file Display*.java = file:/services/core/java/com/android/server/display/OWNERS
+per-file Display*.aidl = file:/services/core/java/com/android/server/display/OWNERS
# Haptics
-per-file HapticFeedbackConstants.java = michaelwr@google.com, santoscordon@google.com
+per-file HapticFeedbackConstants.java = file:/services/core/java/com/android/server/input/OWNERS
+
+# Ime
+per-file Ime*.java = file:/core/java/android/view/inputmethod/OWNERS
# Input
-per-file IInputMonitorHost.aidl = michaelwr@google.com, svv@google.com
-per-file Input*.java = michaelwr@google.com, svv@google.com
-per-file Input*.aidl = michaelwr@google.com, svv@google.com
-per-file KeyEvent.java = michaelwr@google.com, svv@google.com
-per-file MotionEvent.java = michaelwr@google.com, svv@google.com
-per-file PointerIcon.java = michaelwr@google.com, svv@google.com
-per-file SimulatedDpad.java = michaelwr@google.com, svv@google.com
+per-file IInput*.aidl = file:/services/core/java/com/android/server/input/OWNERS
+per-file Input*.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file Input*.aidl = file:/services/core/java/com/android/server/input/OWNERS
+per-file KeyEvent.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file MotionEvent.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file PointerIcon.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file SimulatedDpad.java = file:/services/core/java/com/android/server/input/OWNERS
+
+# InputWindowHandle
+per-file InputWindowHandle.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file InputWindowHandle.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# Surface
+per-file Surface.java = file:/graphics/java/android/graphics/OWNERS
+per-file Surface.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceView.java = file:/graphics/java/android/graphics/OWNERS
+per-file SurfaceView.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceHolder.java = file:/graphics/java/android/graphics/OWNERS
+per-file SurfaceHolder.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# View
+per-file View.java = file:/services/accessibility/OWNERS
+per-file View.java = file:/core/java/android/service/autofill/OWNERS
+per-file View.java = file:/graphics/java/android/graphics/OWNERS
+per-file View.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file View.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file ViewRootImpl.java = file:/services/accessibility/OWNERS
+per-file ViewRootImpl.java = file:/core/java/android/service/autofill/OWNERS
+per-file ViewRootImpl.java = file:/graphics/java/android/graphics/OWNERS
+per-file ViewRootImpl.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file ViewRootImpl.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# WindowManager
+per-file DisplayCutout.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file DisplayCutout.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IDisplay*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Inset*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Inset*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IPinnedStackListener.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IRecents*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IRemote*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IWindow*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file RemoteAnimation*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file RemoteAnimation*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceControl*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceControl*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceSession.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SyncRtSurfaceTransactionApplier.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file ViewRootInsetsControllerHost.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Window*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Window*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index d7ee6ad..23de215 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -26,6 +26,7 @@
import static android.view.SurfaceControlProto.NAME;
import android.annotation.FloatRange;
+import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -54,12 +55,15 @@
import android.view.Surface.OutOfResourcesException;
import com.android.internal.annotations.GuardedBy;
+import com.android.internal.util.VirtualRefBasePtr;
import dalvik.system.CloseGuard;
import libcore.util.NativeAllocationRegistry;
import java.io.Closeable;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@@ -224,6 +228,10 @@
IBinder focusedToken, int displayId);
private static native void nativeSetFrameTimelineVsync(long transactionObj,
long frameTimelineVsyncId);
+ private static native void nativeAddJankDataListener(long nativeListener,
+ long nativeSurfaceControl);
+ private static native void nativeRemoveJankDataListener(long nativeListener);
+ private static native long nativeCreateJankDataListenerWrapper(OnJankDataListener listener);
@Nullable
@GuardedBy("mLock")
@@ -249,6 +257,73 @@
void onReparent(@NonNull Transaction transaction, @Nullable SurfaceControl parent);
}
+ /**
+ * Jank information to be fed back via {@link OnJankDataListener}.
+ * @hide
+ */
+ public static class JankData {
+
+ /** @hide */
+ @IntDef(flag = true, value = {JANK_NONE,
+ JANK_DISPLAY,
+ JANK_SURFACEFLINGER_DEADLINE_MISSED,
+ JANK_SURFACEFLINGER_GPU_DEADLINE_MISSED,
+ JANK_APP_DEADLINE_MISSED,
+ JANK_PREDICTION_EXPIRED,
+ JANK_SURFACEFLINGER_EARLY_LATCH})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface JankType {}
+
+ // Needs to be kept in sync with frameworks/native/libs/gui/include/gui/JankInfo.h
+
+ // No Jank
+ public static final int JANK_NONE = 0x0;
+
+ // Jank not related to SurfaceFlinger or the App
+ public static final int JANK_DISPLAY = 0x1;
+ // SF took too long on the CPU
+ public static final int JANK_SURFACEFLINGER_DEADLINE_MISSED = 0x2;
+ // SF took too long on the GPU
+ public static final int JANK_SURFACEFLINGER_GPU_DEADLINE_MISSED = 0x4;
+ // Either App or GPU took too long on the frame
+ public static final int JANK_APP_DEADLINE_MISSED = 0x8;
+ // Predictions live for 120ms, if prediction is expired for a frame, there is definitely a
+ // jank
+ // associated with the App if this is for a SurfaceFrame, and SF for a DisplayFrame.
+ public static final int JANK_PREDICTION_EXPIRED = 0x10;
+ // Latching a buffer early might cause an early present of the frame
+ public static final int JANK_SURFACEFLINGER_EARLY_LATCH = 0x20;
+
+ public JankData(long frameVsyncId, @JankType int jankType) {
+ this.frameVsyncId = frameVsyncId;
+ this.jankType = jankType;
+ }
+
+ public final long frameVsyncId;
+ public final @JankType int jankType;
+ }
+
+ /**
+ * Listener interface to be informed about SurfaceFlinger's jank classification for a specific
+ * surface.
+ *
+ * @see JankData
+ * @see #addJankDataListener
+ * @hide
+ */
+ public static abstract class OnJankDataListener {
+ private final VirtualRefBasePtr mNativePtr;
+
+ public OnJankDataListener() {
+ mNativePtr = new VirtualRefBasePtr(nativeCreateJankDataListenerWrapper(this));
+ }
+
+ /**
+ * Called when new jank classifications are available.
+ */
+ public abstract void onJankDataAvailable(JankData[] jankStats);
+ }
+
private final CloseGuard mCloseGuard = CloseGuard.get();
private String mName;
@@ -1526,97 +1601,6 @@
/**
* @hide
*/
- public void deferTransactionUntil(SurfaceControl barrier, long frame) {
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.deferTransactionUntil(this, barrier, frame);
- }
- }
-
- /**
- * @hide
- */
- public void reparentChildren(SurfaceControl newParent) {
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.reparentChildren(this, newParent);
- }
- }
-
- /**
- * @hide
- */
- public void detachChildren() {
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.detachChildren(this);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void setLayer(int zorder) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setLayer(this, zorder);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void setPosition(float x, float y) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setPosition(this, x, y);
- }
- }
-
- /**
- * @hide
- */
- public void setBufferSize(int w, int h) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setBufferSize(this, w, h);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void hide() {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.hide(this);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void show() {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.show(this);
- }
- }
-
- /**
- * @hide
- */
- public void setTransparentRegionHint(Region region) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setTransparentRegionHint(this, region);
- }
- }
-
- /**
- * @hide
- */
public boolean clearContentFrameStats() {
checkNotReleased();
return nativeClearContentFrameStats(mNativeObject);
@@ -1647,87 +1631,6 @@
/**
* @hide
*/
- public void setAlpha(float alpha) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setAlpha(this, alpha);
- }
- }
-
- /**
- * @hide
- */
- public void setBackgroundBlurRadius(int blur) {
- checkNotReleased();
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setBackgroundBlurRadius(this, blur);
- }
- }
-
- /**
- * @hide
- */
- public void setMatrix(float dsdx, float dtdx, float dtdy, float dsdy) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setMatrix(this, dsdx, dtdx, dtdy, dsdy);
- }
- }
-
- /**
- * Sets the Surface to be color space agnostic. If a surface is color space agnostic,
- * the color can be interpreted in any color space.
- * @param agnostic A boolean to indicate whether the surface is color space agnostic
- * @hide
- */
- public void setColorSpaceAgnostic(boolean agnostic) {
- checkNotReleased();
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setColorSpaceAgnostic(this, agnostic);
- }
- }
-
- /**
- * Bounds the surface and its children to the bounds specified. Size of the surface will be
- * ignored and only the crop and buffer size will be used to determine the bounds of the
- * surface. If no crop is specified and the surface has no buffer, the surface bounds is only
- * constrained by the size of its parent bounds.
- *
- * @param crop Bounds of the crop to apply.
- * @hide
- */
- public void setWindowCrop(Rect crop) {
- checkNotReleased();
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setWindowCrop(this, crop);
- }
- }
-
- /**
- * @hide
- */
- public void setOpaque(boolean isOpaque) {
- checkNotReleased();
-
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setOpaque(this, isOpaque);
- }
- }
-
- /**
- * @hide
- */
- public void setSecure(boolean isSecure) {
- checkNotReleased();
-
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setSecure(this, isSecure);
- }
- }
-
- /**
- * @hide
- */
public int getWidth() {
synchronized (mLock) {
return mWidth;
@@ -2519,6 +2422,22 @@
nativeSetGlobalShadowSettings(ambientColor, spotColor, lightPosY, lightPosZ, lightRadius);
}
+ /**
+ * Adds a callback to be informed about SF's jank classification for a specific surface.
+ * @hide
+ */
+ public static void addJankDataListener(OnJankDataListener listener, SurfaceControl surface) {
+ nativeAddJankDataListener(listener.mNativePtr.get(), surface.mNativeObject);
+ }
+
+ /**
+ * Removes a jank callback previously added with {@link #addJankDataListener}
+ * @hide
+ */
+ public static void removeJankDataListener(OnJankDataListener listener) {
+ nativeRemoveJankDataListener(listener.mNativePtr.get());
+ }
+
/**
* An atomic set of changes to a set of SurfaceControl.
*/
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 29cc4b5..9943e02 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -29023,6 +29023,33 @@
boolean mUse32BitDrawingCache;
/**
+ * For windows that are full-screen but using insets to layout inside
+ * of the screen decorations, these are the current insets for the
+ * content of the window.
+ */
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@link WindowInsets#getInsets(int)}")
+ final Rect mContentInsets = new Rect();
+
+ /**
+ * For windows that are full-screen but using insets to layout inside
+ * of the screen decorations, these are the current insets for the
+ * actual visible parts of the window.
+ */
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@link WindowInsets#getInsets(int)}")
+ final Rect mVisibleInsets = new Rect();
+
+ /**
+ * For windows that are full-screen but using insets to layout inside
+ * of the screen decorations, these are the current insets for the
+ * stable system windows.
+ */
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q,
+ publicAlternatives = "Use {@link WindowInsets#getInsets(int)}")
+ final Rect mStableInsets = new Rect();
+
+ /**
* Current caption insets to the display coordinate.
*/
final Rect mCaptionInsets = new Rect();
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 2d633cb..863ee7b 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -582,9 +582,6 @@
= new ViewTreeObserver.InternalInsetsInfo();
private WindowInsets mLastWindowInsets;
- private final Rect mSystemInsetsCache = new Rect();
- private final Rect mVisibleInsetsCache = new Rect();
- private final Rect mStableInsetsCache = new Rect();
// Insets types hidden by legacy window flags or system UI flags.
private @InsetsType int mTypesHiddenByFlags = 0;
@@ -2341,9 +2338,9 @@
(mWindowAttributes.systemUiVisibility
| mWindowAttributes.subtreeSystemUiVisibility));
- mSystemInsetsCache.set(mLastWindowInsets.getSystemWindowInsets().toRect());
- mStableInsetsCache.set(mLastWindowInsets.getStableInsets().toRect());
- mVisibleInsetsCache.set(mInsetsController.calculateVisibleInsets(
+ mAttachInfo.mContentInsets.set(mLastWindowInsets.getSystemWindowInsets().toRect());
+ mAttachInfo.mStableInsets.set(mLastWindowInsets.getStableInsets().toRect());
+ mAttachInfo.mVisibleInsets.set(mInsetsController.calculateVisibleInsets(
mWindowAttributes.softInputMode));
}
return mLastWindowInsets;
@@ -2846,7 +2843,7 @@
&& mWinFrame.height() == mPendingBackDropFrame.height();
// TODO: Need cutout?
startDragResizing(mPendingBackDropFrame, !backdropSizeMatchesFrame,
- mSystemInsetsCache, mStableInsetsCache, mResizeMode);
+ mAttachInfo.mContentInsets, mAttachInfo.mStableInsets, mResizeMode);
} else {
// We shouldn't come here, but if we come we should end the resize.
endDragResizing();
@@ -4478,8 +4475,8 @@
}
boolean scrollToRectOrFocus(Rect rectangle, boolean immediate) {
- final Rect ci = mSystemInsetsCache;
- final Rect vi = mVisibleInsetsCache;
+ final Rect ci = mAttachInfo.mContentInsets;
+ final Rect vi = mAttachInfo.mVisibleInsets;
int scrollY = 0;
boolean handled = false;
@@ -7575,7 +7572,7 @@
// XXX This is really broken, and probably all needs to be done
// in the window manager, and we need to know more about whether
// we want the area behind or in front of the IME.
- final Rect insets = mVisibleInsetsCache;
+ final Rect insets = mAttachInfo.mVisibleInsets;
outFrame.left += insets.left;
outFrame.top += insets.top;
outFrame.right -= insets.right;
@@ -7913,7 +7910,7 @@
synchronized (mWindowCallbacks) {
for (int i = mWindowCallbacks.size() - 1; i >= 0; i--) {
mWindowCallbacks.get(i).onWindowSizeIsChanging(backDropFrame, fullscreen,
- mVisibleInsetsCache, mStableInsetsCache);
+ mAttachInfo.mVisibleInsets, mAttachInfo.mStableInsets);
}
}
}
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 13d9eb9..af18293 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -16,7 +16,11 @@
package android.view;
+import static android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+import static android.Manifest.permission.HIDE_OVERLAY_WINDOWS;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
+import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import android.annotation.ColorInt;
import android.annotation.DrawableRes;
@@ -24,6 +28,7 @@
import android.annotation.LayoutRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
import android.annotation.StyleRes;
import android.annotation.SystemApi;
import android.annotation.TestApi;
@@ -991,6 +996,26 @@
}
/**
+ * Prevent non-system overlay windows from being drawn on top of this window.
+ *
+ * @param hide whether non-system overlay windows should be hidden.
+ */
+ @RequiresPermission(HIDE_OVERLAY_WINDOWS)
+ public final void setHideOverlayWindows(boolean hide) {
+ // This permission check is here to throw early and let the developer know that they need
+ // to hold HIDE_OVERLAY_WINDOWS for the flag to have any effect. The WM verifies that the
+ // owner of the window has the permission before applying the flag, but this is done
+ // asynchronously.
+ if (mContext.checkSelfPermission(HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != PERMISSION_GRANTED
+ && mContext.checkSelfPermission(HIDE_OVERLAY_WINDOWS) != PERMISSION_GRANTED) {
+ throw new SecurityException(
+ "Permission denial: setHideOverlayWindows: HIDE_OVERLAY_WINDOWS");
+ }
+ setPrivateFlags(hide ? SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS : 0,
+ SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+ }
+
+ /**
* Take ownership of this window's surface. The window's view hierarchy
* will no longer draw into the surface, though it will otherwise continue
* to operate (such as for receiving input events). The given SurfaceHolder
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index b9afbc9..6d88d63 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -343,23 +343,48 @@
/** @hide */
int TRANSIT_NONE = 0;
- /** @hide */
+ /**
+ * A window that didn't exist before has been created and made visible.
+ * @hide
+ */
int TRANSIT_OPEN = 1;
- /** @hide */
+ /**
+ * A window that was visible no-longer exists (was finished or destroyed).
+ * @hide
+ */
int TRANSIT_CLOSE = 2;
- /** @hide */
+ /**
+ * A window that already existed but was not visible is made visible.
+ * @hide
+ */
int TRANSIT_TO_FRONT = 3;
- /** @hide */
+ /**
+ * A window that was visible is made invisible but still exists.
+ * @hide
+ */
int TRANSIT_TO_BACK = 4;
/** @hide */
int TRANSIT_RELAUNCH = 5;
- /** @hide */
- int TRANSIT_CHANGE_WINDOWING_MODE = 6;
- /** @hide */
+ /**
+ * A window is visible before and after but changes in some way (eg. it resizes or changes
+ * windowing-mode).
+ * @hide
+ */
+ int TRANSIT_CHANGE = 6;
+ /**
+ * The keyguard was visible and has been dismissed.
+ * @hide
+ */
int TRANSIT_KEYGUARD_GOING_AWAY = 7;
- /** @hide */
+ /**
+ * A window is appearing above a locked keyguard.
+ * @hide
+ */
int TRANSIT_KEYGUARD_OCCLUDE = 8;
- /** @hide */
+ /**
+ * A window is made invisible revealing a locked keyguard.
+ * @hide
+ */
int TRANSIT_KEYGUARD_UNOCCLUDE = 9;
/**
@@ -372,7 +397,7 @@
TRANSIT_TO_FRONT,
TRANSIT_TO_BACK,
TRANSIT_RELAUNCH,
- TRANSIT_CHANGE_WINDOWING_MODE,
+ TRANSIT_CHANGE,
TRANSIT_KEYGUARD_GOING_AWAY,
TRANSIT_KEYGUARD_OCCLUDE,
TRANSIT_KEYGUARD_UNOCCLUDE,
@@ -418,6 +443,12 @@
int TRANSIT_FLAG_OPEN_BEHIND = 0x20;
/**
+ * Transition flag: The keyguard is locked throughout the whole transition.
+ * @hide
+ */
+ int TRANSIT_FLAG_KEYGUARD_LOCKED = 0x40;
+
+ /**
* @hide
*/
@IntDef(flag = true, prefix = { "TRANSIT_FLAG_" }, value = {
@@ -426,7 +457,8 @@
TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER,
TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION,
TRANSIT_FLAG_APP_CRASHED,
- TRANSIT_FLAG_OPEN_BEHIND
+ TRANSIT_FLAG_OPEN_BEHIND,
+ TRANSIT_FLAG_KEYGUARD_LOCKED
})
@Retention(RetentionPolicy.SOURCE)
@interface TransitionFlags {}
diff --git a/core/java/android/view/accessibility/OWNERS b/core/java/android/view/accessibility/OWNERS
index c6f42f7..93b5a2e 100644
--- a/core/java/android/view/accessibility/OWNERS
+++ b/core/java/android/view/accessibility/OWNERS
@@ -1,4 +1,11 @@
-svetoslavganov@google.com
+# Bug component: 44214
+
+romainguy@google.com
+alanv@google.com
+adamp@google.com
+aurimas@google.com
+nduca@google.com
+sumir@google.com
+ogunwale@google.com
+jjaggi@google.com
pweaver@google.com
-rhedjao@google.com
-qasid@google.com
diff --git a/core/java/android/view/animation/OWNERS b/core/java/android/view/animation/OWNERS
new file mode 100644
index 0000000..9b8f4d9
--- /dev/null
+++ b/core/java/android/view/animation/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 25700
+
+romainguy@google.com
+tianliu@google.com
+alanv@google.com
+adamp@google.com
diff --git a/core/java/android/view/autofill/OWNERS b/core/java/android/view/autofill/OWNERS
new file mode 100644
index 0000000..a088632
--- /dev/null
+++ b/core/java/android/view/autofill/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 351486
+
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/view/contentcapture/MainContentCaptureSession.java b/core/java/android/view/contentcapture/MainContentCaptureSession.java
index 16fd383..3c18b6b 100644
--- a/core/java/android/view/contentcapture/MainContentCaptureSession.java
+++ b/core/java/android/view/contentcapture/MainContentCaptureSession.java
@@ -43,6 +43,7 @@
import android.os.IBinder;
import android.os.IBinder.DeathRecipient;
import android.os.RemoteException;
+import android.text.TextUtils;
import android.util.LocalLog;
import android.util.Log;
import android.util.TimeUtils;
@@ -334,15 +335,22 @@
if (!mEvents.isEmpty() && eventType == TYPE_VIEW_TEXT_CHANGED) {
final ContentCaptureEvent lastEvent = mEvents.get(mEvents.size() - 1);
- // TODO(b/121045053): check if flags match
+ // We merge two consecutive text change event, unless one of them clears the text.
if (lastEvent.getType() == TYPE_VIEW_TEXT_CHANGED
&& lastEvent.getId().equals(event.getId())) {
- if (sVerbose) {
+ boolean bothNonEmpty = !TextUtils.isEmpty(lastEvent.getText())
+ && !TextUtils.isEmpty(event.getText());
+ boolean equalContent = TextUtils.equals(lastEvent.getText(), event.getText());
+ if (equalContent) {
+ addEvent = false;
+ } else if (bothNonEmpty) {
+ lastEvent.mergeEvent(event);
+ addEvent = false;
+ }
+ if (!addEvent && sVerbose) {
Log.v(TAG, "Buffering VIEW_TEXT_CHANGED event, updated text="
+ getSanitizedString(event.getText()));
}
- lastEvent.mergeEvent(event);
- addEvent = false;
}
}
diff --git a/core/java/android/view/contentcapture/OWNERS b/core/java/android/view/contentcapture/OWNERS
new file mode 100644
index 0000000..6337327
--- /dev/null
+++ b/core/java/android/view/contentcapture/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 544200
+
+joannechung@google.com
+adamhe@google.com
+tymtsai@google.com
+lpeter@google.com
+augale@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
diff --git a/core/java/android/view/inputmethod/OWNERS b/core/java/android/view/inputmethod/OWNERS
index 244cc30..e6a04da 100644
--- a/core/java/android/view/inputmethod/OWNERS
+++ b/core/java/android/view/inputmethod/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 34867
set noparent
-include ../../../../../services/core/java/com/android/server/inputmethod/OWNERS
+include /services/core/java/com/android/server/inputmethod/OWNERS
diff --git a/core/java/android/view/inspector/OWNERS b/core/java/android/view/inspector/OWNERS
index c2827cc..705f4b3 100644
--- a/core/java/android/view/inspector/OWNERS
+++ b/core/java/android/view/inspector/OWNERS
@@ -1,3 +1,6 @@
+romainguy@google.com
alanv@google.com
+adamp@google.com
aurimas@google.com
-emberrose@google.com
+nduca@google.com
+sumir@google.com
diff --git a/core/java/android/view/textclassifier/OWNERS b/core/java/android/view/textclassifier/OWNERS
index be4fbaa..ac80d9f 100644
--- a/core/java/android/view/textclassifier/OWNERS
+++ b/core/java/android/view/textclassifier/OWNERS
@@ -1,14 +1,8 @@
# Bug component: 709498
+mns@google.com
toki@google.com
-tonymak@google.com
-zilka@google.com
-jalt@google.com
-joannechung@google.com
+svetoslavganov@android.com
svetoslavganov@google.com
-eugeniom@google.com
-samsellem@google.com
-adamhe@google.com
augale@google.com
-lpeter@google.com
-tymtsai@google.com
\ No newline at end of file
+joannechung@google.com
diff --git a/core/java/android/view/textclassifier/intent/OWNERS b/core/java/android/view/textclassifier/intent/OWNERS
new file mode 100644
index 0000000..ac80d9f
--- /dev/null
+++ b/core/java/android/view/textclassifier/intent/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 709498
+
+mns@google.com
+toki@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
+augale@google.com
+joannechung@google.com
diff --git a/core/java/android/view/textclassifier/logging/OWNERS b/core/java/android/view/textclassifier/logging/OWNERS
new file mode 100644
index 0000000..ac80d9f
--- /dev/null
+++ b/core/java/android/view/textclassifier/logging/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 709498
+
+mns@google.com
+toki@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
+augale@google.com
+joannechung@google.com
diff --git a/core/java/android/view/textservice/OWNERS b/core/java/android/view/textservice/OWNERS
new file mode 100644
index 0000000..582be8d
--- /dev/null
+++ b/core/java/android/view/textservice/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 34867
+
+include ../inputmethod/OWNERS
diff --git a/core/java/android/widget/OWNERS b/core/java/android/widget/OWNERS
index 5c79d21..718076b 100644
--- a/core/java/android/widget/OWNERS
+++ b/core/java/android/widget/OWNERS
@@ -1 +1,11 @@
+# Bug component: 25700
+
+romainguy@google.com
+alanv@google.com
+adamp@google.com
+aurimas@google.com
+siyamed@google.com
+
per-file TextView.java, EditText.java, Editor.java = siyamed@google.com, nona@google.com, clarabayarri@google.com
+
+per-file SpellChecker.java = file:../view/inputmethod/OWNERS
diff --git a/core/java/android/window/OWNERS b/core/java/android/window/OWNERS
index d10fb31..2c61df9 100644
--- a/core/java/android/window/OWNERS
+++ b/core/java/android/window/OWNERS
@@ -1,3 +1,3 @@
set noparent
-include ../../../../services/core/java/com/android/server/wm/OWNERS
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/core/java/android/window/TaskOrganizer.java b/core/java/android/window/TaskOrganizer.java
index c4bdb5a..12c4b5b 100644
--- a/core/java/android/window/TaskOrganizer.java
+++ b/core/java/android/window/TaskOrganizer.java
@@ -210,6 +210,15 @@
}
}
+ /**
+ * Gets the executor to run callbacks on.
+ * @hide
+ */
+ @NonNull
+ public Executor getExecutor() {
+ return mExecutor;
+ }
+
private final ITaskOrganizer mInterface = new ITaskOrganizer.Stub() {
@Override
public void addStartingWindow(ActivityManager.RunningTaskInfo taskInfo, IBinder appToken) {
diff --git a/core/java/android/window/TransitionInfo.java b/core/java/android/window/TransitionInfo.java
index b4e7d6a..52ab38f 100644
--- a/core/java/android/window/TransitionInfo.java
+++ b/core/java/android/window/TransitionInfo.java
@@ -16,6 +16,13 @@
package android.window;
+import static android.view.WindowManager.TRANSIT_CHANGE;
+import static android.view.WindowManager.TRANSIT_CLOSE;
+import static android.view.WindowManager.TRANSIT_NONE;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
+
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -35,48 +42,38 @@
*/
public final class TransitionInfo implements Parcelable {
- /** No transition mode. This is a placeholder, don't use this as an actual mode. */
- public static final int TRANSIT_NONE = 0;
-
- /** The container didn't exist before but will exist and be visible after. */
- public static final int TRANSIT_OPEN = 1;
-
- /** The container existed and was visible before but won't exist after. */
- public static final int TRANSIT_CLOSE = 2;
-
- /** The container existed before but was invisible and will be visible after. */
- public static final int TRANSIT_SHOW = 3;
-
- /** The container is going from visible to invisible but it will still exist after. */
- public static final int TRANSIT_HIDE = 4;
-
- /** The container exists and is visible before and after but it changes. */
- public static final int TRANSIT_CHANGE = 5;
-
- /** @hide */
+ /**
+ * Modes are only a sub-set of all the transit-types since they are per-container
+ * @hide
+ */
@IntDef(prefix = { "TRANSIT_" }, value = {
TRANSIT_NONE,
TRANSIT_OPEN,
TRANSIT_CLOSE,
- TRANSIT_SHOW,
- TRANSIT_HIDE,
+ // Note: to_front/to_back really mean show/hide respectively at the container level.
+ TRANSIT_TO_FRONT,
+ TRANSIT_TO_BACK,
TRANSIT_CHANGE
})
public @interface TransitionMode {}
private final @WindowManager.TransitionOldType int mType;
+ private final @WindowManager.TransitionFlags int mFlags;
private final ArrayList<Change> mChanges = new ArrayList<>();
private SurfaceControl mRootLeash;
private final Point mRootOffset = new Point();
/** @hide */
- public TransitionInfo(@WindowManager.TransitionOldType int type) {
+ public TransitionInfo(@WindowManager.TransitionOldType int type,
+ @WindowManager.TransitionFlags int flags) {
mType = type;
+ mFlags = flags;
}
private TransitionInfo(Parcel in) {
mType = in.readInt();
+ mFlags = in.readInt();
in.readList(mChanges, null /* classLoader */);
mRootLeash = new SurfaceControl();
mRootLeash.readFromParcel(in);
@@ -87,6 +84,7 @@
/** @hide */
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mType);
+ dest.writeInt(mFlags);
dest.writeList(mChanges);
mRootLeash.writeToParcel(dest, flags);
mRootOffset.writeToParcel(dest, flags);
@@ -122,6 +120,10 @@
return mType;
}
+ public int getFlags() {
+ return mFlags;
+ }
+
/**
* @return a surfacecontrol that can serve as a parent surfacecontrol for all the changing
* participants to animate within. This will generally be placed at the highest-z-order
@@ -170,7 +172,8 @@
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("{t=" + mType + " ro=" + mRootOffset + " c=[");
+ sb.append("{t=" + mType + " f=" + Integer.toHexString(mFlags)
+ + " ro=" + mRootOffset + " c=[");
for (int i = 0; i < mChanges.size(); ++i) {
if (i > 0) {
sb.append(',');
@@ -188,8 +191,8 @@
case TRANSIT_NONE: return "NONE";
case TRANSIT_OPEN: return "OPEN";
case TRANSIT_CLOSE: return "CLOSE";
- case TRANSIT_SHOW: return "SHOW";
- case TRANSIT_HIDE: return "HIDE";
+ case TRANSIT_TO_FRONT: return "SHOW";
+ case TRANSIT_TO_BACK: return "HIDE";
case TRANSIT_CHANGE: return "CHANGE";
default: return "<unknown:" + mode + ">";
}
@@ -200,7 +203,7 @@
private final WindowContainerToken mContainer;
private WindowContainerToken mParent;
private final SurfaceControl mLeash;
- private int mMode = TRANSIT_NONE;
+ private @TransitionMode int mMode = TRANSIT_NONE;
private final Rect mStartAbsBounds = new Rect();
private final Rect mEndAbsBounds = new Rect();
private final Point mEndRelOffset = new Point();
diff --git a/core/java/com/android/ims/OWNERS b/core/java/com/android/ims/OWNERS
new file mode 100644
index 0000000..640baf2
--- /dev/null
+++ b/core/java/com/android/ims/OWNERS
@@ -0,0 +1 @@
+include /telephony/OWNERS
diff --git a/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl b/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl
index fa5c30a..cb280cd 100644
--- a/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl
+++ b/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl
@@ -18,5 +18,5 @@
// Iterface to observe op note/checks of ops
oneway interface IAppOpsNotedCallback {
- void opNoted(int op, int uid, String packageName, int mode);
+ void opNoted(int op, int uid, String packageName, int flags, int mode);
}
diff --git a/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl b/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl
index ed521e6..b0cb2a8 100644
--- a/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl
+++ b/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl
@@ -18,5 +18,5 @@
// Iterface to observe op starts
oneway interface IAppOpsStartedCallback {
- void opStarted(int op, int uid, String packageName, int mode);
+ void opStarted(int op, int uid, String packageName, int flags, int mode);
}
diff --git a/core/java/com/android/internal/app/IntentForwarderActivity.java b/core/java/com/android/internal/app/IntentForwarderActivity.java
index 3e1fa1d..0f37dc5 100644
--- a/core/java/com/android/internal/app/IntentForwarderActivity.java
+++ b/core/java/com/android/internal/app/IntentForwarderActivity.java
@@ -24,7 +24,6 @@
import android.annotation.Nullable;
import android.annotation.StringRes;
import android.app.Activity;
-import android.app.ActivityTaskManager;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.app.admin.DevicePolicyManager;
@@ -199,18 +198,8 @@
/* ignoreTargetSecurity= */ false,
userId);
} catch (RuntimeException e) {
- int launchedFromUid = -1;
- String launchedFromPackage = "?";
- try {
- launchedFromUid = ActivityTaskManager.getService().getLaunchedFromUid(
- getActivityToken());
- launchedFromPackage = ActivityTaskManager.getService()
- .getLaunchedFromPackage(getActivityToken());
- } catch (RemoteException ignored) {
- }
-
- Slog.wtf(TAG, "Unable to launch as UID " + launchedFromUid + " package "
- + launchedFromPackage + ", while running in "
+ Slog.wtf(TAG, "Unable to launch as UID " + getLaunchedFromUid() + " package "
+ + getLaunchedFromPackage() + ", while running in "
+ ActivityThread.currentProcessName(), e);
}
}
diff --git a/core/java/com/android/internal/app/OWNERS b/core/java/com/android/internal/app/OWNERS
new file mode 100644
index 0000000..108ab92
--- /dev/null
+++ b/core/java/com/android/internal/app/OWNERS
@@ -0,0 +1 @@
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index 2dbcbb5..6f9da6f 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -350,13 +350,7 @@
// from managed profile to owner or other way around.
setProfileSwitchMessageId(intent.getContentUserHint());
- try {
- mLaunchedFromUid = ActivityTaskManager.getService().getLaunchedFromUid(
- getActivityToken());
- } catch (RemoteException e) {
- mLaunchedFromUid = -1;
- }
-
+ mLaunchedFromUid = getLaunchedFromUid();
if (mLaunchedFromUid < 0 || UserHandle.isIsolated(mLaunchedFromUid)) {
// Gulp!
finish();
@@ -1085,7 +1079,7 @@
}
}
- protected boolean onTargetSelected(TargetInfo target, boolean alwaysCheck) {
+ protected boolean onTargetSelected(TargetInfo target, boolean always) {
final ResolveInfo ri = target.getResolveInfo();
final Intent intent = target != null ? target.getResolvedIntent() : null;
@@ -1207,7 +1201,7 @@
if (otherProfileMatch > bestMatch) bestMatch = otherProfileMatch;
}
- if (alwaysCheck) {
+ if (always) {
final int userId = getUserId();
final PackageManager pm = getPackageManager();
@@ -1300,15 +1294,8 @@
maybeLogCrossProfileTargetLaunch(cti, currentUserHandle);
}
} catch (RuntimeException e) {
- String launchedFromPackage;
- try {
- launchedFromPackage = ActivityTaskManager.getService().getLaunchedFromPackage(
- getActivityToken());
- } catch (RemoteException e2) {
- launchedFromPackage = "??";
- }
Slog.wtf(TAG, "Unable to launch as uid " + mLaunchedFromUid
- + " package " + launchedFromPackage + ", while running in "
+ + " package " + getLaunchedFromPackage() + ", while running in "
+ ActivityThread.currentProcessName(), e);
}
}
diff --git a/core/java/com/android/internal/config/sysui/OWNERS b/core/java/com/android/internal/config/sysui/OWNERS
new file mode 100644
index 0000000..2e96c97
--- /dev/null
+++ b/core/java/com/android/internal/config/sysui/OWNERS
@@ -0,0 +1 @@
+include /packages/SystemUI/OWNERS
diff --git a/core/java/com/android/internal/inputmethod/CallbackUtils.java b/core/java/com/android/internal/inputmethod/CallbackUtils.java
index ec67792..a315e5a 100644
--- a/core/java/com/android/internal/inputmethod/CallbackUtils.java
+++ b/core/java/com/android/internal/inputmethod/CallbackUtils.java
@@ -45,8 +45,21 @@
@AnyThread
public static void onResult(@NonNull IInputBindResultResultCallback callback,
@NonNull Supplier<InputBindResult> resultSupplier) {
+ InputBindResult result = null;
+ Throwable exception = null;
+
try {
- callback.onResult(resultSupplier.get());
+ result = resultSupplier.get();
+ } catch (Throwable throwable) {
+ exception = throwable;
+ }
+
+ try {
+ if (exception != null) {
+ callback.onError(ThrowableHolder.of(exception));
+ return;
+ }
+ callback.onResult(result);
} catch (RemoteException ignored) { }
}
}
diff --git a/core/java/com/android/internal/inputmethod/Completable.java b/core/java/com/android/internal/inputmethod/Completable.java
index b9e1cf0..bd8c23e 100644
--- a/core/java/com/android/internal/inputmethod/Completable.java
+++ b/core/java/com/android/internal/inputmethod/Completable.java
@@ -16,13 +16,17 @@
package com.android.internal.inputmethod;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
import android.annotation.AnyThread;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.util.Log;
import com.android.internal.annotations.GuardedBy;
+import java.lang.annotation.Retention;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -51,21 +55,100 @@
/**
* Lock {@link Object} to guard complete operations within this class.
*/
- protected final Object mValueLock = new Object();
+ protected final Object mStateLock = new Object();
/**
- * {@code true} after {@link #onComplete()} gets called.
+ * Indicates the completion state of this object.
*/
- @GuardedBy("mValueLock")
- protected boolean mHasValue = false;
+ @GuardedBy("mStateLock")
+ @CompletionState
+ protected int mState = CompletionState.NOT_COMPLETED;
/**
- * @return {@link true} if {@link #onComplete()} gets called already.
+ * {@link Throwable} message passed to {@link #onError(ThrowableHolder)}.
+ *
+ * <p>This is not {@code null} only when {@link #mState} is
+ * {@link CompletionState#COMPLETED_WITH_ERROR}.</p>
+ */
+ @GuardedBy("mStateLock")
+ @Nullable
+ protected String mMessage = null;
+
+ @Retention(SOURCE)
+ @IntDef({
+ CompletionState.NOT_COMPLETED,
+ CompletionState.COMPLETED_WITH_VALUE,
+ CompletionState.COMPLETED_WITH_ERROR})
+ protected @interface CompletionState {
+ /**
+ * This object is not completed yet.
+ */
+ int NOT_COMPLETED = 0;
+ /**
+ * This object is already completed with a value.
+ */
+ int COMPLETED_WITH_VALUE = 1;
+ /**
+ * This object is already completed with an error.
+ */
+ int COMPLETED_WITH_ERROR = 2;
+ }
+
+ /**
+ * Converts the given {@link CompletionState} into a human-readable string.
+ *
+ * @param state {@link CompletionState} to be converted.
+ * @return a human-readable {@link String} for the given {@code state}.
+ */
+ @AnyThread
+ protected static String stateToString(@CompletionState int state) {
+ switch (state) {
+ case CompletionState.NOT_COMPLETED:
+ return "NOT_COMPLETED";
+ case CompletionState.COMPLETED_WITH_VALUE:
+ return "COMPLETED_WITH_VALUE";
+ case CompletionState.COMPLETED_WITH_ERROR:
+ return "COMPLETED_WITH_ERROR";
+ default:
+ return "Unknown(value=" + state + ")";
+ }
+ }
+
+ /**
+ * @return {@link true} if {@link #onComplete()} gets called and {@link #mState} is
+ * {@link CompletionState#COMPLETED_WITH_VALUE} .
*/
@AnyThread
public boolean hasValue() {
- synchronized (mValueLock) {
- return mHasValue;
+ synchronized (mStateLock) {
+ return mState == CompletionState.COMPLETED_WITH_VALUE;
+ }
+ }
+
+ /**
+ * Provides the base implementation of {@code getValue()} for derived classes.
+ *
+ * <p>Must be called after acquiring {@link #mStateLock}.</p>
+ *
+ * @throws RuntimeException when {@link #mState} is
+ * {@link CompletionState#COMPLETED_WITH_ERROR}.
+ * @throws UnsupportedOperationException when {@link #mState} is not
+ * {@link CompletionState#COMPLETED_WITH_VALUE} and
+ * {@link CompletionState#COMPLETED_WITH_ERROR}.
+ */
+ @GuardedBy("mStateLock")
+ protected void enforceGetValueLocked() {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ throw new UnsupportedOperationException(
+ "getValue() is allowed only if hasValue() returns true");
+ case CompletionState.COMPLETED_WITH_VALUE:
+ return;
+ case CompletionState.COMPLETED_WITH_ERROR:
+ throw new RuntimeException(mMessage);
+ default:
+ throw new UnsupportedOperationException(
+ "getValue() is not allowed on state=" + stateToString(mState));
}
}
@@ -78,6 +161,27 @@
}
/**
+ * Notify when exception happened.
+ *
+ * @param throwableHolder contains the {@link Throwable} object when exception happened.
+ */
+ @AnyThread
+ protected void onError(ThrowableHolder throwableHolder) {
+ synchronized (mStateLock) {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ mMessage = throwableHolder.getMessage();
+ mState = CompletionState.COMPLETED_WITH_ERROR;
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "onError() is not allowed on state=" + stateToString(mState));
+ }
+ }
+ onComplete();
+ }
+
+ /**
* Blocks the calling thread until at least one of the following conditions is met.
*
* <p>
@@ -140,7 +244,7 @@
* Completable object of integer primitive.
*/
public static final class Int extends ValueBase {
- @GuardedBy("mValueLock")
+ @GuardedBy("mStateLock")
private int mValue = 0;
/**
@@ -150,29 +254,30 @@
*/
@AnyThread
void onComplete(int value) {
- synchronized (mValueLock) {
- if (mHasValue) {
- throw new UnsupportedOperationException(
- "onComplete() cannot be called multiple times");
+ synchronized (mStateLock) {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ mValue = value;
+ mState = CompletionState.COMPLETED_WITH_VALUE;
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "onComplete() is not allowed on state=" + stateToString(mState));
}
- mValue = value;
- mHasValue = true;
}
onComplete();
}
/**
* @return value associated with this object.
+ * @throws RuntimeException when called while {@link #onError} happened.
* @throws UnsupportedOperationException when called while {@link #hasValue()} returns
* {@code false}.
*/
@AnyThread
public int getValue() {
- synchronized (mValueLock) {
- if (!mHasValue) {
- throw new UnsupportedOperationException(
- "getValue() is allowed only if hasValue() returns true");
- }
+ synchronized (mStateLock) {
+ enforceGetValueLocked();
return mValue;
}
}
@@ -184,7 +289,7 @@
* @param <T> type associated with this completable object.
*/
public static class Values<T> extends ValueBase {
- @GuardedBy("mValueLock")
+ @GuardedBy("mStateLock")
@Nullable
private T mValue = null;
@@ -195,30 +300,31 @@
*/
@AnyThread
void onComplete(@Nullable T value) {
- synchronized (mValueLock) {
- if (mHasValue) {
- throw new UnsupportedOperationException(
- "onComplete() cannot be called multiple times");
+ synchronized (mStateLock) {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ mValue = value;
+ mState = CompletionState.COMPLETED_WITH_VALUE;
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "onComplete() is not allowed on state=" + stateToString(mState));
}
- mValue = value;
- mHasValue = true;
}
onComplete();
}
/**
* @return value associated with this object.
+ * @throws RuntimeException when called while {@link #onError} happened
* @throws UnsupportedOperationException when called while {@link #hasValue()} returns
* {@code false}.
*/
@AnyThread
@Nullable
public T getValue() {
- synchronized (mValueLock) {
- if (!mHasValue) {
- throw new UnsupportedOperationException(
- "getValue() is allowed only if hasValue() returns true");
- }
+ synchronized (mStateLock) {
+ enforceGetValueLocked();
return mValue;
}
}
diff --git a/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl b/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
index b52b3b1..2691984 100644
--- a/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
+++ b/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
@@ -17,7 +17,9 @@
package com.android.internal.inputmethod;
import com.android.internal.view.InputBindResult;
+import com.android.internal.inputmethod.ThrowableHolder;
oneway interface IInputBindResultResultCallback {
void onResult(in InputBindResult result);
+ void onError(in ThrowableHolder exception);
}
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/ResultCallbacks.java b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
index c59dcf4..1929b6f 100644
--- a/core/java/com/android/internal/inputmethod/ResultCallbacks.java
+++ b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
@@ -181,6 +181,16 @@
}
value.onComplete(result);
}
+
+ @BinderThread
+ @Override
+ public void onError(ThrowableHolder throwableHolder) {
+ final Completable.InputBindResult value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onError(throwableHolder);
+ }
};
}
}
diff --git a/core/java/com/android/internal/inputmethod/ThrowableHolder.aidl b/core/java/com/android/internal/inputmethod/ThrowableHolder.aidl
new file mode 100644
index 0000000..ed11293
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/ThrowableHolder.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2008 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.internal.inputmethod;
+
+parcelable ThrowableHolder;
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/ThrowableHolder.java b/core/java/com/android/internal/inputmethod/ThrowableHolder.java
new file mode 100644
index 0000000..b6f4498
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/ThrowableHolder.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2020 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.internal.inputmethod;
+
+import android.annotation.AnyThread;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * A {@link Parcelable} helper class to encapsulate the exception information.
+ */
+public final class ThrowableHolder implements Parcelable {
+
+ @Nullable
+ private final String mMessage;
+
+ ThrowableHolder(@NonNull Throwable throwable) {
+ mMessage = throwable.getMessage();
+ }
+
+ ThrowableHolder(Parcel source) {
+ mMessage = source.readString();
+ }
+
+ /**
+ * Returns a {@link ThrowableHolder} with given {@link Throwable}.
+ */
+ @NonNull
+ @AnyThread
+ public static ThrowableHolder of(@NonNull Throwable throwable) {
+ return new ThrowableHolder(throwable);
+ }
+
+ /**
+ * Gets the message in this {@link ThrowableHolder}.
+ */
+ @Nullable
+ @AnyThread
+ String getMessage() {
+ return mMessage;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ /**
+ * Used to package this object into a {@link Parcel}.
+ *
+ * @param dest The {@link Parcel} to be written.
+ * @param flags The flags used for parceling.
+ */
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(mMessage);
+ }
+
+ /**
+ * Used to make this class parcelable.
+ */
+ public static final Parcelable.Creator<ThrowableHolder> CREATOR =
+ new Parcelable.Creator<ThrowableHolder>() {
+
+ @Override
+ public ThrowableHolder createFromParcel(Parcel source) {
+ return new ThrowableHolder(source);
+ }
+
+ @Override
+ public ThrowableHolder[] newArray(int size) {
+ return new ThrowableHolder[size];
+ }
+ };
+}
diff --git a/core/java/com/android/internal/jank/OWNERS b/core/java/com/android/internal/jank/OWNERS
new file mode 100644
index 0000000..352c132
--- /dev/null
+++ b/core/java/com/android/internal/jank/OWNERS
@@ -0,0 +1,6 @@
+include /services/core/java/com/android/server/wm/OWNERS
+
+# Jank people
+ahanwu@google.com
+vadimt@google.com
+marcinoc@google.com
\ No newline at end of file
diff --git a/core/java/com/android/internal/notification/OWNERS b/core/java/com/android/internal/notification/OWNERS
new file mode 100644
index 0000000..396fd12
--- /dev/null
+++ b/core/java/com/android/internal/notification/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/notification/OWNERS
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index fb6eb97..4476e7e 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -106,7 +106,6 @@
import com.android.internal.power.MeasuredEnergyStats;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FastPrintWriter;
-import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.util.XmlUtils;
@@ -122,7 +121,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
-import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@@ -1080,16 +1078,6 @@
private long[] mCpuFreqs;
/**
- * Times spent by the system server process grouped by cluster and CPU speed.
- */
- private LongSamplingCounterArray mSystemServerCpuTimesUs;
-
- /**
- * Times spent by the system server threads grouped by cluster and CPU speed.
- */
- private LongSamplingCounterArray mSystemServerThreadCpuTimesUs;
-
- /**
* Times spent by the system server threads handling incoming binder requests.
*/
private LongSamplingCounterArray mBinderThreadCpuTimesUs;
@@ -10756,6 +10744,14 @@
}
}
+ /**
+ * Starts tracking CPU time-in-state for threads of the system server process,
+ * keeping a separate account of threads receiving incoming binder calls.
+ */
+ public void startTrackingSystemServerCpuTime() {
+ mSystemServerCpuThreadReader.startTrackingThreadCpuTime();
+ }
+
public void setCallback(BatteryCallback cb) {
mCallback = cb;
}
@@ -11411,8 +11407,6 @@
mExternalSync.scheduleSync("reset", ExternalStatsSync.UPDATE_ENERGY);
}
- resetIfNotNull(mSystemServerCpuTimesUs, false, elapsedRealtimeUs);
- resetIfNotNull(mSystemServerThreadCpuTimesUs, false, elapsedRealtimeUs);
resetIfNotNull(mBinderThreadCpuTimesUs, false, elapsedRealtimeUs);
mLastHistoryStepDetails = null;
@@ -12511,27 +12505,17 @@
return;
}
- if (mSystemServerCpuTimesUs == null) {
- mSystemServerCpuTimesUs = new LongSamplingCounterArray(mOnBatteryTimeBase);
- mSystemServerThreadCpuTimesUs = new LongSamplingCounterArray(mOnBatteryTimeBase);
+ if (mBinderThreadCpuTimesUs == null) {
mBinderThreadCpuTimesUs = new LongSamplingCounterArray(mOnBatteryTimeBase);
}
- mSystemServerCpuTimesUs.addCountLocked(systemServiceCpuThreadTimes.processCpuTimesUs);
- mSystemServerThreadCpuTimesUs.addCountLocked(systemServiceCpuThreadTimes.threadCpuTimesUs);
mBinderThreadCpuTimesUs.addCountLocked(systemServiceCpuThreadTimes.binderThreadCpuTimesUs);
if (DEBUG_BINDER_STATS) {
- Slog.d(TAG, "System server threads per CPU cluster (binder threads/total threads/%)");
- long totalCpuTimeMs = 0;
- long totalThreadTimeMs = 0;
+ Slog.d(TAG, "System server threads per CPU cluster (incoming binder threads)");
long binderThreadTimeMs = 0;
int cpuIndex = 0;
- final long[] systemServerCpuTimesUs =
- mSystemServerCpuTimesUs.getCountsLocked(0);
- final long[] systemServerThreadCpuTimesUs =
- mSystemServerThreadCpuTimesUs.getCountsLocked(0);
- final long[] binderThreadCpuTimesUs =
- mBinderThreadCpuTimesUs.getCountsLocked(0);
+ final long[] binderThreadCpuTimesUs = mBinderThreadCpuTimesUs.getCountsLocked(
+ BatteryStats.STATS_SINCE_CHARGED);
int index = 0;
int numCpuClusters = mPowerProfile.getNumCpuClusters();
for (int cluster = 0; cluster < numCpuClusters; cluster++) {
@@ -12542,28 +12526,15 @@
if (speed != 0) {
sb.append(", ");
}
- long totalCountMs = systemServerThreadCpuTimesUs[index] / 1000;
long binderCountMs = binderThreadCpuTimesUs[index] / 1000;
- sb.append(String.format("%d/%d(%.1f%%)",
- binderCountMs,
- totalCountMs,
- totalCountMs != 0 ? (double) binderCountMs * 100 / totalCountMs : 0));
+ sb.append(TextUtils.formatSimple("%10d", binderCountMs));
- totalCpuTimeMs += systemServerCpuTimesUs[index] / 1000;
- totalThreadTimeMs += totalCountMs;
binderThreadTimeMs += binderCountMs;
index++;
}
cpuIndex += mPowerProfile.getNumCoresInCpuCluster(cluster);
Slog.d(TAG, sb.toString());
}
-
- Slog.d(TAG, "Total system server CPU time (ms): " + totalCpuTimeMs);
- Slog.d(TAG, "Total system server thread time (ms): " + totalThreadTimeMs);
- Slog.d(TAG, String.format("Total Binder thread time (ms): %d (%.1f%%)",
- binderThreadTimeMs,
- binderThreadTimeMs != 0
- ? (double) binderThreadTimeMs * 100 / totalThreadTimeMs : 0));
}
}
@@ -13853,60 +13824,16 @@
}
+ /**
+ * Estimates the time spent by the system server handling incoming binder requests.
+ */
@Override
public long[] getSystemServiceTimeAtCpuSpeeds() {
- // Estimates the time spent by the system server handling incoming binder requests.
- //
- // The data that we can get from the kernel is this:
- // - CPU duration for a (thread - cluster - CPU speed) combination
- // - CPU duration for a (UID - cluster - CPU speed) combination
- //
- // The configuration we have in the Power Profile is this:
- // - Average CPU power for a (cluster - CPU speed) combination.
- //
- // The model used by BatteryStats can be illustrated with this example:
- //
- // - Let's say the system server has 10 threads.
- // - These 10 threads spent 1000 ms of CPU time in aggregate
- // - Of the 10 threads 4 were execute exclusively incoming binder calls.
- // - These 4 "binder" threads consumed 600 ms of CPU time in aggregate
- // - The real time spent by the system server process doing all of this is, say, 200 ms.
- //
- // We will assume that power consumption is proportional to the time spent by the CPU
- // across all threads. This is a crude assumption, but we don't have more detailed data.
- // Thus,
- // binderRealTime = realTime * aggregateBinderThreadTime / aggregateAllThreadTime
- //
- // In our example,
- // binderRealTime = 200 * 600 / 1000 = 120ms
- //
- // We can then multiply this estimated time by the average power to obtain an estimate
- // of the total power consumed by incoming binder calls for the given cluster/speed
- // combination.
-
- if (mSystemServerCpuTimesUs == null) {
+ if (mBinderThreadCpuTimesUs == null) {
return null;
}
- final long[] systemServerCpuTimesUs = mSystemServerCpuTimesUs.getCountsLocked(
- BatteryStats.STATS_SINCE_CHARGED);
- final long [] systemServerThreadCpuTimesUs = mSystemServerThreadCpuTimesUs.getCountsLocked(
- BatteryStats.STATS_SINCE_CHARGED);
- final long[] binderThreadCpuTimesUs = mBinderThreadCpuTimesUs.getCountsLocked(
- BatteryStats.STATS_SINCE_CHARGED);
-
- final int size = systemServerCpuTimesUs.length;
- final long[] results = new long[size];
-
- for (int i = 0; i < size; i++) {
- if (systemServerThreadCpuTimesUs[i] == 0) {
- continue;
- }
-
- results[i] = systemServerCpuTimesUs[i] * binderThreadCpuTimesUs[i]
- / systemServerThreadCpuTimesUs[i];
- }
- return results;
+ return mBinderThreadCpuTimesUs.getCountsLocked(BatteryStats.STATS_SINCE_CHARGED);
}
/**
@@ -13935,10 +13862,6 @@
return u;
}
- public void onCleanupUserLocked(int userId) {
- onCleanupUserLocked(userId, mClocks.elapsedRealtime());
- }
-
public void onCleanupUserLocked(int userId, long elapsedRealtimeMs) {
final int firstUidForUser = UserHandle.getUid(userId, 0);
final int lastUidForUser = UserHandle.getUid(userId, UserHandle.PER_USER_RANGE - 1);
@@ -14306,7 +14229,7 @@
}
updateSystemServiceCallStats();
- if (mSystemServerThreadCpuTimesUs != null) {
+ if (mBinderThreadCpuTimesUs != null) {
pw.println("Per UID System server binder time in ms:");
long[] systemServiceTimeAtCpuSpeeds = getSystemServiceTimeAtCpuSpeeds();
for (int i = 0; i < size; i++) {
@@ -15872,9 +15795,6 @@
mUidStats.append(uid, u);
}
- mSystemServerCpuTimesUs = LongSamplingCounterArray.readFromParcel(in, mOnBatteryTimeBase);
- mSystemServerThreadCpuTimesUs = LongSamplingCounterArray.readFromParcel(in,
- mOnBatteryTimeBase);
mBinderThreadCpuTimesUs = LongSamplingCounterArray.readFromParcel(in, mOnBatteryTimeBase);
}
@@ -16083,8 +16003,6 @@
} else {
out.writeInt(0);
}
- LongSamplingCounterArray.writeToParcel(out, mSystemServerCpuTimesUs);
- LongSamplingCounterArray.writeToParcel(out, mSystemServerThreadCpuTimesUs);
LongSamplingCounterArray.writeToParcel(out, mBinderThreadCpuTimesUs);
}
diff --git a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
index 62e9f98..e1d0a15 100644
--- a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
+++ b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
@@ -17,13 +17,18 @@
package com.android.internal.os;
import android.content.Context;
-import android.os.BatteryConsumer;
+import android.hardware.SensorManager;
+import android.net.ConnectivityManager;
import android.os.BatteryStats;
import android.os.BatteryUsageStats;
import android.os.Bundle;
+import android.os.SystemClock;
import android.os.UidBatteryConsumer;
+import android.os.UserHandle;
import android.os.UserManager;
+import android.util.SparseArray;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -33,10 +38,53 @@
public class BatteryUsageStatsProvider {
private final Context mContext;
private final BatteryStatsImpl mStats;
+ private final PowerProfile mPowerProfile;
+ private final Object mLock = new Object();
+ private List<PowerCalculator> mPowerCalculators;
public BatteryUsageStatsProvider(Context context, BatteryStatsImpl stats) {
mContext = context;
mStats = stats;
+ mPowerProfile = new PowerProfile(mContext);
+ }
+
+ private List<PowerCalculator> getPowerCalculators() {
+ synchronized (mLock) {
+ if (mPowerCalculators == null) {
+ mPowerCalculators = new ArrayList<>();
+
+ // Power calculators are applied in the order of registration
+ mPowerCalculators.add(new CpuPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new MemoryPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new WakelockPowerCalculator(mPowerProfile));
+ if (!isWifiOnlyDevice(mContext)) {
+ mPowerCalculators.add(new MobileRadioPowerCalculator(mPowerProfile));
+ }
+ mPowerCalculators.add(new WifiPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new BluetoothPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new SensorPowerCalculator(mPowerProfile,
+ mContext.getSystemService(SensorManager.class)));
+ mPowerCalculators.add(new CameraPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new FlashlightPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new MediaPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new PhonePowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new ScreenPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new AmbientDisplayPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new SystemServicePowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new IdlePowerCalculator(mPowerProfile));
+
+ mPowerCalculators.add(new UserPowerCalculator());
+ }
+ }
+ return mPowerCalculators;
+ }
+
+ private static boolean isWifiOnlyDevice(Context context) {
+ ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
+ if (cm == null) {
+ return false;
+ }
+ return !cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
}
/**
@@ -49,11 +97,19 @@
false /* collectBatteryBroadcast */);
batteryStatsHelper.create((Bundle) null);
final UserManager userManager = mContext.getSystemService(UserManager.class);
- batteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
- userManager.getUserProfiles());
+ final List<UserHandle> asUsers = userManager.getUserProfiles();
+ final int n = asUsers.size();
+ SparseArray<UserHandle> users = new SparseArray<>(n);
+ for (int i = 0; i < n; ++i) {
+ UserHandle userHandle = asUsers.get(i);
+ users.put(userHandle.getIdentifier(), userHandle);
+ }
+
+ batteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, users);
// TODO(b/174186358): read extra power component number from configuration
final int customPowerComponentCount = 0;
+ final int customTimeComponentCount = 0;
final BatteryUsageStats.Builder batteryUsageStatsBuilder = new BatteryUsageStats.Builder()
.setDischargePercentage(batteryStatsHelper.getStats().getDischargeAmount(0))
.setConsumedPower(batteryStatsHelper.getTotalPower());
@@ -62,15 +118,23 @@
for (int i = 0; i < usageList.size(); i++) {
final BatterySipper sipper = usageList.get(i);
if (sipper.drainType == BatterySipper.DrainType.APP) {
- batteryUsageStatsBuilder.addUidBatteryConsumer(
- new UidBatteryConsumer.Builder(customPowerComponentCount, sipper.getUid())
+ batteryUsageStatsBuilder.addUidBatteryConsumerBuilder(
+ new UidBatteryConsumer.Builder(customPowerComponentCount,
+ customTimeComponentCount, sipper.uidObj)
.setPackageWithHighestDrain(sipper.packageWithHighestDrain)
- .setConsumedPower(sipper.sumPower())
- .setConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU,
- sipper.cpuPowerMah)
- .build());
+ .setConsumedPower(sipper.sumPower()));
}
}
+
+ final long realtimeUs = SystemClock.elapsedRealtime() * 1000;
+ final long uptimeUs = SystemClock.uptimeMillis() * 1000;
+
+ final List<PowerCalculator> powerCalculators = getPowerCalculators();
+ for (PowerCalculator powerCalculator : powerCalculators) {
+ powerCalculator.calculate(batteryUsageStatsBuilder, mStats, realtimeUs, uptimeUs,
+ BatteryStats.STATS_SINCE_CHARGED, users);
+ }
+
return batteryUsageStatsBuilder.build();
}
}
diff --git a/core/java/com/android/internal/os/CpuPowerCalculator.java b/core/java/com/android/internal/os/CpuPowerCalculator.java
index dac62a6..732d291 100644
--- a/core/java/com/android/internal/os/CpuPowerCalculator.java
+++ b/core/java/com/android/internal/os/CpuPowerCalculator.java
@@ -16,6 +16,7 @@
package com.android.internal.os;
import android.os.BatteryStats;
+import android.os.UidBatteryConsumer;
import android.util.ArrayMap;
import android.util.Log;
@@ -30,9 +31,9 @@
}
@Override
- protected void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs,
- long rawUptimeUs, int statsType) {
- app.cpuTimeMs = (u.getUserCpuTimeUs(statsType) + u.getSystemCpuTimeUs(statsType)) / 1000;
+ protected void calculateApp(UidBatteryConsumer.Builder app, BatteryStats.Uid u,
+ long rawRealtimeUs, long rawUptimeUs, int statsType) {
+ long cpuTimeMs = (u.getUserCpuTimeUs(statsType) + u.getSystemCpuTimeUs(statsType)) / 1000;
final int numClusters = mProfile.getNumCpuClusters();
double cpuPowerMaUs = 0;
@@ -70,47 +71,52 @@
+ numClusters + " actual # " + cpuClusterTimes.length);
}
}
- app.cpuPowerMah = cpuPowerMaUs / MICROSEC_IN_HR;
+ final double cpuPowerMah = cpuPowerMaUs / MICROSEC_IN_HR;
- if (DEBUG && (app.cpuTimeMs != 0 || app.cpuPowerMah != 0)) {
- Log.d(TAG, "UID " + u.getUid() + ": CPU time=" + app.cpuTimeMs + " ms power="
- + formatCharge(app.cpuPowerMah));
+ if (DEBUG && (cpuTimeMs != 0 || cpuPowerMah != 0)) {
+ Log.d(TAG, "UID " + u.getUid() + ": CPU time=" + cpuTimeMs + " ms power="
+ + formatCharge(cpuPowerMah));
}
// Keep track of the package with highest drain.
double highestDrain = 0;
-
- app.cpuFgTimeMs = 0;
+ String packageWithHighestDrain = null;
+ long cpuFgTimeMs = 0;
final ArrayMap<String, ? extends BatteryStats.Uid.Proc> processStats = u.getProcessStats();
final int processStatsCount = processStats.size();
for (int i = 0; i < processStatsCount; i++) {
final BatteryStats.Uid.Proc ps = processStats.valueAt(i);
final String processName = processStats.keyAt(i);
- app.cpuFgTimeMs += ps.getForegroundTime(statsType);
+ cpuFgTimeMs += ps.getForegroundTime(statsType);
final long costValue = ps.getUserTime(statsType) + ps.getSystemTime(statsType)
+ ps.getForegroundTime(statsType);
// Each App can have multiple packages and with multiple running processes.
// Keep track of the package who's process has the highest drain.
- if (app.packageWithHighestDrain == null ||
- app.packageWithHighestDrain.startsWith("*")) {
+ if (packageWithHighestDrain == null || packageWithHighestDrain.startsWith("*")) {
highestDrain = costValue;
- app.packageWithHighestDrain = processName;
+ packageWithHighestDrain = processName;
} else if (highestDrain < costValue && !processName.startsWith("*")) {
highestDrain = costValue;
- app.packageWithHighestDrain = processName;
+ packageWithHighestDrain = processName;
}
}
+
// Ensure that the CPU times make sense.
- if (app.cpuFgTimeMs > app.cpuTimeMs) {
- if (DEBUG && app.cpuFgTimeMs > app.cpuTimeMs + 10000) {
+ if (cpuFgTimeMs > cpuTimeMs) {
+ if (DEBUG && cpuFgTimeMs > cpuTimeMs + 10000) {
Log.d(TAG, "WARNING! Cputime is more than 10 seconds behind Foreground time");
}
// Statistics may not have been gathered yet.
- app.cpuTimeMs = app.cpuFgTimeMs;
+ cpuTimeMs = cpuFgTimeMs;
}
+
+ app.setConsumedPower(UidBatteryConsumer.POWER_COMPONENT_CPU, cpuPowerMah);
+ app.setUsageDurationMillis(UidBatteryConsumer.TIME_COMPONENT_CPU, cpuTimeMs);
+ app.setUsageDurationMillis(UidBatteryConsumer.TIME_COMPONENT_CPU_FOREGROUND, cpuFgTimeMs);
+ app.setPackageWithHighestDrain(packageWithHighestDrain);
}
}
diff --git a/core/java/com/android/internal/os/KernelSingleProcessCpuThreadReader.java b/core/java/com/android/internal/os/KernelSingleProcessCpuThreadReader.java
index e6a9623..4d2a08a 100644
--- a/core/java/com/android/internal/os/KernelSingleProcessCpuThreadReader.java
+++ b/core/java/com/android/internal/os/KernelSingleProcessCpuThreadReader.java
@@ -16,23 +16,12 @@
package com.android.internal.os;
-import static android.os.Process.PROC_OUT_LONG;
-import static android.os.Process.PROC_SPACE_TERM;
-
import android.annotation.Nullable;
-import android.os.Process;
-import android.system.Os;
-import android.system.OsConstants;
import android.util.Slog;
import com.android.internal.annotations.VisibleForTesting;
import java.io.IOException;
-import java.nio.file.DirectoryIteratorException;
-import java.nio.file.DirectoryStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
import java.util.Arrays;
/**
@@ -45,93 +34,65 @@
private static final String TAG = "KernelSingleProcCpuThreadRdr";
private static final boolean DEBUG = false;
- private static final boolean NATIVE_ENABLED = true;
-
- /**
- * The name of the file to read CPU statistics from, must be found in {@code
- * /proc/$PID/task/$TID}
- */
- private static final String CPU_STATISTICS_FILENAME = "time_in_state";
-
- private static final String PROC_STAT_FILENAME = "stat";
-
- /** Directory under /proc/$PID containing CPU stats files for threads */
- public static final String THREAD_CPU_STATS_DIRECTORY = "task";
-
- /** Default mount location of the {@code proc} filesystem */
- private static final Path DEFAULT_PROC_PATH = Paths.get("/proc");
-
- /** The initial {@code time_in_state} file for {@link ProcTimeInStateReader} */
- private static final Path INITIAL_TIME_IN_STATE_PATH = Paths.get("self/time_in_state");
-
- /** See https://man7.org/linux/man-pages/man5/proc.5.html */
- private static final int[] PROCESS_FULL_STATS_FORMAT = new int[] {
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM,
- PROC_SPACE_TERM | PROC_OUT_LONG, // 14: utime
- PROC_SPACE_TERM | PROC_OUT_LONG, // 15: stime
- // Ignore remaining fields
- };
-
- private final long[] mProcessFullStatsData = new long[2];
-
- private static final int PROCESS_FULL_STAT_UTIME = 0;
- private static final int PROCESS_FULL_STAT_STIME = 1;
-
- /** Used to read and parse {@code time_in_state} files */
- private final ProcTimeInStateReader mProcTimeInStateReader;
private final int mPid;
- /** Where the proc filesystem is mounted */
- private final Path mProcPath;
+ private final CpuTimeInStateReader mCpuTimeInStateReader;
- // How long a CPU jiffy is in milliseconds.
- private final long mJiffyMillis;
-
- // Path: /proc/<pid>/stat
- private final String mProcessStatFilePath;
-
- // Path: /proc/<pid>/task
- private final Path mThreadsDirectoryPath;
+ private int[] mSelectedThreadNativeTids = new int[0]; // Sorted
/**
- * Count of frequencies read from the {@code time_in_state} file. Read from {@link
- * #mProcTimeInStateReader#getCpuFrequenciesKhz()}.
+ * Count of frequencies read from the {@code time_in_state} file.
*/
private int mFrequencyCount;
+ private boolean mIsTracking;
+
+ /**
+ * A CPU time-in-state provider for testing. Imitates the behavior of the corresponding
+ * methods in frameworks/native/libs/cputimeinstate/cputimeinstate.c
+ */
+ @VisibleForTesting
+ public interface CpuTimeInStateReader {
+ /**
+ * Returns the overall number of cluster-frequency combinations.
+ */
+ int getCpuFrequencyCount();
+
+ /**
+ * Returns true to indicate success.
+ *
+ * Called from native.
+ */
+ boolean startTrackingProcessCpuTimes(int tgid);
+
+ /**
+ * Returns true to indicate success.
+ *
+ * Called from native.
+ */
+ boolean startAggregatingTaskCpuTimes(int pid, int aggregationKey);
+
+ /**
+ * Must return an array of strings formatted like this:
+ * "aggKey:t0_0 t0_1...:t1_0 t1_1..."
+ * Times should be provided in nanoseconds.
+ *
+ * Called from native.
+ */
+ String[] getAggregatedTaskCpuFreqTimes(int pid);
+ }
+
/**
* Create with a path where `proc` is mounted. Used primarily for testing
*
* @param pid PID of the process whose threads are to be read.
- * @param procPath where `proc` is mounted (to find, see {@code mount | grep ^proc})
*/
@VisibleForTesting
- public KernelSingleProcessCpuThreadReader(
- int pid,
- Path procPath) throws IOException {
+ public KernelSingleProcessCpuThreadReader(int pid,
+ @Nullable CpuTimeInStateReader cpuTimeInStateReader) throws IOException {
mPid = pid;
- mProcPath = procPath;
- mProcTimeInStateReader = new ProcTimeInStateReader(
- mProcPath.resolve(INITIAL_TIME_IN_STATE_PATH));
- long jiffyHz = Os.sysconf(OsConstants._SC_CLK_TCK);
- mJiffyMillis = 1000 / jiffyHz;
- mProcessStatFilePath =
- mProcPath.resolve(String.valueOf(mPid)).resolve(PROC_STAT_FILENAME).toString();
- mThreadsDirectoryPath =
- mProcPath.resolve(String.valueOf(mPid)).resolve(THREAD_CPU_STATS_DIRECTORY);
+ mCpuTimeInStateReader = cpuTimeInStateReader;
}
/**
@@ -142,7 +103,7 @@
@Nullable
public static KernelSingleProcessCpuThreadReader create(int pid) {
try {
- return new KernelSingleProcessCpuThreadReader(pid, DEFAULT_PROC_PATH);
+ return new KernelSingleProcessCpuThreadReader(pid, null);
} catch (IOException e) {
Slog.e(TAG, "Failed to initialize KernelSingleProcessCpuThreadReader", e);
return null;
@@ -150,146 +111,98 @@
}
/**
- * Get the CPU frequencies that correspond to the times reported in {@link
- * ProcessCpuUsage#processCpuTimesMillis} etc.
+ * Starts tracking aggregated CPU time-in-state of all threads of the process with the PID
+ * supplied in the constructor.
+ */
+ public void startTrackingThreadCpuTimes() {
+ if (!mIsTracking) {
+ if (!startTrackingProcessCpuTimes(mPid, mCpuTimeInStateReader)) {
+ Slog.e(TAG, "Failed to start tracking process CPU times for " + mPid);
+ }
+ if (mSelectedThreadNativeTids.length > 0) {
+ if (!startAggregatingThreadCpuTimes(mSelectedThreadNativeTids,
+ mCpuTimeInStateReader)) {
+ Slog.e(TAG, "Failed to start tracking aggregated thread CPU times for "
+ + Arrays.toString(mSelectedThreadNativeTids));
+ }
+ }
+ mIsTracking = true;
+ }
+ }
+
+ /**
+ * @param nativeTids an array of native Thread IDs whose CPU times should
+ * be aggregated as a group. This is expected to be a subset
+ * of all thread IDs owned by the process.
+ */
+ public void setSelectedThreadIds(int[] nativeTids) {
+ mSelectedThreadNativeTids = nativeTids.clone();
+ if (mIsTracking) {
+ startAggregatingThreadCpuTimes(mSelectedThreadNativeTids, mCpuTimeInStateReader);
+ }
+ }
+
+ /**
+ * Get the CPU frequencies that correspond to the times reported in {@link ProcessCpuUsage}.
*/
public int getCpuFrequencyCount() {
if (mFrequencyCount == 0) {
- mFrequencyCount = mProcTimeInStateReader.getFrequenciesKhz().length;
+ mFrequencyCount = getCpuFrequencyCount(mCpuTimeInStateReader);
}
return mFrequencyCount;
}
/**
- * Get the total and per-thread CPU usage of the process with the PID specified in the
- * constructor.
- *
- * @param selectedThreadIds a SORTED array of native Thread IDs whose CPU times should
- * be aggregated as a group. This is expected to be a subset
- * of all thread IDs owned by the process.
+ * Get the total CPU usage of the process with the PID specified in the
+ * constructor. The CPU usage time is aggregated across all threads and may
+ * exceed the time the entire process has been running.
*/
@Nullable
- public ProcessCpuUsage getProcessCpuUsage(int[] selectedThreadIds) {
+ public ProcessCpuUsage getProcessCpuUsage() {
if (DEBUG) {
- Slog.d(TAG, "Reading CPU thread usages with directory " + mProcPath + " process ID "
- + mPid);
+ Slog.d(TAG, "Reading CPU thread usages for PID " + mPid);
}
- int cpuFrequencyCount = getCpuFrequencyCount();
- ProcessCpuUsage processCpuUsage = new ProcessCpuUsage(cpuFrequencyCount);
+ ProcessCpuUsage processCpuUsage = new ProcessCpuUsage(getCpuFrequencyCount());
- if (NATIVE_ENABLED) {
- boolean result = readProcessCpuUsage(mProcPath.toString(), mPid,
- selectedThreadIds, processCpuUsage.processCpuTimesMillis,
- processCpuUsage.threadCpuTimesMillis,
- processCpuUsage.selectedThreadCpuTimesMillis);
- if (!result) {
- return null;
- }
- return processCpuUsage;
- }
-
- if (!isSorted(selectedThreadIds)) {
- throw new IllegalArgumentException("selectedThreadIds is not sorted: "
- + Arrays.toString(selectedThreadIds));
- }
-
- if (!Process.readProcFile(mProcessStatFilePath, PROCESS_FULL_STATS_FORMAT, null,
- mProcessFullStatsData, null)) {
- Slog.e(TAG, "Failed to read process stat file " + mProcessStatFilePath);
+ boolean result = readProcessCpuUsage(mPid,
+ processCpuUsage.threadCpuTimesMillis,
+ processCpuUsage.selectedThreadCpuTimesMillis,
+ mCpuTimeInStateReader);
+ if (!result) {
return null;
}
- long utime = mProcessFullStatsData[PROCESS_FULL_STAT_UTIME];
- long stime = mProcessFullStatsData[PROCESS_FULL_STAT_STIME];
-
- long processCpuTimeMillis = (utime + stime) * mJiffyMillis;
-
- try (DirectoryStream<Path> threadPaths = Files.newDirectoryStream(mThreadsDirectoryPath)) {
- for (Path threadDirectory : threadPaths) {
- readThreadCpuUsage(processCpuUsage, selectedThreadIds, threadDirectory);
- }
- } catch (IOException | DirectoryIteratorException e) {
- // Expected when a process finishes
- return null;
- }
-
- // Estimate per cluster per frequency CPU time for the entire process
- // by distributing the total process CPU time proportionately to how much
- // CPU time its threads took on those clusters/frequencies. This algorithm
- // works more accurately when when we have equally distributed concurrency.
- // TODO(b/169279846): obtain actual process CPU times from the kernel
- long totalCpuTimeAllThreads = 0;
- for (int i = cpuFrequencyCount - 1; i >= 0; i--) {
- totalCpuTimeAllThreads += processCpuUsage.threadCpuTimesMillis[i];
- }
-
- for (int i = cpuFrequencyCount - 1; i >= 0; i--) {
- processCpuUsage.processCpuTimesMillis[i] =
- processCpuTimeMillis * processCpuUsage.threadCpuTimesMillis[i]
- / totalCpuTimeAllThreads;
+ if (DEBUG) {
+ Slog.d(TAG, "threadCpuTimesMillis = "
+ + Arrays.toString(processCpuUsage.threadCpuTimesMillis));
+ Slog.d(TAG, "selectedThreadCpuTimesMillis = "
+ + Arrays.toString(processCpuUsage.selectedThreadCpuTimesMillis));
}
return processCpuUsage;
}
- /**
- * Reads a thread's CPU usage and aggregates the per-cluster per-frequency CPU times.
- *
- * @param threadDirectory the {@code /proc} directory of the thread
- */
- private void readThreadCpuUsage(ProcessCpuUsage processCpuUsage, int[] selectedThreadIds,
- Path threadDirectory) {
- // Get the thread ID from the directory name
- final int threadId;
- try {
- final String directoryName = threadDirectory.getFileName().toString();
- threadId = Integer.parseInt(directoryName);
- } catch (NumberFormatException e) {
- Slog.w(TAG, "Failed to parse thread ID when iterating over /proc/*/task", e);
- return;
- }
-
- // Get the CPU statistics from the directory
- final Path threadCpuStatPath = threadDirectory.resolve(CPU_STATISTICS_FILENAME);
- final long[] cpuUsages = mProcTimeInStateReader.getUsageTimesMillis(threadCpuStatPath);
- if (cpuUsages == null) {
- return;
- }
-
- final int cpuFrequencyCount = getCpuFrequencyCount();
- final boolean isSelectedThread = Arrays.binarySearch(selectedThreadIds, threadId) >= 0;
- for (int i = cpuFrequencyCount - 1; i >= 0; i--) {
- processCpuUsage.threadCpuTimesMillis[i] += cpuUsages[i];
- if (isSelectedThread) {
- processCpuUsage.selectedThreadCpuTimesMillis[i] += cpuUsages[i];
- }
- }
- }
-
/** CPU usage of a process, all of its threads and a selected subset of its threads */
public static class ProcessCpuUsage {
- public long[] processCpuTimesMillis;
public long[] threadCpuTimesMillis;
public long[] selectedThreadCpuTimesMillis;
public ProcessCpuUsage(int cpuFrequencyCount) {
- processCpuTimesMillis = new long[cpuFrequencyCount];
threadCpuTimesMillis = new long[cpuFrequencyCount];
selectedThreadCpuTimesMillis = new long[cpuFrequencyCount];
}
}
- private static boolean isSorted(int[] array) {
- for (int i = 0; i < array.length - 1; i++) {
- if (array[i] > array[i + 1]) {
- return false;
- }
- }
- return true;
- }
+ private native int getCpuFrequencyCount(CpuTimeInStateReader reader);
- private native boolean readProcessCpuUsage(String procPath, int pid, int[] selectedThreadIds,
- long[] processCpuTimesMillis, long[] threadCpuTimesMillis,
- long[] selectedThreadCpuTimesMillis);
+ private native boolean startTrackingProcessCpuTimes(int pid, CpuTimeInStateReader reader);
+
+ private native boolean startAggregatingThreadCpuTimes(int[] selectedThreadIds,
+ CpuTimeInStateReader reader);
+
+ private native boolean readProcessCpuUsage(int pid,
+ long[] threadCpuTimesMillis,
+ long[] selectedThreadCpuTimesMillis,
+ CpuTimeInStateReader reader);
}
diff --git a/core/java/com/android/internal/os/OWNERS b/core/java/com/android/internal/os/OWNERS
index afc9432..8f78b2a 100644
--- a/core/java/com/android/internal/os/OWNERS
+++ b/core/java/com/android/internal/os/OWNERS
@@ -1 +1,8 @@
-per-file ZygoteArguments.java,ZygoteConnection.java,ZygoteInit.java,Zygote.java,ZygoteServer.java = calin@google.com, chriswailes@google.com, maco@google.com, narayan@google.com, ngeoffray@google.com
+per-file *Power* = file:/services/core/java/com/android/server/power/OWNERS
+per-file *Zygote* = file:/ZYGOTE_OWNERS
+
+# BatteryStats
+per-file BatterySipper.java = file:/BATTERY_STATS_OWNERS
+per-file BatteryStats* = file:/BATTERY_STATS_OWNERS
+per-file BatteryUsageStats* = file:/BATTERY_STATS_OWNERS
+per-file *PowerCalculator* = file:/BATTERY_STATS_OWNERS
diff --git a/core/java/com/android/internal/os/PowerCalculator.java b/core/java/com/android/internal/os/PowerCalculator.java
index f171b0d..a57339b 100644
--- a/core/java/com/android/internal/os/PowerCalculator.java
+++ b/core/java/com/android/internal/os/PowerCalculator.java
@@ -16,6 +16,8 @@
package com.android.internal.os;
import android.os.BatteryStats;
+import android.os.BatteryUsageStats;
+import android.os.UidBatteryConsumer;
import android.os.UserHandle;
import android.util.SparseArray;
@@ -55,6 +57,34 @@
}
/**
+ * Attributes the total amount of power used by this subsystem to various consumers such
+ * as apps.
+ *
+ * @param builder {@link BatteryUsageStats.Builder that contains a list of
+ * per-UID battery consumer builders for attribution data.
+ * The calculator may modify the builder and its constituent parts.
+ * @param batteryStats The recorded battery stats.
+ * @param rawRealtimeUs The raw system realtime in microseconds.
+ * @param rawUptimeUs The raw system uptime in microseconds.
+ * @param statsType The type of stats. As of {@link android.os.Build.VERSION_CODES#Q}, this
+ * can only be {@link BatteryStats#STATS_SINCE_CHARGED}, since
+ * {@link BatteryStats#STATS_CURRENT} and
+ * {@link BatteryStats#STATS_SINCE_UNPLUGGED} are deprecated.
+ * @param asUsers An array of users for which the attribution is requested. It may
+ * contain {@link UserHandle#USER_ALL} to indicate that the attribution
+ * should be performed for all users.
+ */
+ public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
+ long rawRealtimeUs, long rawUptimeUs, int statsType, SparseArray<UserHandle> asUsers) {
+ final List<UidBatteryConsumer.Builder> uidBatteryConsumerBuilders =
+ builder.getUidBatteryConsumerBuilders();
+ for (int i = uidBatteryConsumerBuilders.size() - 1; i >= 0; i--) {
+ final UidBatteryConsumer.Builder app = uidBatteryConsumerBuilders.get(i);
+ calculateApp(app, app.getBatteryStatsUid(), rawRealtimeUs, rawUptimeUs, statsType);
+ }
+ }
+
+ /**
* Calculate the amount of power an app used for this subsystem.
* @param app The BatterySipper that represents the power use of an app.
* @param u The recorded stats for the app.
@@ -66,7 +96,36 @@
* {@link BatteryStats#STATS_SINCE_UNPLUGGED} are deprecated.
*/
protected void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs,
- long rawUptimeUs, int statsType) {}
+ long rawUptimeUs, int statsType) {
+
+ // TODO(b/175156498): Temporary code during the transition from BatterySippers to
+ // BatteryConsumers.
+ UidBatteryConsumer.Builder builder = new UidBatteryConsumer.Builder(0, 0, u);
+ calculateApp(builder, u, rawRealtimeUs, rawUptimeUs, statsType);
+ final UidBatteryConsumer uidBatteryConsumer = builder.build();
+ app.cpuPowerMah = uidBatteryConsumer.getConsumedPower(
+ UidBatteryConsumer.POWER_COMPONENT_CPU);
+ app.cpuTimeMs = uidBatteryConsumer.getUsageDurationMillis(
+ UidBatteryConsumer.TIME_COMPONENT_CPU);
+ app.cpuFgTimeMs = uidBatteryConsumer.getUsageDurationMillis(
+ UidBatteryConsumer.TIME_COMPONENT_CPU_FOREGROUND);
+ app.packageWithHighestDrain = uidBatteryConsumer.getPackageWithHighestDrain();
+ }
+
+ /**
+ * Calculate the amount of power an app used for this subsystem.
+ * @param app The UidBatteryConsumer.Builder that represents the power use of an app.
+ * @param u The recorded stats for the app.
+ * @param rawRealtimeUs The raw system realtime in microseconds.
+ * @param rawUptimeUs The raw system uptime in microseconds.
+ * @param statsType The type of stats. As of {@link android.os.Build.VERSION_CODES#Q}, this can
+ * only be {@link BatteryStats#STATS_SINCE_CHARGED}, since
+ * {@link BatteryStats#STATS_CURRENT} and
+ * {@link BatteryStats#STATS_SINCE_UNPLUGGED} are deprecated.
+ */
+ protected void calculateApp(UidBatteryConsumer.Builder app, BatteryStats.Uid u,
+ long rawRealtimeUs, long rawUptimeUs, int statsType) {
+ }
/**
* Reset any state maintained in this calculator.
diff --git a/core/java/com/android/internal/os/SystemServerCpuThreadReader.java b/core/java/com/android/internal/os/SystemServerCpuThreadReader.java
index fbbee94..fbad75e 100644
--- a/core/java/com/android/internal/os/SystemServerCpuThreadReader.java
+++ b/core/java/com/android/internal/os/SystemServerCpuThreadReader.java
@@ -22,8 +22,6 @@
import com.android.internal.annotations.VisibleForTesting;
import java.io.IOException;
-import java.nio.file.Path;
-import java.util.Arrays;
/**
* Reads /proc/UID/task/TID/time_in_state files to obtain statistics on CPU usage
@@ -31,9 +29,7 @@
*/
public class SystemServerCpuThreadReader {
private final KernelSingleProcessCpuThreadReader mKernelCpuThreadReader;
- private int[] mBinderThreadNativeTids = new int[0]; // Sorted
- private long[] mLastProcessCpuTimeUs;
private long[] mLastThreadCpuTimesUs;
private long[] mLastBinderThreadCpuTimesUs;
@@ -41,8 +37,6 @@
* Times (in microseconds) spent by the system server UID.
*/
public static class SystemServiceCpuThreadTimes {
- // The entire process
- public long[] processCpuTimesUs;
// All threads
public long[] threadCpuTimesUs;
// Just the threads handling incoming binder calls
@@ -61,8 +55,10 @@
}
@VisibleForTesting
- public SystemServerCpuThreadReader(Path procPath, int pid) throws IOException {
- this(new KernelSingleProcessCpuThreadReader(pid, procPath));
+ public SystemServerCpuThreadReader(int pid,
+ KernelSingleProcessCpuThreadReader.CpuTimeInStateReader cpuTimeInStateReader)
+ throws IOException {
+ this(new KernelSingleProcessCpuThreadReader(pid, cpuTimeInStateReader));
}
@VisibleForTesting
@@ -70,9 +66,15 @@
mKernelCpuThreadReader = kernelCpuThreadReader;
}
+ /**
+ * Start tracking CPU time-in-state for the process specified in the constructor.
+ */
+ public void startTrackingThreadCpuTime() {
+ mKernelCpuThreadReader.startTrackingThreadCpuTimes();
+ }
+
public void setBinderThreadNativeTids(int[] nativeTids) {
- mBinderThreadNativeTids = nativeTids.clone();
- Arrays.sort(mBinderThreadNativeTids);
+ mKernelCpuThreadReader.setSelectedThreadIds(nativeTids);
}
/**
@@ -81,33 +83,27 @@
@Nullable
public SystemServiceCpuThreadTimes readDelta() {
final int numCpuFrequencies = mKernelCpuThreadReader.getCpuFrequencyCount();
- if (mLastProcessCpuTimeUs == null) {
- mLastProcessCpuTimeUs = new long[numCpuFrequencies];
+ if (mLastThreadCpuTimesUs == null) {
mLastThreadCpuTimesUs = new long[numCpuFrequencies];
mLastBinderThreadCpuTimesUs = new long[numCpuFrequencies];
- mDeltaCpuThreadTimes.processCpuTimesUs = new long[numCpuFrequencies];
mDeltaCpuThreadTimes.threadCpuTimesUs = new long[numCpuFrequencies];
mDeltaCpuThreadTimes.binderThreadCpuTimesUs = new long[numCpuFrequencies];
}
final KernelSingleProcessCpuThreadReader.ProcessCpuUsage processCpuUsage =
- mKernelCpuThreadReader.getProcessCpuUsage(mBinderThreadNativeTids);
+ mKernelCpuThreadReader.getProcessCpuUsage();
if (processCpuUsage == null) {
return null;
}
for (int i = numCpuFrequencies - 1; i >= 0; i--) {
- long processCpuTimesUs = processCpuUsage.processCpuTimesMillis[i] * 1000;
long threadCpuTimesUs = processCpuUsage.threadCpuTimesMillis[i] * 1000;
long binderThreadCpuTimesUs = processCpuUsage.selectedThreadCpuTimesMillis[i] * 1000;
- mDeltaCpuThreadTimes.processCpuTimesUs[i] =
- Math.max(0, processCpuTimesUs - mLastProcessCpuTimeUs[i]);
mDeltaCpuThreadTimes.threadCpuTimesUs[i] =
Math.max(0, threadCpuTimesUs - mLastThreadCpuTimesUs[i]);
mDeltaCpuThreadTimes.binderThreadCpuTimesUs[i] =
Math.max(0, binderThreadCpuTimesUs - mLastBinderThreadCpuTimesUs[i]);
- mLastProcessCpuTimeUs[i] = processCpuTimesUs;
mLastThreadCpuTimesUs[i] = threadCpuTimesUs;
mLastBinderThreadCpuTimesUs[i] = binderThreadCpuTimesUs;
}
diff --git a/core/java/com/android/internal/policy/OWNERS b/core/java/com/android/internal/policy/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/core/java/com/android/internal/policy/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java
index f89e52d..141dc79 100644
--- a/core/java/com/android/internal/policy/PhoneWindow.java
+++ b/core/java/com/android/internal/policy/PhoneWindow.java
@@ -3140,6 +3140,7 @@
// On TVs, if the app doesn't implement search, we want to launch assist.
Bundle args = new Bundle();
args.putInt(Intent.EXTRA_ASSIST_INPUT_DEVICE_ID, event.getDeviceId());
+ args.putLong(Intent.EXTRA_TIME, event.getEventTime());
((SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE))
.launchAssist(args);
return true;
diff --git a/core/java/com/android/internal/statusbar/OWNERS b/core/java/com/android/internal/statusbar/OWNERS
new file mode 100644
index 0000000..2e96c97
--- /dev/null
+++ b/core/java/com/android/internal/statusbar/OWNERS
@@ -0,0 +1 @@
+include /packages/SystemUI/OWNERS
diff --git a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl
index c2cbc04..303365b 100644
--- a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl
+++ b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl
@@ -94,4 +94,5 @@
void notifyBarringInfoChanged(int slotIndex, int subId, in BarringInfo barringInfo);
void notifyPhysicalChannelConfigForSubscriber(in int subId,
in List<PhysicalChannelConfig> configs);
+ void notifyDataEnabled(boolean enabled, int reason);
}
diff --git a/core/java/com/android/internal/telephony/OWNERS b/core/java/com/android/internal/telephony/OWNERS
new file mode 100644
index 0000000..640baf2
--- /dev/null
+++ b/core/java/com/android/internal/telephony/OWNERS
@@ -0,0 +1 @@
+include /telephony/OWNERS
diff --git a/core/java/com/android/internal/util/BinaryXmlPullParser.java b/core/java/com/android/internal/util/BinaryXmlPullParser.java
index ff7743f..68921ad 100644
--- a/core/java/com/android/internal/util/BinaryXmlPullParser.java
+++ b/core/java/com/android/internal/util/BinaryXmlPullParser.java
@@ -414,29 +414,21 @@
mAttributeCount = 0;
}
- /**
- * Search through the pool of currently allocated {@link Attribute}
- * instances for one that matches the given name.
- */
- private @NonNull Attribute findAttribute(@NonNull String name)
- throws XmlPullParserException {
+ @Override
+ public int getAttributeIndex(String namespace, String name) {
+ if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
for (int i = 0; i < mAttributeCount; i++) {
if (Objects.equals(mAttributes[i].name, name)) {
- return mAttributes[i];
+ return i;
}
}
- throw new XmlPullParserException("Missing attribute " + name);
+ return -1;
}
@Override
public String getAttributeValue(String namespace, String name) {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- try {
- return findAttribute(name).getValueString();
- } catch (XmlPullParserException e) {
- // Missing attributes default to null
- return null;
- }
+ final int index = getAttributeIndex(namespace, name);
+ return mAttributes[index].getValueString();
}
@Override
@@ -445,66 +437,48 @@
}
@Override
- public byte[] getAttributeBytesHex(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueBytesHex();
+ public byte[] getAttributeBytesHex(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueBytesHex();
}
@Override
- public byte[] getAttributeBytesBase64(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueBytesBase64();
+ public byte[] getAttributeBytesBase64(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueBytesBase64();
}
@Override
- public int getAttributeInt(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueInt();
+ public int getAttributeInt(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueInt();
}
@Override
- public int getAttributeIntHex(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueIntHex();
+ public int getAttributeIntHex(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueIntHex();
}
@Override
- public long getAttributeLong(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueLong();
+ public long getAttributeLong(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueLong();
}
@Override
- public long getAttributeLongHex(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueLongHex();
+ public long getAttributeLongHex(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueLongHex();
}
@Override
- public float getAttributeFloat(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueFloat();
+ public float getAttributeFloat(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueFloat();
}
@Override
- public double getAttributeDouble(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueDouble();
+ public double getAttributeDouble(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueDouble();
}
@Override
- public boolean getAttributeBoolean(String namespace, String name)
- throws XmlPullParserException {
- if (namespace != null && !namespace.isEmpty()) throw illegalNamespace();
- return findAttribute(name).getValueBoolean();
+ public boolean getAttributeBoolean(int index) throws XmlPullParserException {
+ return mAttributes[index].getValueBoolean();
}
@Override
diff --git a/core/java/com/android/internal/util/LatencyTracker.java b/core/java/com/android/internal/util/LatencyTracker.java
index 8012540..254c299 100644
--- a/core/java/com/android/internal/util/LatencyTracker.java
+++ b/core/java/com/android/internal/util/LatencyTracker.java
@@ -86,6 +86,11 @@
*/
public static final int ACTION_FACE_WAKE_AND_UNLOCK = 7;
+ /**
+ * Time between the swipe-up gesture and window drawn of recents activity.
+ */
+ public static final int ACTION_START_RECENTS_ANIMATION = 8;
+
private static final String[] NAMES = new String[]{
"expand panel",
"toggle recents",
@@ -94,7 +99,9 @@
"check credential unlocked",
"turn on screen",
"rotate the screen",
- "face wake-and-unlock"};
+ "face wake-and-unlock",
+ "start recents-animation",
+ };
private static final int[] STATSD_ACTION = new int[]{
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_EXPAND_PANEL,
@@ -105,6 +112,7 @@
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_TURN_ON_SCREEN,
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN,
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_FACE_WAKE_AND_UNLOCK,
+ FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_START_RECENTS_ANIMATION,
};
private static LatencyTracker sLatencyTracker;
@@ -170,6 +178,8 @@
return "ACTION_ROTATE_SCREEN";
case 8:
return "ACTION_FACE_WAKE_AND_UNLOCK";
+ case 9:
+ return "ACTION_START_RECENTS_ANIMATION";
default:
throw new IllegalArgumentException("Invalid action");
}
diff --git a/core/java/com/android/internal/util/XmlUtils.java b/core/java/com/android/internal/util/XmlUtils.java
index 244efc5..de6b65f3 100644
--- a/core/java/com/android/internal/util/XmlUtils.java
+++ b/core/java/com/android/internal/util/XmlUtils.java
@@ -142,95 +142,104 @@
}
@Override
- public byte[] getAttributeBytesHex(String namespace, String name)
+ public byte[] getAttributeBytesHex(int index)
throws XmlPullParserException {
try {
- return HexDump.hexStringToByteArray(getAttributeValue(namespace, name));
+ return HexDump.hexStringToByteArray(getAttributeValue(index));
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public byte[] getAttributeBytesBase64(String namespace, String name)
+ public byte[] getAttributeBytesBase64(int index)
throws XmlPullParserException {
try {
- return Base64.decode(getAttributeValue(namespace, name), Base64.NO_WRAP);
+ return Base64.decode(getAttributeValue(index), Base64.NO_WRAP);
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public int getAttributeInt(String namespace, String name)
+ public int getAttributeInt(int index)
throws XmlPullParserException {
try {
- return Integer.parseInt(getAttributeValue(namespace, name));
+ return Integer.parseInt(getAttributeValue(index));
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public int getAttributeIntHex(String namespace, String name)
+ public int getAttributeIntHex(int index)
throws XmlPullParserException {
try {
- return Integer.parseInt(getAttributeValue(namespace, name), 16);
+ return Integer.parseInt(getAttributeValue(index), 16);
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public long getAttributeLong(String namespace, String name)
+ public long getAttributeLong(int index)
throws XmlPullParserException {
try {
- return Long.parseLong(getAttributeValue(namespace, name));
+ return Long.parseLong(getAttributeValue(index));
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public long getAttributeLongHex(String namespace, String name)
+ public long getAttributeLongHex(int index)
throws XmlPullParserException {
try {
- return Long.parseLong(getAttributeValue(namespace, name), 16);
+ return Long.parseLong(getAttributeValue(index), 16);
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public float getAttributeFloat(String namespace, String name)
+ public float getAttributeFloat(int index)
throws XmlPullParserException {
try {
- return Float.parseFloat(getAttributeValue(namespace, name));
+ return Float.parseFloat(getAttributeValue(index));
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public double getAttributeDouble(String namespace, String name)
+ public double getAttributeDouble(int index)
throws XmlPullParserException {
try {
- return Double.parseDouble(getAttributeValue(namespace, name));
+ return Double.parseDouble(getAttributeValue(index));
} catch (Exception e) {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + e);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + e);
}
}
@Override
- public boolean getAttributeBoolean(String namespace, String name)
+ public boolean getAttributeBoolean(int index)
throws XmlPullParserException {
- final String value = getAttributeValue(namespace, name);
+ final String value = getAttributeValue(index);
if ("true".equalsIgnoreCase(value)) {
return true;
} else if ("false".equalsIgnoreCase(value)) {
return false;
} else {
- throw new XmlPullParserException("Invalid attribute " + name + ": " + value);
+ throw new XmlPullParserException(
+ "Invalid attribute " + getAttributeName(index) + ": " + value);
}
}
}
diff --git a/core/java/com/android/internal/util/dump/DualDumpOutputStream.java b/core/java/com/android/internal/util/dump/DualDumpOutputStream.java
index 3ac38ed..20419db 100644
--- a/core/java/com/android/internal/util/dump/DualDumpOutputStream.java
+++ b/core/java/com/android/internal/util/dump/DualDumpOutputStream.java
@@ -18,11 +18,10 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
-import com.android.internal.util.IndentingPrintWriter;
-
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/core/java/com/android/internal/view/OWNERS b/core/java/com/android/internal/view/OWNERS
new file mode 100644
index 0000000..851d1f3
--- /dev/null
+++ b/core/java/com/android/internal/view/OWNERS
@@ -0,0 +1,20 @@
+# Bug component: 25700
+
+file:/core/java/android/view/OWNERS
+
+# Autofill
+per-file IInlineSuggestions*.aidl = file:/core/java/android/service/autofill/OWNERS
+per-file InlineSuggestions*.java = file:/core/java/android/service/autofill/OWNERS
+
+# Ime
+per-file *Input* = file:/services/core/java/com/android/server/inputmethod/OWNERS
+
+# Surface
+per-file *Surface* = file:/graphics/java/android/graphics/OWNERS
+per-file *Surface* = file:/services/core/java/com/android/server/wm/OWNERS
+
+# WindowManager
+per-file AppearanceRegion = file:/services/core/java/com/android/server/wm/OWNERS
+per-file BaseIWIndow.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file RotationPolicy.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file WindowManagerPolicyThread.java = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/core/jni/OWNERS b/core/jni/OWNERS
index 7d80993..8048298 100644
--- a/core/jni/OWNERS
+++ b/core/jni/OWNERS
@@ -6,15 +6,35 @@
per-file android_net_* = codewiz@google.com, jchalard@google.com, lorenzo@google.com, reminv@google.com, satk@google.com
# Display
-per-file android_hardware_display_* = michaelwr@google.com, santoscordon@google.com
+per-file android_hardware_display_* = file:/services/core/java/com/android/server/display/OWNERS
# Input
-per-file android_hardware_input* = michaelwr@google.com, svv@google.com
-per-file android_view_Input* = michaelwr@google.com, svv@google.com
-per-file android_view_KeyCharacterMap.* = michaelwr@google.com, svv@google.com
-per-file android_view_*KeyEvent.* = michaelwr@google.com, svv@google.com
-per-file android_view_*MotionEvent.* = michaelwr@google.com, svv@google.com
-per-file android_view_PointerIcon.* = michaelwr@google.com, svv@google.com
+per-file android_hardware_input* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_Input* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_KeyCharacterMap.* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_*KeyEvent.* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_*MotionEvent.* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_PointerIcon.* = file:/services/core/java/com/android/server/input/OWNERS
-# Zygote
-per-file com_android_internal_os_Zygote.*,fd_utils.* = calin@google.com, chriswailes@google.com, maco@google.com, narayan@google.com, ngeoffray@google.com
+# WindowManager
+per-file android_graphics_BLASTBufferQueue.cpp = file:/services/core/java/com/android/server/wm/OWNERS
+per-file android_view_Surface* = file:/services/core/java/com/android/server/wm/OWNERS
+
+per-file *Zygote* = file:/ZYGOTE_OWNERS
+per-file Android.bp = file:platform/build/soong:/OWNERS
+per-file android_animation_* = file:/core/java/android/animation/OWNERS
+per-file android_app_admin_* = file:/core/java/android/app/admin/OWNERS
+per-file android_content_res_* = file:/core/java/android/content/res/OWNERS
+per-file android_graphics_* = file:/graphics/java/android/graphics/OWNERS
+per-file android_hardware_Usb* = file:/services/usb/OWNERS
+per-file android_hardware_display_* = file:/core/java/android/hardware/display/OWNERS
+per-file android_hardware_input_* = file:/core/java/android/hardware/input/OWNERS
+per-file android_hardware_location_* = file:/core/java/android/hardware/location/OWNERS
+per-file android_media_* = file:/media/java/android/media/OWNERS
+per-file android_media_midi_* = file:/media/java/android/media/midi/OWNERS
+per-file android_opengl_* = file:/opengl/java/android/opengl/OWNERS
+per-file android_os_storage_* = file:/core/java/android/os/storage/OWNERS
+per-file android_se_* = file:/core/java/android/se/OWNERS
+per-file android_security_* = file:/core/java/android/security/OWNERS
+per-file android_view_* = file:/core/java/android/view/OWNERS
+per-file com_android_internal_net_* = file:/services/core/java/com/android/server/net/OWNERS
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 1ca45fe..a95ee4f 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -48,8 +48,9 @@
static jclass gArrayListClass;
static struct {
- jmethodID add;
- jmethodID toArray;
+ jmethodID cstor;
+ jmethodID add;
+ jmethodID toArray;
} gArrayListMethods;
static jclass gBooleanClass;
@@ -185,6 +186,9 @@
jclass gClsAudioTrackRoutingProxy;
jclass gClsAudioRecordRoutingProxy;
+jclass gAudioProfileClass;
+jmethodID gAudioProfileCstor;
+
static Mutex gLock;
enum AudioError {
@@ -807,13 +811,6 @@
return (jint) check_AudioSystem_Command(AudioSystem::checkAudioFlinger());
}
-
-static bool useInChannelMask(audio_port_type_t type, audio_port_role_t role)
-{
- return ((type == AUDIO_PORT_TYPE_DEVICE) && (role == AUDIO_PORT_ROLE_SOURCE)) ||
- ((type == AUDIO_PORT_TYPE_MIX) && (role == AUDIO_PORT_ROLE_SINK));
-}
-
static void convertAudioGainConfigToNative(JNIEnv *env,
struct audio_gain_config *nAudioGainConfig,
const jobject jAudioGainConfig,
@@ -873,7 +870,7 @@
configMask |= AUDIO_PORT_CONFIG_SAMPLE_RATE;
}
- bool useInMask = useInChannelMask(nAudioPortConfig->type, nAudioPortConfig->role);
+ bool useInMask = audio_port_config_has_input_direction(nAudioPortConfig);
audio_channel_mask_t nMask;
jint jMask = env->GetIntField(jAudioPortConfig,
gAudioPortConfigFields.mChannelMask);
@@ -1000,7 +997,7 @@
audioportCreated = true;
}
- bool useInMask = useInChannelMask(nAudioPortConfig->type, nAudioPortConfig->role);
+ bool useInMask = audio_port_config_has_input_direction(nAudioPortConfig);
audio_channel_mask_t nMask;
jint jMask;
@@ -1137,15 +1134,6 @@
return jStatus;
}
-static bool hasFormat(int* formats, size_t size, int format) {
- for (size_t index = 0; index < size; index++) {
- if (formats[index] == format) {
- return true; // found
- }
- }
- return false; // not found
-}
-
// TODO: pull out to separate file
template <typename T, size_t N>
static constexpr size_t array_size(const T (&)[N]) {
@@ -1167,43 +1155,46 @@
return result;
}
-static jint convertAudioPortFromNative(JNIEnv *env,
- jobject *jAudioPort, const struct audio_port *nAudioPort)
-{
+static bool isAudioPortArrayCountOutOfBounds(const struct audio_port_v7 *nAudioPort,
+ std::stringstream &ss) {
+ ss << " num_audio_profiles " << nAudioPort->num_audio_profiles << " num_gains "
+ << nAudioPort->num_gains;
+ if (nAudioPort->num_audio_profiles > array_size(nAudioPort->audio_profiles) ||
+ nAudioPort->num_gains > array_size(nAudioPort->gains)) {
+ return true;
+ }
+ for (size_t i = 0; i < nAudioPort->num_audio_profiles; ++i) {
+ ss << " (" << i << ") audio profile,"
+ << " num_sample_rates " << nAudioPort->audio_profiles[i].num_sample_rates
+ << " num_channel_masks " << nAudioPort->audio_profiles[i].num_channel_masks;
+ if (nAudioPort->audio_profiles[i].num_sample_rates >
+ array_size(nAudioPort->audio_profiles[i].sample_rates) ||
+ nAudioPort->audio_profiles[i].num_channel_masks >
+ array_size(nAudioPort->audio_profiles[i].channel_masks)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+static jint convertAudioPortFromNative(JNIEnv *env, jobject *jAudioPort,
+ const struct audio_port_v7 *nAudioPort) {
jint jStatus = (jint)AUDIO_JAVA_SUCCESS;
- jintArray jSamplingRates = NULL;
- jintArray jChannelMasks = NULL;
- jintArray jChannelIndexMasks = NULL;
jintArray jEncapsulationModes = NULL;
jintArray jEncapsulationMetadataTypes = NULL;
- int* cFormats = NULL;
- jintArray jFormats = NULL;
jobjectArray jGains = NULL;
jobject jHandle = NULL;
jobject jAudioPortConfig = NULL;
jstring jDeviceName = NULL;
+ jobject jAudioProfiles = NULL;
bool useInMask;
- size_t numPositionMasks = 0;
- size_t numIndexMasks = 0;
- size_t numUniqueFormats = 0;
ALOGV("convertAudioPortFromNative id %d role %d type %d name %s",
nAudioPort->id, nAudioPort->role, nAudioPort->type, nAudioPort->name);
// Verify audio port array count info.
- if (nAudioPort->num_sample_rates > array_size(nAudioPort->sample_rates)
- || nAudioPort->num_channel_masks > array_size(nAudioPort->channel_masks)
- || nAudioPort->num_formats > array_size(nAudioPort->formats)
- || nAudioPort->num_gains > array_size(nAudioPort->gains)) {
-
- std::stringstream ss;
- ss << "convertAudioPortFromNative array count out of bounds:"
- << " num_sample_rates " << nAudioPort->num_sample_rates
- << " num_channel_masks " << nAudioPort->num_channel_masks
- << " num_formats " << nAudioPort->num_formats
- << " num_gains " << nAudioPort->num_gains
- ;
- std::string s = ss.str();
+ if (std::stringstream ss; isAudioPortArrayCountOutOfBounds(nAudioPort, ss)) {
+ std::string s = "convertAudioPortFromNative array count out of bounds:" + ss.str();
// Prefer to log through Java wtf instead of native ALOGE.
ScopedLocalRef<jclass> jLogClass(env, env->FindClass("android/util/Log"));
@@ -1222,69 +1213,68 @@
goto exit;
}
- jSamplingRates = env->NewIntArray(nAudioPort->num_sample_rates);
- if (jSamplingRates == NULL) {
+ useInMask = audio_has_input_direction(nAudioPort->type, nAudioPort->role);
+ jAudioProfiles = env->NewObject(gArrayListClass, gArrayListMethods.cstor);
+ if (jAudioProfiles == nullptr) {
jStatus = (jint)AUDIO_JAVA_ERROR;
goto exit;
}
- if (nAudioPort->num_sample_rates) {
- env->SetIntArrayRegion(jSamplingRates, 0, nAudioPort->num_sample_rates,
- (jint *)nAudioPort->sample_rates);
- }
-
- // count up how many masks are positional and indexed
- for(size_t index = 0; index < nAudioPort->num_channel_masks; index++) {
- const audio_channel_mask_t mask = nAudioPort->channel_masks[index];
- if (audio_channel_mask_get_representation(mask) == AUDIO_CHANNEL_REPRESENTATION_INDEX) {
- numIndexMasks++;
- } else {
- numPositionMasks++;
- }
- }
-
- jChannelMasks = env->NewIntArray(numPositionMasks);
- if (jChannelMasks == NULL) {
- jStatus = (jint)AUDIO_JAVA_ERROR;
- goto exit;
- }
- jChannelIndexMasks = env->NewIntArray(numIndexMasks);
- if (jChannelIndexMasks == NULL) {
- jStatus = (jint)AUDIO_JAVA_ERROR;
- goto exit;
- }
- useInMask = useInChannelMask(nAudioPort->type, nAudioPort->role);
-
- // put the masks in the output arrays
- for (size_t maskIndex = 0, posMaskIndex = 0, indexedMaskIndex = 0;
- maskIndex < nAudioPort->num_channel_masks; maskIndex++) {
- const audio_channel_mask_t mask = nAudioPort->channel_masks[maskIndex];
- if (audio_channel_mask_get_representation(mask) == AUDIO_CHANNEL_REPRESENTATION_INDEX) {
- jint jMask = audio_channel_mask_get_bits(mask);
- env->SetIntArrayRegion(jChannelIndexMasks, indexedMaskIndex++, 1, &jMask);
- } else {
- jint jMask = useInMask ? inChannelMaskFromNative(mask)
- : outChannelMaskFromNative(mask);
- env->SetIntArrayRegion(jChannelMasks, posMaskIndex++, 1, &jMask);
- }
- }
-
- // formats
- if (nAudioPort->num_formats != 0) {
- cFormats = new int[nAudioPort->num_formats];
- for (size_t index = 0; index < nAudioPort->num_formats; index++) {
- int format = audioFormatFromNative(nAudioPort->formats[index]);
- if (!hasFormat(cFormats, numUniqueFormats, format)) {
- cFormats[numUniqueFormats++] = format;
+ for (size_t i = 0; i < nAudioPort->num_audio_profiles; ++i) {
+ size_t numPositionMasks = 0;
+ size_t numIndexMasks = 0;
+ // count up how many masks are positional and indexed
+ for (size_t index = 0; index < nAudioPort->audio_profiles[i].num_channel_masks; index++) {
+ const audio_channel_mask_t mask = nAudioPort->audio_profiles[i].channel_masks[index];
+ if (audio_channel_mask_get_representation(mask) == AUDIO_CHANNEL_REPRESENTATION_INDEX) {
+ numIndexMasks++;
+ } else {
+ numPositionMasks++;
}
}
- }
- jFormats = env->NewIntArray(numUniqueFormats);
- if (jFormats == NULL) {
- jStatus = (jint)AUDIO_JAVA_ERROR;
- goto exit;
- }
- if (numUniqueFormats != 0) {
- env->SetIntArrayRegion(jFormats, 0, numUniqueFormats, cFormats);
+
+ ScopedLocalRef<jintArray> jSamplingRates(env,
+ env->NewIntArray(nAudioPort->audio_profiles[i]
+ .num_sample_rates));
+ ScopedLocalRef<jintArray> jChannelMasks(env, env->NewIntArray(numPositionMasks));
+ ScopedLocalRef<jintArray> jChannelIndexMasks(env, env->NewIntArray(numIndexMasks));
+ if (!jSamplingRates.get() || !jChannelMasks.get() || !jChannelIndexMasks.get()) {
+ jStatus = (jint)AUDIO_JAVA_ERROR;
+ goto exit;
+ }
+
+ if (nAudioPort->audio_profiles[i].num_sample_rates) {
+ env->SetIntArrayRegion(jSamplingRates.get(), 0 /*start*/,
+ nAudioPort->audio_profiles[i].num_sample_rates,
+ (jint *)nAudioPort->audio_profiles[i].sample_rates);
+ }
+
+ // put the masks in the output arrays
+ for (size_t maskIndex = 0, posMaskIndex = 0, indexedMaskIndex = 0;
+ maskIndex < nAudioPort->audio_profiles[i].num_channel_masks; maskIndex++) {
+ const audio_channel_mask_t mask =
+ nAudioPort->audio_profiles[i].channel_masks[maskIndex];
+ if (audio_channel_mask_get_representation(mask) == AUDIO_CHANNEL_REPRESENTATION_INDEX) {
+ jint jMask = audio_channel_mask_get_bits(mask);
+ env->SetIntArrayRegion(jChannelIndexMasks.get(), indexedMaskIndex++, 1, &jMask);
+ } else {
+ jint jMask =
+ useInMask ? inChannelMaskFromNative(mask) : outChannelMaskFromNative(mask);
+ env->SetIntArrayRegion(jChannelMasks.get(), posMaskIndex++, 1, &jMask);
+ }
+ }
+
+ ScopedLocalRef<jobject>
+ jAudioProfile(env,
+ env->NewObject(gAudioProfileClass, gAudioProfileCstor,
+ audioFormatFromNative(
+ nAudioPort->audio_profiles[i].format),
+ jSamplingRates.get(), jChannelMasks.get(),
+ jChannelIndexMasks.get()));
+ if (jAudioProfile == nullptr) {
+ jStatus = (jint)AUDIO_JAVA_ERROR;
+ goto exit;
+ }
+ env->CallBooleanMethod(jAudioProfiles, gArrayListMethods.add, jAudioProfile.get());
}
// gains
@@ -1342,18 +1332,16 @@
convertEncapsulationInfoFromNative(env,
nAudioPort->ext.device
.encapsulation_metadata_types);
- *jAudioPort = env->NewObject(gAudioDevicePortClass, gAudioDevicePortCstor, jHandle,
- jDeviceName, jSamplingRates, jChannelMasks, jChannelIndexMasks,
- jFormats, jGains, nAudioPort->ext.device.type, jAddress,
- jEncapsulationModes, jEncapsulationMetadataTypes);
+ *jAudioPort =
+ env->NewObject(gAudioDevicePortClass, gAudioDevicePortCstor, jHandle, jDeviceName,
+ jAudioProfiles, jGains, nAudioPort->ext.device.type, jAddress,
+ jEncapsulationModes, jEncapsulationMetadataTypes);
env->DeleteLocalRef(jAddress);
} else if (nAudioPort->type == AUDIO_PORT_TYPE_MIX) {
ALOGV("convertAudioPortFromNative is a mix");
- *jAudioPort = env->NewObject(gAudioMixPortClass, gAudioMixPortCstor,
- jHandle, nAudioPort->ext.mix.handle,
- nAudioPort->role, jDeviceName,
- jSamplingRates, jChannelMasks, jChannelIndexMasks,
- jFormats, jGains);
+ *jAudioPort = env->NewObject(gAudioMixPortClass, gAudioMixPortCstor, jHandle,
+ nAudioPort->ext.mix.handle, nAudioPort->role, jDeviceName,
+ jAudioProfiles, jGains);
} else {
ALOGE("convertAudioPortFromNative unknown nAudioPort type %d", nAudioPort->type);
jStatus = (jint)AUDIO_JAVA_ERROR;
@@ -1378,26 +1366,14 @@
if (jDeviceName != NULL) {
env->DeleteLocalRef(jDeviceName);
}
- if (jSamplingRates != NULL) {
- env->DeleteLocalRef(jSamplingRates);
- }
- if (jChannelMasks != NULL) {
- env->DeleteLocalRef(jChannelMasks);
- }
- if (jChannelIndexMasks != NULL) {
- env->DeleteLocalRef(jChannelIndexMasks);
- }
if (jEncapsulationModes != NULL) {
env->DeleteLocalRef(jEncapsulationModes);
}
if (jEncapsulationMetadataTypes != NULL) {
env->DeleteLocalRef(jEncapsulationMetadataTypes);
}
- if (cFormats != NULL) {
- delete[] cFormats;
- }
- if (jFormats != NULL) {
- env->DeleteLocalRef(jFormats);
+ if (jAudioProfiles != NULL) {
+ env->DeleteLocalRef(jAudioProfiles);
}
if (jGains != NULL) {
env->DeleteLocalRef(jGains);
@@ -1436,7 +1412,7 @@
unsigned int generation;
unsigned int numPorts;
jint *nGeneration;
- struct audio_port *nPorts = NULL;
+ struct audio_port_v7 *nPorts = nullptr;
int attempts = MAX_PORT_GENERATION_SYNC_ATTEMPTS;
jint jStatus;
@@ -1448,11 +1424,8 @@
}
numPorts = 0;
- status = AudioSystem::listAudioPorts(AUDIO_PORT_ROLE_NONE,
- AUDIO_PORT_TYPE_NONE,
- &numPorts,
- NULL,
- &generation1);
+ status = AudioSystem::listAudioPorts(AUDIO_PORT_ROLE_NONE, AUDIO_PORT_TYPE_NONE, &numPorts,
+ nullptr, &generation1);
if (status != NO_ERROR) {
ALOGE_IF(status != NO_ERROR, "AudioSystem::listAudioPorts error %d", status);
break;
@@ -1461,13 +1434,10 @@
jStatus = (jint)AUDIO_JAVA_SUCCESS;
goto exit;
}
- nPorts = (struct audio_port *)realloc(nPorts, numPorts * sizeof(struct audio_port));
+ nPorts = (struct audio_port_v7 *)realloc(nPorts, numPorts * sizeof(struct audio_port_v7));
- status = AudioSystem::listAudioPorts(AUDIO_PORT_ROLE_NONE,
- AUDIO_PORT_TYPE_NONE,
- &numPorts,
- nPorts,
- &generation);
+ status = AudioSystem::listAudioPorts(AUDIO_PORT_ROLE_NONE, AUDIO_PORT_TYPE_NONE, &numPorts,
+ nPorts, &generation);
ALOGV("listAudioPorts AudioSystem::listAudioPorts numPorts %d generation %d generation1 %d",
numPorts, generation, generation1);
} while (generation1 != generation && status == NO_ERROR);
@@ -2113,10 +2083,9 @@
(audio_devices_t)device);
}
-static jboolean
-android_media_AudioSystem_isOffloadSupported(JNIEnv *env, jobject thiz,
- jint encoding, jint sampleRate, jint channelMask, jint channelIndexMask, jint streamType)
-{
+static jint android_media_AudioSystem_getOffloadSupport(JNIEnv *env, jobject thiz, jint encoding,
+ jint sampleRate, jint channelMask,
+ jint channelIndexMask, jint streamType) {
audio_offload_info_t format = AUDIO_INFO_INITIALIZER;
format.format = (audio_format_t) audioFormatToNative(encoding);
format.sample_rate = (uint32_t) sampleRate;
@@ -2128,7 +2097,7 @@
// client side code cannot access "audio.offload.min.duration.secs" property to make a query
// agnostic of duration, so using acceptable estimate of 2mn
format.duration_us = 120 * 1000000;
- return AudioSystem::isOffloadSupported(format);
+ return AudioSystem::getOffloadSupport(format);
}
static jint
@@ -2604,8 +2573,8 @@
(void *)android_media_AudioSystem_registerRecordingCallback},
{"systemReady", "()I", (void *)android_media_AudioSystem_systemReady},
{"getStreamVolumeDB", "(III)F", (void *)android_media_AudioSystem_getStreamVolumeDB},
- {"native_is_offload_supported", "(IIIII)Z",
- (void *)android_media_AudioSystem_isOffloadSupported},
+ {"native_get_offload_support", "(IIIII)I",
+ (void *)android_media_AudioSystem_getOffloadSupport},
{"getMicrophones", "(Ljava/util/ArrayList;)I",
(void *)android_media_AudioSystem_getMicrophones},
{"getSurroundFormats", "(Ljava/util/Map;Z)I",
@@ -2671,6 +2640,7 @@
jclass arrayListClass = FindClassOrDie(env, "java/util/ArrayList");
gArrayListClass = MakeGlobalRefOrDie(env, arrayListClass);
+ gArrayListMethods.cstor = GetMethodIDOrDie(env, arrayListClass, "<init>", "()V");
gArrayListMethods.add = GetMethodIDOrDie(env, arrayListClass, "add", "(Ljava/lang/Object;)Z");
gArrayListMethods.toArray = GetMethodIDOrDie(env, arrayListClass, "toArray", "()[Ljava/lang/Object;");
@@ -2733,7 +2703,7 @@
gAudioDevicePortClass = MakeGlobalRefOrDie(env, audioDevicePortClass);
gAudioDevicePortCstor =
GetMethodIDOrDie(env, audioDevicePortClass, "<init>",
- "(Landroid/media/AudioHandle;Ljava/lang/String;[I[I[I[I"
+ "(Landroid/media/AudioHandle;Ljava/lang/String;Ljava/util/List;"
"[Landroid/media/AudioGain;ILjava/lang/String;[I[I)V");
// When access AudioPort as AudioDevicePort
@@ -2743,8 +2713,10 @@
jclass audioMixPortClass = FindClassOrDie(env, "android/media/AudioMixPort");
gAudioMixPortClass = MakeGlobalRefOrDie(env, audioMixPortClass);
- gAudioMixPortCstor = GetMethodIDOrDie(env, audioMixPortClass, "<init>",
- "(Landroid/media/AudioHandle;IILjava/lang/String;[I[I[I[I[Landroid/media/AudioGain;)V");
+ gAudioMixPortCstor =
+ GetMethodIDOrDie(env, audioMixPortClass, "<init>",
+ "(Landroid/media/AudioHandle;IILjava/lang/String;Ljava/util/List;"
+ "[Landroid/media/AudioGain;)V");
jclass audioGainClass = FindClassOrDie(env, "android/media/AudioGain");
gAudioGainClass = MakeGlobalRefOrDie(env, audioGainClass);
@@ -2846,6 +2818,10 @@
jclass listClass = FindClassOrDie(env, "java/util/List");
gListMethods.add = GetMethodIDOrDie(env, listClass, "add", "(Ljava/lang/Object;)Z");
+ jclass audioProfileClass = FindClassOrDie(env, "android/media/AudioProfile");
+ gAudioProfileClass = MakeGlobalRefOrDie(env, audioProfileClass);
+ gAudioProfileCstor = GetMethodIDOrDie(env, audioProfileClass, "<init>", "(I[I[I[I)V");
+
AudioSystem::addErrorCallback(android_media_AudioSystem_error_callback);
RegisterMethodsOrDie(env, kClassPathName, gMethods, NELEM(gMethods));
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 6ec656c..a21545c 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -52,6 +52,7 @@
#include <ui/Rect.h>
#include <ui/Region.h>
#include <utils/Log.h>
+#include <utils/LightRefBase.h>
// ----------------------------------------------------------------------------
@@ -206,6 +207,16 @@
jfieldID appRequestRefreshRateMax;
} gDesiredDisplayConfigSpecsClassInfo;
+static struct {
+ jclass clazz;
+ jmethodID onJankDataAvailable;
+} gJankDataListenerClassInfo;
+
+static struct {
+ jclass clazz;
+ jmethodID ctor;
+} gJankDataClassInfo;
+
class JNamedColorSpace {
public:
// ColorSpace.Named.SRGB.ordinal() = 0;
@@ -1601,6 +1612,73 @@
transaction->setFrameTimelineVsync(frameTimelineVsyncId);
}
+class JankDataListenerWrapper : public JankDataListener {
+public:
+ JankDataListenerWrapper(JNIEnv* env, jobject onJankDataListenerObject) {
+ mOnJankDataListenerWeak = env->NewWeakGlobalRef(onJankDataListenerObject);
+ env->GetJavaVM(&mVm);
+ }
+
+ ~JankDataListenerWrapper() {
+ JNIEnv* env = getEnv();
+ env->DeleteWeakGlobalRef(mOnJankDataListenerWeak);
+ }
+
+ void onJankDataAvailable(const std::vector<JankData>& jankData) {
+ JNIEnv* env = getEnv();
+
+ jobject target = env->NewLocalRef(mOnJankDataListenerWeak);
+ if (target == nullptr) return;
+
+ jobjectArray jJankDataArray = env->NewObjectArray(jankData.size(),
+ gJankDataClassInfo.clazz, nullptr);
+ for (int i = 0; i < jankData.size(); i++) {
+ jobject jJankData = env->NewObject(gJankDataClassInfo.clazz,
+ gJankDataClassInfo.ctor, jankData[i].frameVsyncId, jankData[i].jankType);
+ env->SetObjectArrayElement(jJankDataArray, i, jJankData);
+ }
+ env->CallVoidMethod(target,
+ gJankDataListenerClassInfo.onJankDataAvailable,
+ jJankDataArray);
+ env->DeleteLocalRef(target);
+ }
+
+private:
+
+ JNIEnv* getEnv() {
+ JNIEnv* env;
+ mVm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6);
+ return env;
+ }
+
+ JavaVM* mVm;
+ jobject mOnJankDataListenerWeak;
+};
+
+static void nativeAddJankDataListener(JNIEnv* env, jclass clazz,
+ jlong jankDataCallbackListenerPtr,
+ jlong nativeSurfaceControl) {
+ sp<SurfaceControl> surface(reinterpret_cast<SurfaceControl *>(nativeSurfaceControl));
+ if (surface == nullptr) {
+ return;
+ }
+ JankDataListenerWrapper* wrapper =
+ reinterpret_cast<JankDataListenerWrapper*>(jankDataCallbackListenerPtr);
+ TransactionCompletedListener::getInstance()->addJankListener(wrapper, surface);
+}
+
+static void nativeRemoveJankDataListener(JNIEnv* env, jclass clazz,
+ jlong jankDataCallbackListenerPtr) {
+ JankDataListenerWrapper* wrapper =
+ reinterpret_cast<JankDataListenerWrapper*>(jankDataCallbackListenerPtr);
+ TransactionCompletedListener::getInstance()->removeJankListener(wrapper);
+}
+
+static jlong nativeCreateJankDataListenerWrapper(JNIEnv* env, jclass clazz,
+ jobject jankDataListenerObject) {
+ return reinterpret_cast<jlong>(new JankDataListenerWrapper(env, jankDataListenerObject));
+}
+
// ----------------------------------------------------------------------------
static const JNINativeMethod sSurfaceControlMethods[] = {
@@ -1785,6 +1863,12 @@
(void*)nativeSetFocusedWindow},
{"nativeSetFrameTimelineVsync", "(JJ)V",
(void*)nativeSetFrameTimelineVsync },
+ {"nativeAddJankDataListener", "(JJ)V",
+ (void*)nativeAddJankDataListener },
+ {"nativeRemoveJankDataListener", "(J)V",
+ (void*)nativeRemoveJankDataListener },
+ {"nativeCreateJankDataListenerWrapper", "(Landroid/view/SurfaceControl$OnJankDataListener;)J",
+ (void*)nativeCreateJankDataListenerWrapper },
// clang-format on
};
@@ -1966,6 +2050,18 @@
gScreenCaptureListenerClassInfo.onScreenCaptureComplete =
GetMethodIDOrDie(env, screenCaptureListenerClazz, "onScreenCaptureComplete",
"(Landroid/view/SurfaceControl$ScreenshotHardwareBuffer;)V");
+
+ jclass jankDataClazz =
+ FindClassOrDie(env, "android/view/SurfaceControl$JankData");
+ gJankDataClassInfo.clazz = MakeGlobalRefOrDie(env, jankDataClazz);
+ gJankDataClassInfo.ctor =
+ GetMethodIDOrDie(env, gJankDataClassInfo.clazz, "<init>", "(JI)V");
+ jclass onJankDataListenerClazz =
+ FindClassOrDie(env, "android/view/SurfaceControl$OnJankDataListener");
+ gJankDataListenerClassInfo.clazz = MakeGlobalRefOrDie(env, onJankDataListenerClazz);
+ gJankDataListenerClassInfo.onJankDataAvailable =
+ GetMethodIDOrDie(env, onJankDataListenerClazz, "onJankDataAvailable",
+ "([Landroid/view/SurfaceControl$JankData;)V");
return err;
}
diff --git a/core/jni/com_android_internal_os_KernelSingleProcessCpuThreadReader.cpp b/core/jni/com_android_internal_os_KernelSingleProcessCpuThreadReader.cpp
index 52bed6b..dfae684 100644
--- a/core/jni/com_android_internal_os_KernelSingleProcessCpuThreadReader.cpp
+++ b/core/jni/com_android_internal_os_KernelSingleProcessCpuThreadReader.cpp
@@ -26,239 +26,230 @@
#include <android_runtime/Log.h>
#include <nativehelper/ScopedPrimitiveArray.h>
-#include <nativehelper/ScopedUtfChars.h>
namespace android {
+static constexpr uint16_t DEFAULT_THREAD_AGGREGATION_KEY = 0;
+static constexpr uint16_t SELECTED_THREAD_AGGREGATION_KEY = 1;
+
+static constexpr uint64_t NSEC_PER_MSEC = 1000000;
+
// Number of milliseconds in a jiffy - the unit of time measurement for processes and threads
static const uint32_t gJiffyMillis = (uint32_t)(1000 / sysconf(_SC_CLK_TCK));
-// Given a PID, returns a vector of all TIDs for the process' tasks. Thread IDs are
-// file names in the /proc/<pid>/task directory.
-static bool getThreadIds(const std::string &procPath, const pid_t pid,
- std::vector<pid_t> &outThreadIds) {
- std::string taskPath = android::base::StringPrintf("%s/%u/task", procPath.c_str(), pid);
+// Abstract class for readers of CPU time-in-state. There are two implementations of
+// this class: BpfCpuTimeInStateReader and MockCpuTimeInStateReader. The former is used
+// by the production code. The latter is used by unit tests to provide mock
+// CPU time-in-state data via a Java implementation.
+class ICpuTimeInStateReader {
+public:
+ virtual ~ICpuTimeInStateReader() {}
- struct dirent **dirlist;
- int threadCount = scandir(taskPath.c_str(), &dirlist, NULL, NULL);
- if (threadCount == -1) {
- ALOGE("Cannot read directory %s", taskPath.c_str());
- return false;
- }
+ // Returns the overall number of cluser-frequency combinations
+ virtual size_t getCpuFrequencyCount();
- outThreadIds.reserve(threadCount);
+ // Marks the CPU time-in-state tracking for threads of the specified TGID
+ virtual bool startTrackingProcessCpuTimes(pid_t) = 0;
- for (int i = 0; i < threadCount; i++) {
- pid_t tid;
- if (android::base::ParseInt<pid_t>(dirlist[i]->d_name, &tid)) {
- outThreadIds.push_back(tid);
+ // Marks the thread specified by its PID for CPU time-in-state tracking.
+ virtual bool startAggregatingTaskCpuTimes(pid_t, uint16_t) = 0;
+
+ // Retrieves the accumulated time-in-state data, which is organized as a map
+ // from aggregation keys to vectors of vectors using the format:
+ // { aggKey0 -> [[t0_0_0, t0_0_1, ...], [t0_1_0, t0_1_1, ...], ...],
+ // aggKey1 -> [[t1_0_0, t1_0_1, ...], [t1_1_0, t1_1_1, ...], ...], ... }
+ // where ti_j_k is the ns tid i spent running on the jth cluster at the cluster's kth lowest
+ // freq.
+ virtual std::optional<std::unordered_map<uint16_t, std::vector<std::vector<uint64_t>>>>
+ getAggregatedTaskCpuFreqTimes(pid_t, const std::vector<uint16_t> &);
+};
+
+// ICpuTimeInStateReader that uses eBPF to provide a map of aggregated CPU time-in-state values.
+// See cputtimeinstate.h/.cpp
+class BpfCpuTimeInStateReader : public ICpuTimeInStateReader {
+public:
+ size_t getCpuFrequencyCount() {
+ std::optional<std::vector<std::vector<uint32_t>>> cpuFreqs = android::bpf::getCpuFreqs();
+ if (!cpuFreqs) {
+ ALOGE("Cannot obtain CPU frequency count");
+ return 0;
}
- free(dirlist[i]);
- }
- free(dirlist);
- return true;
+ size_t freqCount = 0;
+ for (auto cluster : *cpuFreqs) {
+ freqCount += cluster.size();
+ }
+
+ return freqCount;
+ }
+
+ bool startTrackingProcessCpuTimes(pid_t tgid) {
+ return android::bpf::startTrackingProcessCpuTimes(tgid);
+ }
+
+ bool startAggregatingTaskCpuTimes(pid_t pid, uint16_t aggregationKey) {
+ return android::bpf::startAggregatingTaskCpuTimes(pid, aggregationKey);
+ }
+
+ std::optional<std::unordered_map<uint16_t, std::vector<std::vector<uint64_t>>>>
+ getAggregatedTaskCpuFreqTimes(pid_t pid, const std::vector<uint16_t> &aggregationKeys) {
+ return android::bpf::getAggregatedTaskCpuFreqTimes(pid, aggregationKeys);
+ }
+};
+
+// ICpuTimeInStateReader that uses JNI to provide a map of aggregated CPU time-in-state
+// values.
+// This version of CpuTimeInStateReader is used exclusively for providing mock data in tests.
+class MockCpuTimeInStateReader : public ICpuTimeInStateReader {
+private:
+ JNIEnv *mEnv;
+ jobject mCpuTimeInStateReader;
+
+public:
+ MockCpuTimeInStateReader(JNIEnv *env, jobject cpuTimeInStateReader)
+ : mEnv(env), mCpuTimeInStateReader(cpuTimeInStateReader) {}
+
+ size_t getCpuFrequencyCount();
+
+ bool startTrackingProcessCpuTimes(pid_t tgid);
+
+ bool startAggregatingTaskCpuTimes(pid_t pid, uint16_t aggregationKey);
+
+ std::optional<std::unordered_map<uint16_t, std::vector<std::vector<uint64_t>>>>
+ getAggregatedTaskCpuFreqTimes(pid_t tgid, const std::vector<uint16_t> &aggregationKeys);
+};
+
+static ICpuTimeInStateReader *getCpuTimeInStateReader(JNIEnv *env,
+ jobject cpuTimeInStateReaderObject) {
+ if (cpuTimeInStateReaderObject) {
+ return new MockCpuTimeInStateReader(env, cpuTimeInStateReaderObject);
+ } else {
+ return new BpfCpuTimeInStateReader();
+ }
}
-// Reads contents of a time_in_state file and returns times as a vector of times per frequency
-// A time_in_state file contains pairs of frequency - time (in jiffies):
-//
-// cpu0
-// 300000 30
-// 403200 0
-// cpu4
-// 710400 10
-// 825600 20
-// 940800 30
-//
-static bool getThreadTimeInState(const std::string &procPath, const pid_t pid, const pid_t tid,
- const size_t frequencyCount,
- std::vector<uint64_t> &outThreadTimeInState) {
- std::string timeInStateFilePath =
- android::base::StringPrintf("%s/%u/task/%u/time_in_state", procPath.c_str(), pid, tid);
- std::string data;
+static jint getCpuFrequencyCount(JNIEnv *env, jclass, jobject cpuTimeInStateReaderObject) {
+ std::unique_ptr<ICpuTimeInStateReader> cpuTimeInStateReader(
+ getCpuTimeInStateReader(env, cpuTimeInStateReaderObject));
+ return cpuTimeInStateReader->getCpuFrequencyCount();
+}
- if (!android::base::ReadFileToString(timeInStateFilePath, &data)) {
- ALOGE("Cannot read file: %s", timeInStateFilePath.c_str());
- return false;
- }
+static jboolean startTrackingProcessCpuTimes(JNIEnv *env, jclass, jint tgid,
+ jobject cpuTimeInStateReaderObject) {
+ std::unique_ptr<ICpuTimeInStateReader> cpuTimeInStateReader(
+ getCpuTimeInStateReader(env, cpuTimeInStateReaderObject));
+ return cpuTimeInStateReader->startTrackingProcessCpuTimes(tgid);
+}
- auto lines = android::base::Split(data, "\n");
- size_t index = 0;
- for (const auto &line : lines) {
- if (line.empty()) {
- continue;
- }
+static jboolean startAggregatingThreadCpuTimes(JNIEnv *env, jclass, jintArray selectedThreadIdArray,
+ jobject cpuTimeInStateReaderObject) {
+ ScopedIntArrayRO selectedThreadIds(env, selectedThreadIdArray);
+ std::unique_ptr<ICpuTimeInStateReader> cpuTimeInStateReader(
+ getCpuTimeInStateReader(env, cpuTimeInStateReaderObject));
- auto numbers = android::base::Split(line, " ");
- if (numbers.size() != 2) {
- continue;
- }
- uint64_t timeInState;
- if (!android::base::ParseUint<uint64_t>(numbers[1], &timeInState)) {
- ALOGE("Invalid time_in_state file format: %s", timeInStateFilePath.c_str());
+ for (int i = 0; i < selectedThreadIds.size(); i++) {
+ if (!cpuTimeInStateReader->startAggregatingTaskCpuTimes(selectedThreadIds[i],
+ SELECTED_THREAD_AGGREGATION_KEY)) {
return false;
}
- if (index < frequencyCount) {
- outThreadTimeInState[index] = timeInState;
- }
- index++;
}
+ return true;
+}
+// Converts time-in-state data from a vector of vectors to a flat array.
+// Also converts from nanoseconds to milliseconds.
+static bool flattenTimeInStateData(ScopedLongArrayRW &cpuTimesMillis,
+ const std::vector<std::vector<uint64_t>> &data) {
+ size_t frequencyCount = cpuTimesMillis.size();
+ size_t index = 0;
+ for (const auto &cluster : data) {
+ for (const uint64_t &timeNanos : cluster) {
+ if (index < frequencyCount) {
+ cpuTimesMillis[index] = timeNanos / NSEC_PER_MSEC;
+ }
+ index++;
+ }
+ }
if (index != frequencyCount) {
- ALOGE("Incorrect number of frequencies %u in %s. Expected %u",
- (uint32_t)outThreadTimeInState.size(), timeInStateFilePath.c_str(),
- (uint32_t)frequencyCount);
+ ALOGE("CPU time-in-state reader returned data for %zu frequencies; expected: %zu", index,
+ frequencyCount);
return false;
}
return true;
}
-static int pidCompare(const void *a, const void *b) {
- return (*(pid_t *)a - *(pid_t *)b);
-}
-
-static inline bool isSelectedThread(const pid_t tid, const pid_t *selectedThreadIds,
- const size_t selectedThreadCount) {
- return bsearch(&tid, selectedThreadIds, selectedThreadCount, sizeof(pid_t), pidCompare) != NULL;
-}
-
-// Reads all /proc/<pid>/task/*/time_in_state files and aggregates per-frequency
+// Reads all CPU time-in-state data accumulated by BPF and aggregates per-frequency
// time in state data for all threads. Also, separately aggregates time in state for
// selected threads whose TIDs are passes as selectedThreadIds.
-static void aggregateThreadCpuTimes(const std::string &procPath, const pid_t pid,
- const std::vector<pid_t> &threadIds,
- const size_t frequencyCount, const pid_t *selectedThreadIds,
- const size_t selectedThreadCount,
- uint64_t *threadCpuTimesMillis,
- uint64_t *selectedThreadCpuTimesMillis) {
- for (size_t j = 0; j < frequencyCount; j++) {
- threadCpuTimesMillis[j] = 0;
- selectedThreadCpuTimesMillis[j] = 0;
- }
-
- for (size_t i = 0; i < threadIds.size(); i++) {
- pid_t tid = threadIds[i];
- std::vector<uint64_t> timeInState(frequencyCount);
- if (!getThreadTimeInState(procPath, pid, tid, frequencyCount, timeInState)) {
- continue;
- }
-
- bool selectedThread = isSelectedThread(tid, selectedThreadIds, selectedThreadCount);
- for (size_t j = 0; j < frequencyCount; j++) {
- threadCpuTimesMillis[j] += timeInState[j];
- if (selectedThread) {
- selectedThreadCpuTimesMillis[j] += timeInState[j];
- }
- }
- }
- for (size_t i = 0; i < frequencyCount; i++) {
- threadCpuTimesMillis[i] *= gJiffyMillis;
- selectedThreadCpuTimesMillis[i] *= gJiffyMillis;
- }
-}
-
-// Reads process utime and stime from the /proc/<pid>/stat file.
-// Format of this file is described in https://man7.org/linux/man-pages/man5/proc.5.html.
-static bool getProcessCpuTime(const std::string &procPath, const pid_t pid,
- uint64_t &outTimeMillis) {
- std::string statFilePath = android::base::StringPrintf("%s/%u/stat", procPath.c_str(), pid);
- std::string data;
- if (!android::base::ReadFileToString(statFilePath, &data)) {
- return false;
- }
-
- auto fields = android::base::Split(data, " ");
- uint64_t utime, stime;
-
- // Field 14 (counting from 1) is utime - process time in user space, in jiffies
- // Field 15 (counting from 1) is stime - process time in system space, in jiffies
- if (fields.size() < 15 || !android::base::ParseUint(fields[13], &utime) ||
- !android::base::ParseUint(fields[14], &stime)) {
- ALOGE("Invalid file format %s", statFilePath.c_str());
- return false;
- }
-
- outTimeMillis = (utime + stime) * gJiffyMillis;
- return true;
-}
-
-// Estimates per cluster per frequency CPU time for the entire process
-// by distributing the total process CPU time proportionately to how much
-// CPU time its threads took on those clusters/frequencies. This algorithm
-// works more accurately when when we have equally distributed concurrency.
-// TODO(b/169279846): obtain actual process CPU times from the kernel
-static void estimateProcessTimeInState(const uint64_t processCpuTimeMillis,
- const uint64_t *threadCpuTimesMillis,
- const size_t frequencyCount,
- uint64_t *processCpuTimesMillis) {
- uint64_t totalCpuTimeAllThreads = 0;
- for (size_t i = 0; i < frequencyCount; i++) {
- totalCpuTimeAllThreads += threadCpuTimesMillis[i];
- }
-
- if (totalCpuTimeAllThreads != 0) {
- for (size_t i = 0; i < frequencyCount; i++) {
- processCpuTimesMillis[i] =
- processCpuTimeMillis * threadCpuTimesMillis[i] / totalCpuTimeAllThreads;
- }
- } else {
- for (size_t i = 0; i < frequencyCount; i++) {
- processCpuTimesMillis[i] = 0;
- }
- }
-}
-
-static jboolean readProcessCpuUsage(JNIEnv *env, jclass, jstring procPath, jint pid,
- jintArray selectedThreadIdArray,
- jlongArray processCpuTimesMillisArray,
+static jboolean readProcessCpuUsage(JNIEnv *env, jclass, jint pid,
jlongArray threadCpuTimesMillisArray,
- jlongArray selectedThreadCpuTimesMillisArray) {
- ScopedUtfChars procPathChars(env, procPath);
- ScopedIntArrayRO selectedThreadIds(env, selectedThreadIdArray);
- ScopedLongArrayRW processCpuTimesMillis(env, processCpuTimesMillisArray);
+ jlongArray selectedThreadCpuTimesMillisArray,
+ jobject cpuTimeInStateReaderObject) {
ScopedLongArrayRW threadCpuTimesMillis(env, threadCpuTimesMillisArray);
ScopedLongArrayRW selectedThreadCpuTimesMillis(env, selectedThreadCpuTimesMillisArray);
+ std::unique_ptr<ICpuTimeInStateReader> cpuTimeInStateReader(
+ getCpuTimeInStateReader(env, cpuTimeInStateReaderObject));
- std::string procPathStr(procPathChars.c_str());
-
- // Get all thread IDs for the process.
- std::vector<pid_t> threadIds;
- if (!getThreadIds(procPathStr, pid, threadIds)) {
- ALOGE("Could not obtain thread IDs from: %s", procPathStr.c_str());
- return false;
- }
-
- size_t frequencyCount = processCpuTimesMillis.size();
+ const size_t frequencyCount = cpuTimeInStateReader->getCpuFrequencyCount();
if (threadCpuTimesMillis.size() != frequencyCount) {
- ALOGE("Invalid array length: threadCpuTimesMillis");
+ ALOGE("Invalid threadCpuTimesMillis array length: %zu frequencies; expected: %zu",
+ threadCpuTimesMillis.size(), frequencyCount);
return false;
}
+
if (selectedThreadCpuTimesMillis.size() != frequencyCount) {
- ALOGE("Invalid array length: selectedThreadCpuTimesMillisArray");
+ ALOGE("Invalid selectedThreadCpuTimesMillis array length: %zu frequencies; expected: %zu",
+ selectedThreadCpuTimesMillis.size(), frequencyCount);
return false;
}
- aggregateThreadCpuTimes(procPathStr, pid, threadIds, frequencyCount, selectedThreadIds.get(),
- selectedThreadIds.size(),
- reinterpret_cast<uint64_t *>(threadCpuTimesMillis.get()),
- reinterpret_cast<uint64_t *>(selectedThreadCpuTimesMillis.get()));
-
- uint64_t processCpuTime;
- bool ret = getProcessCpuTime(procPathStr, pid, processCpuTime);
- if (ret) {
- estimateProcessTimeInState(processCpuTime,
- reinterpret_cast<uint64_t *>(threadCpuTimesMillis.get()),
- frequencyCount,
- reinterpret_cast<uint64_t *>(processCpuTimesMillis.get()));
+ for (size_t i = 0; i < frequencyCount; i++) {
+ threadCpuTimesMillis[i] = 0;
+ selectedThreadCpuTimesMillis[i] = 0;
}
- return ret;
+
+ std::optional<std::unordered_map<uint16_t, std::vector<std::vector<uint64_t>>>> data =
+ cpuTimeInStateReader->getAggregatedTaskCpuFreqTimes(pid,
+ {DEFAULT_THREAD_AGGREGATION_KEY,
+ SELECTED_THREAD_AGGREGATION_KEY});
+ if (!data) {
+ ALOGE("Cannot read thread CPU times for PID %d", pid);
+ return false;
+ }
+
+ if (!flattenTimeInStateData(threadCpuTimesMillis, (*data)[DEFAULT_THREAD_AGGREGATION_KEY])) {
+ return false;
+ }
+
+ if (!flattenTimeInStateData(selectedThreadCpuTimesMillis,
+ (*data)[SELECTED_THREAD_AGGREGATION_KEY])) {
+ return false;
+ }
+
+ // threadCpuTimesMillis returns CPU times for _all_ threads, including the selected ones
+ for (size_t i = 0; i < frequencyCount; i++) {
+ threadCpuTimesMillis[i] += selectedThreadCpuTimesMillis[i];
+ }
+
+ return true;
}
static const JNINativeMethod g_single_methods[] = {
- {"readProcessCpuUsage", "(Ljava/lang/String;I[I[J[J[J)Z", (void *)readProcessCpuUsage},
+ {"getCpuFrequencyCount",
+ "(Lcom/android/internal/os/KernelSingleProcessCpuThreadReader$CpuTimeInStateReader;)I",
+ (void *)getCpuFrequencyCount},
+ {"startTrackingProcessCpuTimes",
+ "(ILcom/android/internal/os/KernelSingleProcessCpuThreadReader$CpuTimeInStateReader;)Z",
+ (void *)startTrackingProcessCpuTimes},
+ {"startAggregatingThreadCpuTimes",
+ "([ILcom/android/internal/os/KernelSingleProcessCpuThreadReader$CpuTimeInStateReader;)Z",
+ (void *)startAggregatingThreadCpuTimes},
+ {"readProcessCpuUsage",
+ "(I[J[J"
+ "Lcom/android/internal/os/KernelSingleProcessCpuThreadReader$CpuTimeInStateReader;)Z",
+ (void *)readProcessCpuUsage},
};
int register_com_android_internal_os_KernelSingleProcessCpuThreadReader(JNIEnv *env) {
@@ -266,4 +257,77 @@
g_single_methods, NELEM(g_single_methods));
}
+size_t MockCpuTimeInStateReader::getCpuFrequencyCount() {
+ jclass cls = mEnv->GetObjectClass(mCpuTimeInStateReader);
+ jmethodID mid = mEnv->GetMethodID(cls, "getCpuFrequencyCount", "()I");
+ if (mid == 0) {
+ ALOGE("Couldn't find the method getCpuFrequencyCount");
+ return false;
+ }
+ return (size_t)mEnv->CallIntMethod(mCpuTimeInStateReader, mid);
+}
+
+bool MockCpuTimeInStateReader::startTrackingProcessCpuTimes(pid_t tgid) {
+ jclass cls = mEnv->GetObjectClass(mCpuTimeInStateReader);
+ jmethodID mid = mEnv->GetMethodID(cls, "startTrackingProcessCpuTimes", "(I)Z");
+ if (mid == 0) {
+ ALOGE("Couldn't find the method startTrackingProcessCpuTimes");
+ return false;
+ }
+ return mEnv->CallBooleanMethod(mCpuTimeInStateReader, mid, tgid);
+}
+
+bool MockCpuTimeInStateReader::startAggregatingTaskCpuTimes(pid_t pid, uint16_t aggregationKey) {
+ jclass cls = mEnv->GetObjectClass(mCpuTimeInStateReader);
+ jmethodID mid = mEnv->GetMethodID(cls, "startAggregatingTaskCpuTimes", "(II)Z");
+ if (mid == 0) {
+ ALOGE("Couldn't find the method startAggregatingTaskCpuTimes");
+ return false;
+ }
+ return mEnv->CallBooleanMethod(mCpuTimeInStateReader, mid, pid, aggregationKey);
+}
+
+std::optional<std::unordered_map<uint16_t, std::vector<std::vector<uint64_t>>>>
+MockCpuTimeInStateReader::getAggregatedTaskCpuFreqTimes(
+ pid_t pid, const std::vector<uint16_t> &aggregationKeys) {
+ jclass cls = mEnv->GetObjectClass(mCpuTimeInStateReader);
+ jmethodID mid =
+ mEnv->GetMethodID(cls, "getAggregatedTaskCpuFreqTimes", "(I)[Ljava/lang/String;");
+ if (mid == 0) {
+ ALOGE("Couldn't find the method getAggregatedTaskCpuFreqTimes");
+ return {};
+ }
+
+ std::unordered_map<uint16_t, std::vector<std::vector<uint64_t>>> map;
+
+ jobjectArray stringArray =
+ (jobjectArray)mEnv->CallObjectMethod(mCpuTimeInStateReader, mid, pid);
+ int size = mEnv->GetArrayLength(stringArray);
+ for (int i = 0; i < size; i++) {
+ ScopedUtfChars line(mEnv, (jstring)mEnv->GetObjectArrayElement(stringArray, i));
+ uint16_t aggregationKey;
+ std::vector<std::vector<uint64_t>> times;
+
+ // Each string is formatted like this: "aggKey:t0_0 t0_1...:t1_0 t1_1..."
+ auto fields = android::base::Split(line.c_str(), ":");
+ android::base::ParseUint(fields[0], &aggregationKey);
+
+ for (int j = 1; j < fields.size(); j++) {
+ auto numbers = android::base::Split(fields[j], " ");
+
+ std::vector<uint64_t> chunk;
+ for (int k = 0; k < numbers.size(); k++) {
+ uint64_t time;
+ android::base::ParseUint(numbers[k], &time);
+ chunk.emplace_back(time);
+ }
+ times.emplace_back(chunk);
+ }
+
+ map.emplace(aggregationKey, times);
+ }
+
+ return map;
+}
+
} // namespace android
diff --git a/core/proto/android/hardware/sensorprivacy.proto b/core/proto/android/hardware/sensorprivacy.proto
new file mode 100644
index 0000000..07e938d
--- /dev/null
+++ b/core/proto/android/hardware/sensorprivacy.proto
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+syntax = "proto2";
+package android.service;
+
+option java_multiple_files = true;
+option java_outer_classname = "SensorPrivacyServiceProto";
+
+import "frameworks/base/core/proto/android/privacy.proto";
+
+message SensorPrivacyServiceDumpProto {
+ option (android.msg_privacy).dest = DEST_AUTOMATIC;
+
+ // Is global sensor privacy enabled
+ optional bool is_enabled = 1;
+
+ // Per sensor privacy enabled
+ repeated SensorPrivacyIndividualEnabledSensorProto individual_enabled_sensor = 2;
+}
+
+message SensorPrivacyIndividualEnabledSensorProto {
+ option (android.msg_privacy).dest = DEST_AUTOMATIC;
+
+ enum Sensor {
+ UNKNOWN = 0;
+
+ MICROPHONE = 1;
+ CAMERA = 2;
+ }
+
+ // Sensor for which privacy might be enabled
+ optional Sensor sensor = 1;
+
+ // If sensor privacy is enabled for this sensor
+ optional bool is_enabled = 2;
+}
\ No newline at end of file
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 1250eb7..ef7edc2 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1361,7 +1361,7 @@
android:description="@string/permdesc_systemCamera"
android:protectionLevel="system|signature" />
- <!-- Allows receiving the camera service notifications when a camera is opened
+ <!-- @SystemApi Allows receiving the camera service notifications when a camera is opened
(by a certain application package) or closed.
@hide -->
<permission android:name="android.permission.CAMERA_OPEN_CLOSE_LISTENER"
@@ -2212,6 +2212,13 @@
<permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
android:protectionLevel="signature|privileged" />
+ <!-- Allows to read device identifiers and use ICC based authentication like EAP-AKA.
+ Often required in authentication to access the carrier's server and manage services
+ of the subscriber.
+ <p>Protection level: signature|appop -->
+ <permission android:name="android.permission.USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER"
+ android:protectionLevel="signature|appop" />
+
<!-- @SystemApi Allows read access to emergency number information for ongoing calls or SMS
sessions.
@hide Used internally. -->
@@ -2252,7 +2259,9 @@
<!-- Allows to query ongoing call details and manage ongoing calls
<p>Protection level: signature|appop -->
<permission android:name="android.permission.MANAGE_ONGOING_CALLS"
- android:protectionLevel="signature|appop" />
+ android:protectionLevel="signature|appop"
+ android:label="@string/permlab_manageOngoingCalls"
+ android:description="@string/permdesc_manageOngoingCalls" />
<!-- Allows the app to request network scans from telephony.
<p>Not for use by third-party applications.
@@ -2379,6 +2388,15 @@
<permission android:name="android.permission.READ_CARRIER_APP_INFO"
android:protectionLevel="signature" />
+ <!-- Must be required by an GbaService to ensure that only the
+ system can bind to it.
+ <p>Protection level: signature
+ @SystemApi
+ @hide
+ -->
+ <permission android:name="android.permission.BIND_GBA_SERVICE"
+ android:protectionLevel="signature" />
+
<!-- ================================== -->
<!-- Permissions for sdcard interaction -->
<!-- ================================== -->
@@ -2714,6 +2732,10 @@
<permission android:name="android.permission.TOGGLE_AUTOMOTIVE_PROJECTION"
android:protectionLevel="signature|privileged" />
+ <!-- Allows an app to prevent non-system-overlay windows from being drawn on top of it -->
+ <permission android:name="android.permission.HIDE_OVERLAY_WINDOWS"
+ android:protectionLevel="normal" />
+
<!-- ================================== -->
<!-- Permissions affecting the system wallpaper -->
<!-- ================================== -->
@@ -3268,6 +3290,7 @@
{@link android.view.WindowManager.LayoutsParams#SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS}
to hide non-system-overlay windows.
<p>Not for use by third-party applications.
+ @deprecated Use {@link android.Manifest.permission#HIDE_OVERLAY_WINDOWS} instead
@hide
-->
<permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"
@@ -3946,6 +3969,12 @@
<permission android:name="android.permission.MANAGE_COMPANION_DEVICES"
android:protectionLevel="signature" />
+ <!-- Allows an application to subscribe to notifications about the presence status change
+ of their associated companion device
+ -->
+ <permission android:name="android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE"
+ android:protectionLevel="normal" />
+
<!-- @SystemApi Allows an application to use SurfaceFlinger's low level features.
<p>Not for use by third-party applications.
@hide
@@ -3953,6 +3982,14 @@
<permission android:name="android.permission.ACCESS_SURFACE_FLINGER"
android:protectionLevel="signature" />
+ <!-- @SystemApi Allows an application to rotate a surface by arbitrary degree.
+ This is a sub-feature of ACCESS_SURFACE_FLINGER and can be granted in a more concrete way.
+ <p>Not for use by third-party applications.
+ @hide
+ -->
+ <permission android:name="android.permission.ROTATE_SURFACE_FLINGER"
+ android:protectionLevel="signature|recents" />
+
<!-- Allows an application to take screen shots and more generally
get access to the frame buffer data.
<p>Not for use by third-party applications.
@@ -4615,7 +4652,7 @@
<!-- Allows access to keyguard secure storage. Only allowed for system processes.
@hide -->
<permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE"
- android:protectionLevel="signature" />
+ android:protectionLevel="signature|setup" />
<!-- Allows applications to set the initial lockscreen state.
<p>Not for use by third-party applications. @hide -->
diff --git a/core/res/OWNERS b/core/res/OWNERS
new file mode 100644
index 0000000..263d638
--- /dev/null
+++ b/core/res/OWNERS
@@ -0,0 +1,17 @@
+adamp@google.com
+alanv@google.com
+dsandler@android.com
+dsandler@google.com
+hackbod@android.com
+hackbod@google.com
+jsharkey@android.com
+jsharkey@google.com
+michaelwr@google.com
+nandana@google.com
+narayan@google.com
+ogunwale@google.com
+patb@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
+toddke@google.com
+yamasani@google.com
diff --git a/core/res/res/drawable-car/car_button_background.xml b/core/res/res/drawable-car/car_button_background.xml
index 3e2610c..e568aeb 100644
--- a/core/res/res/drawable-car/car_button_background.xml
+++ b/core/res/res/drawable-car/car_button_background.xml
@@ -13,24 +13,48 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!-- Default background styles for car buttons when enabled/disabled. -->
-<ripple
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:color="?android:attr/colorControlHighlight">
+<!-- Default background styles for car buttons when enabled/disabled,
+ focused/unfocused, and pressed/unpressed -->
+<!-- TODO(b/175161842) Add rotary fill color -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:state_enabled="false">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="@*android:color/car_grey_300"/>
+ <stroke android:width="8dp"
+ android:color="#0059B3"/>
+ </shape>
+ </item>
+ <item android:state_focused="true" android:state_pressed="true">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="?android:attr/colorButtonNormal"/>
+ <stroke android:width="4dp"
+ android:color="#0059B3"/>
+ </shape>
+ </item>
+ <item android:state_focused="true">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="?android:attr/colorButtonNormal"/>
+ <stroke android:width="8dp"
+ android:color="#0059B3"/>
+ </shape>
+ </item>
+ <item android:state_enabled="false">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="@*android:color/car_grey_300"/>
+ </shape>
+ </item>
<item>
- <selector>
- <item android:state_enabled="false">
- <shape android:shape="rectangle">
- <corners android:radius="@*android:dimen/car_button_radius"/>
- <solid android:color="@*android:color/car_grey_300"/>
- </shape>
- </item>
+ <ripple android:color="?android:attr/colorControlHighlight">
<item>
<shape android:shape="rectangle">
<corners android:radius="@*android:dimen/car_button_radius"/>
<solid android:color="?android:attr/colorButtonNormal"/>
</shape>
</item>
- </selector>
+ </ripple>
</item>
-</ripple>
+</selector>
diff --git a/core/res/res/drawable-car/car_switch_thumb.xml b/core/res/res/drawable-car/car_switch_thumb.xml
index 03efc18..66cf443 100644
--- a/core/res/res/drawable-car/car_switch_thumb.xml
+++ b/core/res/res/drawable-car/car_switch_thumb.xml
@@ -14,12 +14,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<shape
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval">
- <solid android:color="@color/car_switch"/>
- <size
- android:width="@dimen/car_seekbar_thumb_size"
- android:height="@dimen/car_seekbar_thumb_size"/>
-</shape>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:gravity="center_vertical|fill_horizontal"
+ android:top="@dimen/car_switch_thumb_margin_size"
+ android:bottom="@dimen/car_switch_thumb_margin_size">
+ <shape android:shape="oval">
+ <solid android:color="@color/car_switch"/>
+ <size
+ android:width="@dimen/car_switch_thumb_size"
+ android:height="@dimen/car_switch_thumb_size"/>
+ </shape>
+ </item>
+</layer-list>
diff --git a/core/res/res/drawable-car/car_switch_track.xml b/core/res/res/drawable-car/car_switch_track.xml
new file mode 100644
index 0000000..cb0b9be
--- /dev/null
+++ b/core/res/res/drawable-car/car_switch_track.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2020 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.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:height="@dimen/car_touch_target_size_minus_one"
+ android:width="@dimen/car_touch_target_size_minus_one"
+ android:gravity="center">
+ <selector>
+ <item android:state_focused="true" android:state_pressed="true">
+ <shape android:shape="oval">
+ <solid android:color="#8A94CBFF"/>
+ <stroke android:width="4dp"
+ android:color="#94CBFF"/>
+ </shape>
+ </item>
+ <item android:state_focused="true">
+ <shape android:shape="oval">
+ <solid android:color="#3D94CBFF"/>
+ <stroke android:width="8dp"
+ android:color="#94CBFF"/>
+ </shape>
+ </item>
+ </selector>
+ </item>
+ <item android:gravity="center_vertical|fill_horizontal"
+ android:left="@dimen/car_switch_track_margin_size"
+ android:right="@dimen/car_switch_track_margin_size">
+ <shape
+ android:shape="rectangle"
+ android:tint="@color/switch_track_material">
+ <corners android:radius="7dp" />
+ <solid android:color="@color/white_disabled_material" />
+ <size android:height="14dp" />
+ <padding
+ android:right="@dimen/car_switch_track_margin_size"
+ android:left="@dimen/car_switch_track_margin_size"/>
+ </shape>
+ </item>
+</layer-list>
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 171d896..d41acda 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-diens"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensorkennisgewingdiens"</string>
<string name="twilight_service" msgid="8964898045693187224">"Skemerdiens"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Tydsonebespeurder (geen konnektiwiteit nie)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Jou toestel sal uitgevee word"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Die administrasieprogram kan nie gebruik word nie. Jou toestel sal nou uitgevee word.\n\nKontak jou organisasie se administrateur as jy vrae het."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Druk is gedeaktiveer deur <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-verbinding"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Program loop tans"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Programme wat batterykrag gebruik"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Vergroting"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> gebruik tans batterykrag"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> programme gebruik tans batterykrag"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Tik vir besonderhede oor battery- en datagebruik"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nuut: Venstervergrootglas"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Jy kan nou jou hele skerm of \'n deel daarvan vergroot"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Skakel aan in Instellings"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Maak toe"</string>
</resources>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 5871fe2..fe45f9e 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS አገልግሎት"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"የዳሳሽ ማሳወቂያ አገልግሎት"</string>
<string name="twilight_service" msgid="8964898045693187224">"የውጋገን አገልግሎት"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"የሰዓት ሰቅ አንባቢ (ግንኙነት የለም)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"የእርስዎ መሣሪያ ይደመሰሳል"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"የአስተዳዳሪ መተግበሪያ ስራ ላይ ሊውል አይችልም። የእርስዎን መሣሪያ አሁን ይደመሰሳል።\n\nጥያቄዎች ካለዎት የድርጅትዎን አስተዳዳሪ ያነጋግሩ።"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"ማተም በ<xliff:g id="OWNER_APP">%s</xliff:g> ተሰናክሏል።"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"የዩኤስቢ ግንኙነት"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"APP እየሠራ ነው"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ባትሪ በመፍጀት ላይ ያሉ መተግበሪያዎች"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ማጉላት"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ባትሪ እየተጠቀመ ነው"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> መተግበሪያዎች ባትሪ እየተጠቀሙ ነው"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"በባትሪ እና ውሂብ አጠቃቀም ላይ ዝርዝሮችን ለማግኘት መታ ያድርጉ"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"አዲስ፦ የመስኮት ማጉያ"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"አሁን የተወሰነ ወይም ሁሉንም ማያ ገጽዎን ማጉላት ይችላሉ"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"በቅንብሮች ውስጥ ያብሩ"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"አሰናብት"</string>
</resources>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index b578769..89c4fea 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -207,6 +207,7 @@
<string name="gnss_service" msgid="8907781262179951385">"خدمة GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"خدمة إشعارات جهاز الاستشعار"</string>
<string name="twilight_service" msgid="8964898045693187224">"خدمة الغسق"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"أداة التعرّف على المنطقة الزمنية (ليس هناك حاجة للاتصال بالشبكة)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"سيتم محو بيانات جهازك."</string>
<string name="factory_reset_message" msgid="2657049595153992213">"تعذّر استخدام تطبيق المشرف. سيتم محو بيانات جهازك الآن.\n\nإذا كانت لديك أسئلة، اتصل بمشرف مؤسستك."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"تم إيقاف الطباعة بواسطة <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -299,8 +300,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"اتصال USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"التطبيق قيد التشغيل"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"التطبيقات التي تستهلك البطارية"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"التكبير"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"يستخدم تطبيق <xliff:g id="APP_NAME">%1$s</xliff:g> البطارية"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"تستخدم <xliff:g id="NUMBER">%1$d</xliff:g> من التطبيقات البطارية"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"انقر للحصول على تفاصيل حول البطارية واستخدام البيانات"</string>
@@ -2326,12 +2326,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"جديد: Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"يمكنك الآن تكبير الشاشة كلها أو جزء منها."</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"التفعيل من خلال \"الإعدادات\""</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"إغلاق"</string>
</resources>
diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml
index f1b0d84..7dac9a2 100644
--- a/core/res/res/values-as/strings.xml
+++ b/core/res/res/values-as/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS সেৱা"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"ছেন্সৰ জাননী সেৱা"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight সেৱা"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"সময় মণ্ডল চিনাক্তকাৰী (সংযোগ নাই)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"আপোনাৰ ডিভাইচৰ ডেটা মচা হ\'ব"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"এই প্ৰশাসক এপটো ব্যৱহাৰ কৰিব নোৱাৰি। এতিয়া আপোনাৰ ডিভাইচটোৰ ডেটা মচা হ\'ব।\n\nআপোনাৰ কিবা প্ৰশ্ন থাকিলে আপোনাৰ প্ৰতিষ্ঠানৰ প্ৰশাসকৰ সৈতে যোগাযোগ কৰক।"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"প্ৰিণ্ট কৰা কাৰ্য <xliff:g id="OWNER_APP">%s</xliff:g>এ অক্ষম কৰি ৰাখিছে।"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"ইউএছবি সংযোগ"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"এপ্ চলি আছে"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"বেটাৰি খৰচ কৰা এপসমূহ"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"বিবৰ্ধন"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g>এ বেটাৰি ব্যৱহাৰ কৰি আছে"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g>টা এপে বেটাৰি ব্যৱহাৰ কৰি আছে"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"বেটাৰি আৰু ডেটাৰ ব্যৱহাৰৰ বিষয়ে বিশদভাৱে জানিবলৈ টিপক"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"নতুন: ৱিণ্ড’ বিৱৰ্ধক"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"আপুনি সকলো অথবা কেইখনমান স্ক্ৰীন বিবৰ্ধন কৰিব পাৰে"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"ছেটিঙত অন কৰক"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"অগ্ৰাহ্য কৰক"</string>
</resources>
diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml
index 01fb48e..9fdc754 100644
--- a/core/res/res/values-az/strings.xml
+++ b/core/res/res/values-az/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS Xidməti"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Bildiriş Xidməti"</string>
<string name="twilight_service" msgid="8964898045693187224">"Alaqaranlıq Xidməti"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Saat Qurşağı Aşkarlayıcısı (Bağlantı yoxdur)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Cihazınız təmizlənəcəkdir"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Admin tətbiqini istifadə etmək mümkün deyil. Cihaz indi təmizlənəcək.\n\nSualınız varsa, təşkilatın admini ilə əlaqə saxlayın."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Çap <xliff:g id="OWNER_APP">%s</xliff:g> tərəfindən deaktiv edildi."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB əlaqə"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Tətbiq işləyir"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Batareyadan istifadə edən tətbiqlər"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Böyütmə"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> batareyadan istifadə edir"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> tətbiq batareyadan istifadə edir"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Batareya və data istifadəsi haqqında ətraflı məlumat üçün klikləyin"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Yeni: Pəncərə Böyüdücüsü"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"İndi ekranı qismən və ya tam şəkildə böyüdə bilərsiniz"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Ayarlarda aktiv edin"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Qapadın"</string>
</resources>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index bfbd3e4..3be770c 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS usluga"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Usluga obaveštenja senzora"</string>
<string name="twilight_service" msgid="8964898045693187224">"Usluga Sumrak"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detektor vremenske zone (nema internet veze)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Uređaj će biti obrisan"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Ne možete da koristite ovu aplikaciju za administratore. Uređaj će sada biti obrisan.\n\nAko imate pitanja, kontaktirajte administratora organizacije."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Štampanje je onemogućila aplikacija <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB veza"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aktivna aplikacija"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikacije koje troše bateriju"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Uvećanje"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> koristi bateriju"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Aplikacije (<xliff:g id="NUMBER">%1$d</xliff:g>) koriste bateriju"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Dodirnite za detalje o bateriji i potrošnji podataka"</string>
@@ -932,7 +932,7 @@
<string name="granularity_label_link" msgid="9007852307112046526">"link"</string>
<string name="granularity_label_line" msgid="376204904280620221">"red"</string>
<string name="factorytest_failed" msgid="3190979160945298006">"Fabričko testiranje nije uspelo"</string>
- <string name="factorytest_not_system" msgid="5658160199925519869">"Radnja FACTORY_TEST je podržana samo za pakete instalirane u direktorijumu /system/app."</string>
+ <string name="factorytest_not_system" msgid="5658160199925519869">"Radnja FACTORY_TEST je podržana samo za pakete instalirane u folderu /system/app."</string>
<string name="factorytest_no_action" msgid="339252838115675515">"Nije pronađen nijedan paket koji obezbeđuje radnju FACTORY_TEST."</string>
<string name="factorytest_reboot" msgid="2050147445567257365">"Restartuj"</string>
<string name="js_dialog_title" msgid="7464775045615023241">"Na stranici na adresi „<xliff:g id="TITLE">%s</xliff:g>“ piše:"</string>
@@ -2048,7 +2048,7 @@
<string name="battery_saver_charged_notification_summary" product="default" msgid="5544457317418624367">"Baterija telefona je dovoljno napunjena. Funkcije više nisu ograničene."</string>
<string name="battery_saver_charged_notification_summary" product="tablet" msgid="4426317048139996888">"Baterija tableta je dovoljno napunjena. Funkcije više nisu ograničene."</string>
<string name="battery_saver_charged_notification_summary" product="device" msgid="1031562417867646649">"Baterija uređaja je dovoljno napunjena. Funkcije više nisu ograničene."</string>
- <string name="mime_type_folder" msgid="2203536499348787650">"Direktorijum"</string>
+ <string name="mime_type_folder" msgid="2203536499348787650">"Folder"</string>
<string name="mime_type_apk" msgid="3168784749499623902">"Android aplikacija"</string>
<string name="mime_type_generic" msgid="4606589110116560228">"Datoteka"</string>
<string name="mime_type_generic_ext" msgid="9220220924380909486">"<xliff:g id="EXTENSION">%1$s</xliff:g> datoteka"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Novo: Lupa za prozor"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Možete da uvećate deo ekrana ili ceo ekran"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Uključite u Podešavanjima"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Odbaci"</string>
</resources>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index c4a3a7e..fc2849e 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Служба GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Служба апавяшчэнняў датчыка"</string>
<string name="twilight_service" msgid="8964898045693187224">"Служба Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Дэтэктар часавога пояса (няма падключэння)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Даныя вашай прылады будуць сцерты"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Немагчыма выкарыстоўваць праграму адміністравання. Звесткі на вашай прыладзе будуць выдалены.\n\nКалі ў вас ёсць пытанні, звярніцеся да адміністратара арганізацыі."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Друк адключаны ўладальнікам праграмы <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Падключэнне USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Праграма працуе"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Праграмы, якія выкарыстоўваюць акумулятар"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Павелічэнне"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> выкарыстоўвае акумулятар"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Наступная колькасць праграм выкарыстоўваюць акумулятар: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Дакраніцеся, каб даведацца пра выкарыстанне трафіка і акумулятара"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Новая функцыя Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Цяпер можна павялічваць увесь экран ці яго частку."</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Уключыць у Наладах"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Адхіліць"</string>
</resources>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 07f1ce7..a6321f5 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Услуга за GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Услуга за известия за сензорите"</string>
<string name="twilight_service" msgid="8964898045693187224">"Услуга Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Инструмент за установяване на часовата зона (няма връзка)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Данните на устройството ви ще бъдат изтрити"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Приложението за администриране не може да се използва. Сега данните на устройството ви ще бъдат изтрити.\n\nАко имате въпроси, свържете се с администратора на организацията си."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Отпечатването е деактивиранo от <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB връзка"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Приложението работи"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Приложения, използващи батерията"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Увеличение"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> използва батерията"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> приложения използват батерията"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Докоснете за информация относно използването на батерията и преноса на данни"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Ново: Увеличаване на прозорци"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Можете да увеличите целия екран или част от него"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Включете от настройките"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Отхвърляне"</string>
</resources>
diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml
index 9b85fc7..269d2c7 100644
--- a/core/res/res/values-bn/strings.xml
+++ b/core/res/res/values-bn/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS পরিষেবা"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"সেন্সর বিজ্ঞপ্তি পরিষেবা"</string>
<string name="twilight_service" msgid="8964898045693187224">"গোধূলি পরিষেবা"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"টাইম জোন ডিটেক্টর (কানেকশন নেই)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"আপনার ডিভাইসটি মুছে ফেলা হবে"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"অ্যাডমিন অ্যাপটি ব্যবহার করা যাবে না। আপনার ডিভাইসে থাকা সবকিছু এখন মুছে ফেলা হবে।\n\nকোনও প্রশ্ন থাকলে আপনার প্রতিষ্ঠানের অ্যাডমিনের সাথে যোগাযোগ করুন।"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> প্রিন্টিং বন্ধ রেখেছে।"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB সংযোগ"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"অ্যাপ চলছে"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"কিছু অ্যাপ ব্যাটারি ব্যবহার করছে"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"বড় করে দেখুন"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> অ্যাপটি ব্যাটারি ব্যবহার করছে"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g>টি অ্যাপ ব্যাটারি ব্যবহার করছে"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ব্যাটারি এবং ডেটার ব্যবহারের বিশদ বিবরণের জন্য ট্যাপ করুন"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"নতুন: উইন্ডো ম্যাগনিফায়ার"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"এখন আপনি কিছু বা সবকটি স্ক্রিন বড় করে দেখতে পারেন"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"সেটিংস থেকে চালু করুন"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"বাতিল করুন"</string>
</resources>
diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml
index 3d2249b..6ecad70 100644
--- a/core/res/res/values-bs/strings.xml
+++ b/core/res/res/values-bs/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Usluga GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Usluga obavještavanja putem senzora"</string>
<string name="twilight_service" msgid="8964898045693187224">"Usluga Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detektor vremenske zone (nije povezan)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Uređaj će biti izbrisan"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Nije moguće koristiti aplikaciju administratora. Potpuno će se izbrisati podaci na vašem uređaju.\n\nAko imate pitanja, obratite se administratoru svoje organizacije."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Štampanje je onemogućila aplikacija <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB veza"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Pokrenuta aplikacija"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikacije koje troše bateriju"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Uvećavanje"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g> troši bateriju"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Broj aplikacija koje troše bateriju: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Dodirnite za detalje o potrošnji baterije i prijenosa podataka"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Novo: povećalo prozora"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Sada možete uvećati dio ekrana ili cijeli ekran"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Uključite u Postavkama"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Odbaci"</string>
</resources>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index f1845e3..c72ca74 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Servei GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Servei de notificacions de sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Servei Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector de zona horària (sense connectivitat)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"El contingut del dispositiu s\'esborrarà"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"No es pot utilitzar l\'aplicació d\'administració. S\'esborraran les dades del dispositiu.\n\nSi tens cap dubte, contacta amb l\'administrador de la teva organització."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ha desactivat la impressió."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Connexió USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplicació en execució"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplicacions que consumeixen bateria"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Ampliació"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> està consumint bateria"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplicacions estan consumint bateria"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Toca per obtenir informació sobre l\'ús de dades i de bateria"</string>
@@ -1800,8 +1800,8 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Actualitzat per l\'administrador"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Suprimit per l\'administrador"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"D\'acord"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Per allargar la durada de la bateria, la funció Estalvi de bateria fa el següent:\n\n• Activa el tema fosc.\n• Desactiva o restringeix l\'activitat en segon pla, alguns efectes visuals i altres funcions com \"Ok Google\".\n\n"<annotation id="url">"Més informació"</annotation></string>
- <string name="battery_saver_description" msgid="6794188153647295212">"Per allargar la durada de la bateria, la funció Estalvi de bateria fa el següent:\n\n• Activa el tema fosc.\n• Desactiva o restringeix l\'activitat en segon pla, alguns efectes visuals i altres funcions com \"Ok Google\"."</string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Per allargar la durada de la bateria, la funció Estalvi de bateria:\n\n• Activa el tema fosc.\n• Desactiva o restringeix l\'activitat en segon pla, alguns efectes visuals i altres funcions com \"Ok Google\".\n\n"<annotation id="url">"Més informació"</annotation></string>
+ <string name="battery_saver_description" msgid="6794188153647295212">"Per allargar la durada de la bateria, la funció Estalvi de bateria:\n\n• Activa el tema fosc.\n• Desactiva o restringeix l\'activitat en segon pla, alguns efectes visuals i altres funcions com \"Ok Google\"."</string>
<string name="data_saver_description" msgid="4995164271550590517">"Per reduir l\'ús de dades, la funció Economitzador de dades evita que determinades aplicacions enviïn o rebin dades en segon pla. L\'aplicació que estiguis fent servir podrà accedir a les dades, però menys sovint. Això vol dir, per exemple, que les imatges no es mostraran fins que no les toquis."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Activar l\'Economitzador de dades?"</string>
<string name="data_saver_enable_button" msgid="4399405762586419726">"Activa"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Novetat: Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Ara pots ampliar la pantalla completa o una part"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Activa a Configuració"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Ignora"</string>
</resources>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index 42d5636..8174a6e 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Služba GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Služba oznámení ze senzoru"</string>
<string name="twilight_service" msgid="8964898045693187224">"Služba detekce soumraku"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detektor časového pásma (bez připojení)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Zařízení bude vymazáno"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Aplikaci pro správu nelze použít. Zařízení teď bude vymazáno.\n\nV případě dotazů vám pomůže administrátor organizace."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Aplikace <xliff:g id="OWNER_APP">%s</xliff:g> tisk zakazuje."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Připojení USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplikace je spuštěna"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikace spotřebovávají baterii"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Zvětšení"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Aplikace <xliff:g id="APP_NAME">%1$s</xliff:g> využívá baterii"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Aplikace (<xliff:g id="NUMBER">%1$d</xliff:g>) využívají baterii"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Klepnutím zobrazíte podrobnosti o využití baterie a dat"</string>
@@ -1282,7 +1282,7 @@
<string name="volume_icon_description_notification" msgid="579091344110747279">"Hlasitost oznámení"</string>
<string name="ringtone_default" msgid="9118299121288174597">"Výchozí vyzvánění"</string>
<string name="ringtone_default_with_actual" msgid="2709686194556159773">"Výchozí (<xliff:g id="ACTUAL_RINGTONE">%1$s</xliff:g>)"</string>
- <string name="ringtone_silent" msgid="397111123930141876">"Žádný"</string>
+ <string name="ringtone_silent" msgid="397111123930141876">"Žádné"</string>
<string name="ringtone_picker_title" msgid="667342618626068253">"Vyzvánění"</string>
<string name="ringtone_picker_title_alarm" msgid="7438934548339024767">"Zvuky budíku"</string>
<string name="ringtone_picker_title_notification" msgid="6387191794719608122">"Zvuky upozornění"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Novinka: Zvětšení oken"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Nyní můžete zvětšit celou obrazovku nebo její část"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Zapnout v Nastavení"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Zavřít"</string>
</resources>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 0487406..0bd9657 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-tjeneste"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Tjenesten Sensor Notification"</string>
<string name="twilight_service" msgid="8964898045693187224">"Tjenesten Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Tidszoneregistrering (ingen forbindelse)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Enheden slettes"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Administrationsappen kan ikke bruges. Enheden vil nu blive ryddet. \n\nKontakt din organisations administrator, hvis du har spørgsmål."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Udskrivning er deaktiveret af <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-forbindelse"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Appen kører"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Apps, der bruger batteri"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Forstørrelse"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> bruger batteri"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> apps bruger batteri"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Tryk for at se info om batteri- og dataforbrug"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nyhed: Forstørrelse af vindue"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Du kan nu forstørre dele af eller hele skærmen"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Aktivér i Indstillinger"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Luk"</string>
</resources>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index ebbde3c..b51ce5d 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-Dienst"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Zeitzonen-Erkennung (keine Verbindung)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Die Daten auf deinem Gerät werden gelöscht."</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Die Admin-App kann nicht verwendet werden. Die Daten auf deinem Gerät werden nun gelöscht.\n\nBitte wende dich bei Fragen an den Administrator deiner Organisation."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Drucken wurde von <xliff:g id="OWNER_APP">%s</xliff:g> deaktiviert."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-Verbindung"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"App wird ausgeführt"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Strom verbrauchende Apps"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Vergrößerung"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> verbraucht Strom"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> Apps verbrauchen Strom"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Für Details zur Akku- und Datennutzung tippen"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Neu: Fenstervergrößerung"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Du kannst das Display teilweise oder ganz vergrößern"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"In den Einstellungen aktivieren"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Schließen"</string>
</resources>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 306d36e..a794e48 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Υπηρεσία GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Υπηρεσία ειδοποίησης αισθητήρα"</string>
<string name="twilight_service" msgid="8964898045693187224">"Υπηρεσία Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Εντοπισμός ζώνης ώρας (χωρίς συνδεσιμότητα)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Η συσκευή σας θα διαγραφεί"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Δεν είναι δυνατή η χρήση της εφαρμογής διαχειριστή. Η συσκευή σας θα διαγραφεί.\n\nΕάν έχετε ερωτήσεις, επικοινωνήστε με τον διαχειριστή του οργανισμού σας."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Η εκτύπωση απενεργοποιήθηκε από τον χρήστη <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Σύνδεση USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Η εφαρμογή εκτελείται"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Εφαρμογές που καταναλώνουν μπαταρία"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Μεγιστοποίηση"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Η εφαρμογή <xliff:g id="APP_NAME">%1$s</xliff:g> χρησιμοποιεί μπαταρία"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> εφαρμογές χρησιμοποιούν μπαταρία"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Πατήστε για λεπτομέρειες σχετικά με τη χρήση μπαταρίας και δεδομένων"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Νέο: Μεγέθυνση παραθύρου"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Μεγεθύνετε μέρος ή ολόκληρη την οθόνη σας"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Ενεργοποίηση στις Ρυθμίσεις"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Παράβλεψη"</string>
</resources>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index a8706cb..74b835e 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS service"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Time zone detector (no connectivity)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Your device will be erased"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"The admin app can\'t be used. Your device will now be erased.\n\nIf you have questions, contact your organisation\'s admin."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Printing disabled by <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index 57e2eae..8f8972c 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS service"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Time zone detector (no connectivity)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Your device will be erased"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"The admin app can\'t be used. Your device will now be erased.\n\nIf you have questions, contact your organisation\'s admin."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Printing disabled by <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 33ffbe3..2421e2a 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS service"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Time zone detector (no connectivity)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Your device will be erased"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"The admin app can\'t be used. Your device will now be erased.\n\nIf you have questions, contact your organisation\'s admin."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Printing disabled by <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index f5be6fd..dd7b151 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS service"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Time zone detector (no connectivity)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Your device will be erased"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"The admin app can\'t be used. Your device will now be erased.\n\nIf you have questions, contact your organisation\'s admin."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Printing disabled by <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index cd3ff36..0e14345 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS Service"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Time Zone Detector (No connectivity)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Your device will be erased"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"The admin app can\'t be used. Your device will now be erased.\n\nIf you have questions, contact your organization\'s admin."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Printing disabled by <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 2d521b3..780e481 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Servicio de Sistemas Globales de Navegación por Satélites (GNSS)"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Servicio de notificaciones del sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Servicio de Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector de zona horaria (sin conexión)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Se borrarán los datos del dispositivo"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"No se puede usar la app de administrador. Ahora se borrará tu dispositivo.\n\nSi tienes preguntas, comunícate con el administrador de tu organización."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> inhabilitó la impresión."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Conexión USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"App en ejecución"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Apps que consumen batería"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Ampliación"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> está consumiendo batería"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> apps están consumiendo batería"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Presiona para obtener información sobre el uso de datos y de la batería"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nueva: Ampliación de ventanas"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Puedes ampliar toda tu pantalla o parte de ella"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Activar en Configuración"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Descartar"</string>
</resources>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index abc6946..3c6b9e2 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Servicio GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Servicio de notificación de sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Servicio de Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector de zona horaria (sin conexión)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Tu dispositivo se borrará"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"No se puede utilizar la aplicación de administración. Se borrarán todos los datos del dispositivo.\n\nSi tienes alguna pregunta, ponte en contacto con el administrador de tu organización."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ha inhabilitado la impresión."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Conexión USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplicación en ejecución"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplicaciones que consumen batería"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Ampliación"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> está usando la batería"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplicaciones están usando la batería"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Toca para ver información detallada sobre el uso de datos y de la batería"</string>
@@ -832,7 +832,7 @@
<string name="keyguard_password_enter_pin_password_code" msgid="7792964196473964340">"Introduce el código PIN para desbloquear."</string>
<string name="keyguard_password_wrong_pin_code" msgid="8583732939138432793">"Código PIN incorrecto"</string>
<string name="keyguard_label_text" msgid="3841953694564168384">"Para desbloquear el teléfono, pulsa la tecla de menú y, a continuación, pulsa 0."</string>
- <string name="emergency_call_dialog_number_for_display" msgid="2978165477085612673">"Llamada de emergencia"</string>
+ <string name="emergency_call_dialog_number_for_display" msgid="2978165477085612673">"Número de emergencia"</string>
<string name="lockscreen_carrier_default" msgid="6192313772955399160">"Sin servicio"</string>
<string name="lockscreen_screen_locked" msgid="7364905540516041817">"Pantalla bloqueada"</string>
<string name="lockscreen_instructions_when_pattern_enabled" msgid="7982445492532123308">"Pulsa la tecla de menú para desbloquear el teléfono o realizar una llamada de emergencia."</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nuevo: Lupa de ventanas"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Ahora puedes ampliar toda la pantalla o una parte"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Activar en Ajustes"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Cerrar"</string>
</resources>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 130ef6e..152a35e 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-teenus"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Anduri märguande teenus"</string>
<string name="twilight_service" msgid="8964898045693187224">"Teenus Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Ajavööndi tuvastaja (ühenduvus puudub)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Seade kustutatakse"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Administraatori rakendust ei saa kasutada. Teie seade tühjendatakse nüüd.\n\nKui teil on küsimusi, võtke ühendust organisatsiooni administraatoriga."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Rakendus <xliff:g id="OWNER_APP">%s</xliff:g> on printimise keelanud."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-ühendus"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Rakendus töötab"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Rakendused kasutavad akutoidet"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Suurendus"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> kasutab akutoidet"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> rakendust kasutab akutoidet"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Aku ja andmekasutuse üksikasjade nägemiseks puudutage"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Uus: akna suurendaja"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Nüüd saab suurendada kogu ekraanikuva või osa sellest"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Lülitage sisse menüüs Seaded"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Loobu"</string>
</resources>
diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml
index 5273a48..4fa4d06 100644
--- a/core/res/res/values-eu/strings.xml
+++ b/core/res/res/values-eu/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS zerbitzua"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sentsorearen jakinarazpen-zerbitzua"</string>
<string name="twilight_service" msgid="8964898045693187224">"Ilunabarreko zerbitzua"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Ordu-zonaren hautemailea (ez zaude konektatuta sarera)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Gailuko datuak ezabatu egingo dira"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Ezin da erabili administratzeko aplikazioa. Ezabatu egingo da gailuko eduki guztia.\n\nZalantzarik baduzu, jarri erakundeko administratzailearekin harremanetan."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> aplikazioak desgaitu egin du inprimatzeko aukera."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB konexioa"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplikazio bat abian da"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Bateria kontsumitzen ari diren aplikazioak"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Lupa"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ari da bateria erabiltzen"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplikazio ari dira bateria erabiltzen"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Sakatu bateria eta datuen erabilerari buruzko xehetasunak ikusteko"</string>
@@ -500,7 +500,7 @@
<string name="permdesc_changeNetworkState" msgid="649341947816898736">"Sarearen konexioaren egoera aldatzeko baimena ematen die aplikazioei."</string>
<string name="permlab_changeTetherState" msgid="9079611809931863861">"aldatu telefono bidezko konektagarritasuna"</string>
<string name="permdesc_changeTetherState" msgid="3025129606422533085">"Partekatutako Interneterako konexioaren egoera aldatzeko baimena ematen die aplikazioei."</string>
- <string name="permlab_accessWifiState" msgid="5552488500317911052">"ikusi wifi bidezko konexioak"</string>
+ <string name="permlab_accessWifiState" msgid="5552488500317911052">"ikusi wifi-konexioak"</string>
<string name="permdesc_accessWifiState" msgid="6913641669259483363">"Wi-Fi sareei buruzko informazioa ikusteko baimena ematen die aplikazioei, adibidez, Wi-Fi konexioa aktibatuta dagoen eta konektatutako Wi-Fi gailuen izenak zein diren."</string>
<string name="permlab_changeWifiState" msgid="7947824109713181554">"konektatu wifira edo deskonektatu bertatik"</string>
<string name="permdesc_changeWifiState" msgid="7170350070554505384">"Wi-Fi sarbide-puntuetara konektatzeko edo haietatik deskonektatzeko baimena ematen die aplikazioei, baita Wi-Fi sareen gailu-konfigurazioari aldaketak egitekoa ere."</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Berria: leihoen lupa"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Orain, pantaila osoa edo haren zati bat handi dezakezu"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Aktibatu ezarpenetan"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Baztertu"</string>
</resources>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 7596bab..9efe16b 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"سرویس GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"سرویس اعلان حسگر"</string>
<string name="twilight_service" msgid="8964898045693187224">"سرویس Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"شناساگر منطقه زمانی (بدون اتصال)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"دستگاهتان پاک خواهد شد"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"برنامه سرپرست سیستم را نمیتوان استفاده کرد. دستگاه شما در این لحظه پاک میشود.\n\nاگر سؤالی دارید، با سرپرست سیستم سازمانتان تماس بگیرید."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> چاپ کردن را غیرفعال کرده است."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"اتصال USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"برنامه درحال اجرا"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"برنامههای مصرفکننده باتری"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"درشتنمایی"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> درحال استفاده کردن از باتری است"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> برنامه درحال استفاده کردن از باتری هستند"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"برای جزئیات مربوط به مصرف باتری و داده، ضربه بزنید"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"جدید: Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"اکنون میتوانید بخشی از صفحه یا کل آن را درشت کنید"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"روشن کردن در «تنظیمات»"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"رد شدن"</string>
</resources>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index d337315..80c8ebe 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-palvelu"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Anturin ilmoituspalvelu"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight-palvelu"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Aikavyöhykkeen tunnistin (ei yhteyttä)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Laitteen tiedot poistetaan"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Hallintasovellusta ei voi käyttää. Laitteen tiedot pyyhitään.\n\nPyydä ohjeita järjestelmänvalvojaltasi."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> on poistanut tulostuksen käytöstä."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-yhteys"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Sovellus käynnissä"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Akkua kuluttavat sovellukset"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Suurennus"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> käyttää akkua."</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> sovellusta käyttää akkua."</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Katso lisätietoja akun ja datan käytöstä napauttamalla."</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Uutta: ikkunan suurennus"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Voit nyt suurentaa näytön osittain tai kokonaan"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Laita päälle asetuksista"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Hylkää"</string>
</resources>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index d2c89bc..8bc6d37 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Service GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Service de notification de capteur"</string>
<string name="twilight_service" msgid="8964898045693187224">"Service de crépuscule"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Détecteur de fuseau horaire (aucune connectivité)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Le contenu de votre appareil sera effacé"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Impossible d\'utiliser l\'application d\'administration. Les données de votre appareil vont maintenant être effacées.\n\nSi vous avez des questions, communiquez avec l\'administrateur de votre organisation."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Impression désactivée par <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Connexion USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Application en cours d\'exécution"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Applications qui sollicitent la pile"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Agrandissement"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> sollicite la pile"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> applications sollicitent la pile"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Touchez pour afficher des détails sur l\'utilisation de la pile et des données"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nouveauté : Loupe de fenêtre"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Vous pouvez agrandir une partie ou la totalité de votre écran"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Activer dans les paramètres"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Fermer"</string>
</resources>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 1992068..7d5e10b 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Service GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Service de notification du capteur"</string>
<string name="twilight_service" msgid="8964898045693187224">"Service Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Outil de détection du fuseau horaire (aucune connectivité)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Les données de votre appareil vont être effacées"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Impossible d\'utiliser l\'application d\'administration. Les données de votre appareil vont maintenant être effacées.\n\nSi vous avez des questions, contactez l\'administrateur de votre organisation."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Impression désactivée par <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Connexion USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Application en cours d\'exécution"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Applications utilisant la batterie"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Agrandissement"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> utilise la batterie"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> applications utilisent la batterie"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Appuyer pour obtenir des informations sur l\'utilisation de la batterie et des données"</string>
@@ -1823,7 +1823,7 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Mis à jour par votre administrateur"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Supprimé par votre administrateur"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"OK"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Pour prolonger l\'autonomie de la batterie, l\'économiseur de batterie :\n\n·• active le thème sombre ;\n·• désactive ou restreint les activités en arrière-plan, certains effets visuels et d\'autres fonctionnalités, comme \"Hey Google\".\n\n"<annotation id="url">"En savoir plus"</annotation></string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Pour prolonger l\'autonomie de la batterie, l\'économiseur de batterie :\n\n • active le thème sombre ;\n • désactive ou restreint les activités en arrière-plan, certains effets visuels et d\'autres fonctionnalités, comme \"Hey Google\".\n\n"<annotation id="url">"En savoir plus"</annotation></string>
<string name="battery_saver_description" msgid="6794188153647295212">"Pour prolonger l\'autonomie de la batterie, l\'économiseur de batterie :\n\n• active le thème sombre ;\n • désactive ou restreint les activités en arrière-plan, certains effets visuels et d\'autres fonctionnalités, comme \"Hey Google\"."</string>
<string name="data_saver_description" msgid="4995164271550590517">"Pour réduire la consommation de données, l\'économiseur de données empêche certaines applications d\'envoyer ou de recevoir des données en arrière-plan. Ainsi, les applications que vous utilisez peuvent toujours accéder aux données, mais pas en permanence. Par exemple, il se peut que les images ne s\'affichent pas tant que vous n\'appuyez pas dessus."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Activer l\'économiseur de données ?"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nouveau : agrandissement de la fenêtre"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Vous pouvez agrandir tout ou partie de l\'écran"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Activer dans les paramètres"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Fermer"</string>
</resources>
diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml
index 7583502..c1d8703 100644
--- a/core/res/res/values-gl/strings.xml
+++ b/core/res/res/values-gl/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Servizo GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Servizo de notificacións dos sensores"</string>
<string name="twilight_service" msgid="8964898045693187224">"Servizo Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector de fuso horario (non require conexión)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Borrarase o teu dispositivo"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Non se pode utilizar a aplicación de administración. Borrarase o teu dispositivo.\n\nSe tes preguntas, contacta co administrador da organización."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> desactivou a impresión."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"conexión USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Estase executando a aplicación"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplicacións que consomen batería"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Ampliación"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"A aplicación <xliff:g id="APP_NAME">%1$s</xliff:g> está consumindo batería"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplicacións están consumindo batería"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Toca para obter información sobre o uso de datos e a batería"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nova función: Lupa de ventá"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Agora podes ampliar toda a pantalla ou parte dela"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Activar en Configuración"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Ignorar"</string>
</resources>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index 6f140c4..794b7a7 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS સેવા"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"સેન્સર નોટિફિકેશન સેવા"</string>
<string name="twilight_service" msgid="8964898045693187224">"ટ્વાઇલાઇટ સેવા"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"સમય ઝોન શોધવાની સુવિધા (કનેક્ટિવિટી જરૂરી નથી)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"તમારું ઉપકરણ કાઢી નાખવામાં આવશે"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"વ્યવસ્થાપક ઍપનો ઉપયોગ કરી શકાશે નહીં. તમારું ઉપકરણ હવે કાઢી નાખવામાં આવશે.\n\nજો તમને પ્રશ્નો હોય, તો તમારી સંસ્થાના વ્યવસ્થાપકનો સંપર્ક કરો."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> દ્વારા પ્રિન્ટ કરવાનું બંધ કરાયું છે."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB કનેક્શન"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ઍપ ચાલી રહ્યું છે"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ઍપ બૅટરીનો વપરાશ કરી રહ્યાં છે"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"મોટું કરવાની સુવિધા"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> બૅટરીનો ઉપયોગ કરી રહ્યું છે"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ઍપ બૅટરીનો ઉપયોગ કરી રહ્યાં છે"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"બૅટરી અને ડેટા વપરાશ વિશેની વિગતો માટે ટૅપ કરો"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"નવી: વિંડો મોટી કરવાની સુવિધા"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"હવે તમે તમારી કેટલીક કે આખી સ્ક્રીનને મોટી કરી શકો છો"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"સેટિંગમાં ચાલુ કરો"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"છોડી દો"</string>
</resources>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 5892dab..dc44fba 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"जीएनएसएस सेवा"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"सेंसर से जुड़ी सूचना सेवा"</string>
<string name="twilight_service" msgid="8964898045693187224">"ट्वाइलाइट समय बताने वाली सेवा"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"समय क्षेत्र का पता लगाने वाली सुविधा (ऑफ़लाइन होने पर)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"आपके डिवाइस को मिटा दिया जाएगा"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"एडमिन ऐप्लिकेशन का इस्तेमाल नहीं किया जा सकता. आपके डिवाइस पर मौजूद डेटा अब मिटा दिया जाएगा.\n\nअगर आप कुछ पूछना चाहते हैं तो, अपने संगठन के एडमिन से संपर्क करें."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ने प्रिंटिंग सुविधा बंद कर दी है."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB कनेक्शन"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ऐप अभी इस्तेमाल हो रहा है"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"बैटरी की खपत करने वाले ऐप"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ज़ूम करने की सुविधा"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> बैटरी का इस्तेमाल कर रहा है"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ऐप बैटरी का इस्तेमाल कर रहे हैं"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"बैटरी और डेटा खर्च की जानकारी के लिए छूएं"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"नई सुविधा: विंडो को ज़ूम करके देखने की सुविधा"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"अब अपनी पूरी स्क्रीन या कुछ हिस्से को ज़ूम करके देख सकते हैं"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"सेटिंग में जाकर, इस सुविधा को चालू करें"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"खारिज करें"</string>
</resources>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index f4d9842..deaac3f 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Usluga GNSS-a"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Usluga Obavijesti senzora"</string>
<string name="twilight_service" msgid="8964898045693187224">"Usluga Sumrak"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detektor vremenske zone (nije povezan)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Uređaj će se izbrisati"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Administratorska aplikacija ne može se upotrebljavati. Uređaj će se izbrisati.\n\nAko imate pitanja, obratite se administratoru organizacije."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Ispis je onemogućila aplikacija <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB veza"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Izvodi se aplikacija"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikacije troše bateriju"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Povećavanje"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> koristi bateriju"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Broj aplikacija koje koriste bateriju: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Dodirnite da biste vidjeli pojedinosti o potrošnji baterije i podatkovnom prometu"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Novo: alat za povećanje prozora"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Sad možete povećati dio zaslona ili cijeli zaslon"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Uključite u Postavkama"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Odbaci"</string>
</resources>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index bff1773..c408395 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-szolgáltatás"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Szenzoros értesítési szolgáltatás"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight szolgáltatás"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Időzóna-felismerő (Offline)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"A rendszer törölni fogja eszközét"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"A rendszergazdai alkalmazás nem használható. A rendszer most törli az eszközt.\n\nKérdéseivel forduljon szervezete rendszergazdájához."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"A(z) <xliff:g id="OWNER_APP">%s</xliff:g> letiltotta a nyomtatást."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-kapcsolat"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Jelenleg futó alkalmazás"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Akkumulátort használó alkalmazások"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Nagyítás"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"A(z) <xliff:g id="APP_NAME">%1$s</xliff:g> alkalmazás használja az akkumulátort"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> alkalmazás használja az akkumulátort"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Koppintson az akkumulátor- és adathasználat részleteinek megtekintéséhez"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Újdonság: Ablaknagyító"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Ezután nagyíthatja a képernyőt vagy egy részét"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Bekapcsolás a Beállításokban"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Elvetés"</string>
</resources>
diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml
index 1f2e642..b1db764 100644
--- a/core/res/res/values-hy/strings.xml
+++ b/core/res/res/values-hy/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS ծառայություն"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Տվիչների ծանուցումների մշակման ծառայություն"</string>
<string name="twilight_service" msgid="8964898045693187224">"Մթնշաղի սկիզբը որոշող ծառայություն"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Ժամային գոտու դետեկտոր (աշխատում է առանց ինտերնետի)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Ձեր սարքը ջնջվելու է"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Հնարավոր չէ օգտագործել ադմինիստրատորի հավելվածը։ Ձեր սարքից բոլոր տվյալները կջնջվեն։\n\nՀարցեր ունենալու դեպքում դիմեք ձեր կազմակերպության ադմինիստրատորին։"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Տպումն անջատված է <xliff:g id="OWNER_APP">%s</xliff:g> հավելվածի կողմից։"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB կապակցում"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Հավելվածն աշխատում է"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Մարտկոցի լիցքը ծախսող հավելվածներ"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Խոշորացում"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"«<xliff:g id="APP_NAME">%1$s</xliff:g>» հավելվածը ծախսում է մարտկոցի լիցքը"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> հավելված ծախսում է մարտկոցի լիցքը"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Հպեք՝ մարտկոցի և թրաֆիկի մանրամասները տեսնելու համար"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Նոր գործառույթ. Պատուհանի խոշորացույց"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Այժմ կարող եք խոշորացնել ամբողջ էկրանը կամ դրա մի մասը"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Միացնել կարգավորումներում"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Փակել"</string>
</resources>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 4f26eb6..fc82c22 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Layanan GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Layanan Notifikasi Sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Layanan Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Pendeteksi Zona Waktu (Tidak ada konektivitas)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Perangkat akan dihapus"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Aplikasi admin tidak dapat digunakan. Perangkat Anda kini akan dihapus.\n\nJika ada pertanyaan, hubungi admin organisasi."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Fitur pencetakan dinonaktifkan oleh <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Sambungan USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplikasi berjalan"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikasi yang menggunakan baterai"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Pembesaran"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> sedang menggunakan baterai"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplikasi sedang meggunakan baterai"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Ketuk untuk melihat detail penggunaan baterai dan data"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Baru: Pembesar Jendela"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Anda bisa memperbesar sebagian atau seluruh layar"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Aktifkan di Setelan"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Tutup"</string>
</resources>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index d5539a3..456f518 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-þjónusta"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Tilkynningaþjónusta nema"</string>
<string name="twilight_service" msgid="8964898045693187224">"Ljósaskiptaþjónusta"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Tímabeltisgreinir (engin tenging)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Tækið verður hreinsað"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Ekki er hægt að nota stjórnunarforritið. Tækinu verður eytt.\n\nEf spurningar vakna skaltu hafa samband við kerfisstjóra fyrirtækisins."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> lokaði á prentun."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-tenging"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Forrit er í gangi"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Forrit sem nota rafhlöðuorku"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Stækkun"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> notar rafhlöðuorku"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> forrit nota rafhlöðuorku"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Ýttu til að fá upplýsingar um rafhlöðu- og gagnanotkun"</string>
@@ -1801,7 +1801,7 @@
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Kerfisstjóri eyddi"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"Í lagi"</string>
<string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Til að auka rafhlöðuendingu gerir rafhlöðusparnaður eftirfarandi:\n\n•·Kveikir á dökku þema\n•·Slekkur á eða takmarkar bakgrunnsvirkni, tilteknar myndbrellur og aðra eiginleika eins og „Ok Google“\n\n"<annotation id="url">"Frekari upplýsingar"</annotation></string>
- <string name="battery_saver_description" msgid="6794188153647295212">"Til að auka rafhlöðuendingu gerir rafhlöðusparnaður eftirfarandi:\n\n•·Kveikir á dökku þema\n•·Slekkur á eða takmarkar bakgrunnsvirkni, tilteknar myndbrellur og aðra eiginleika eins og „Ok Google“"</string>
+ <string name="battery_saver_description" msgid="6794188153647295212">"Til að auka rafhlöðuendingu gerir rafhlöðusparnaður eftirfarandi:\n\n• Kveikir á dökku þema\n• Slekkur á eða takmarkar bakgrunnsvirkni, tilteknar myndbrellur og aðra eiginleika eins og „Ok Google“"</string>
<string name="data_saver_description" msgid="4995164271550590517">"Gagnasparnaður getur hjálpað til við að draga úr gagnanotkun með því að hindra forrit í að senda eða sækja gögn í bakgrunni. Forrit sem er í notkun getur náð í gögn, en gerir það kannski sjaldnar. Niðurstaðan getur verið, svo dæmi sé tekið, að myndir eru ekki birtar fyrr en þú ýtir á þær."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Kveikja á gagnasparnaði?"</string>
<string name="data_saver_enable_button" msgid="4399405762586419726">"Kveikja"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nýtt: Gluggastækkun"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Nú geturðu stækkað allan skjáinn eða hluta hans"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Kveikja á í stillingum"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Hunsa"</string>
</resources>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 152cfee..e89145b 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Servizio GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Servizio di notifica dei sensori"</string>
<string name="twilight_service" msgid="8964898045693187224">"Servizio Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Rilevatore di fuso orario (connessione a Internet non necessaria)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Il dispositivo verrà resettato"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Impossibile usare l\'app di amministrazione. Il dispositivo verrà resettato.\n\nPer eventuali domande, contatta l\'amministratore della tua organizzazione."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Stampa disattivata da <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -1451,7 +1452,7 @@
<string name="car_mode_disable_notification_message" msgid="8954550232288567515">"Tocca per uscire dall\'app di guida."</string>
<string name="back_button_label" msgid="4078224038025043387">"Indietro"</string>
<string name="next_button_label" msgid="6040209156399907780">"Avanti"</string>
- <string name="skip_button_label" msgid="3566599811326688389">"Ignora"</string>
+ <string name="skip_button_label" msgid="3566599811326688389">"Salta"</string>
<string name="no_matches" msgid="6472699895759164599">"Nessuna corrispondenza"</string>
<string name="find_on_page" msgid="5400537367077438198">"Trova nella pagina"</string>
<plurals name="matches_found" formatted="false" msgid="1101758718194295554">
@@ -1799,8 +1800,8 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Aggiornato dall\'amministratore"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Eliminato dall\'amministratore"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"OK"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Per estendere la durata della batteria, la funzionalità di risparmio energetico:\n\n• Attiva il tema scuro\n• Disattiva o limita le attività in background, alcuni effetti visivi e altre funzionalità come \"Ok Google\"\n\n"<annotation id="url">"Ulteriori informazioni"</annotation></string>
- <string name="battery_saver_description" msgid="6794188153647295212">"Per estendere la durata della batteria, la funzionalità di risparmio energetico:\n\n• Attiva il tema scuro\n• Disattiva o limita le attività in background, alcuni effetti visivi e altre funzionalità come \"Ok Google\""</string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Per estendere la durata della batteria, la funzionalità di risparmio energetico:\n\n• Attiva il tema scuro\n• Disattiva o limita le attività in background, alcuni effetti visivi e altre funzionalità come \"Hey Google\"\n\n"<annotation id="url">"Scopri di più"</annotation></string>
+ <string name="battery_saver_description" msgid="6794188153647295212">"Per estendere la durata della batteria, la funzionalità di risparmio energetico:\n\n• Attiva il tema scuro\n• Disattiva o limita le attività in background, alcuni effetti visivi e altre funzionalità come \"Hey Google\""</string>
<string name="data_saver_description" msgid="4995164271550590517">"Per contribuire a ridurre l\'utilizzo dei dati, la funzione Risparmio dati impedisce ad alcune app di inviare o ricevere dati in background. Un\'app in uso può accedere ai dati, ma potrebbe farlo con meno frequenza. Esempio: le immagini non vengono visualizzate finché non le tocchi."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Attivare Risparmio dati?"</string>
<string name="data_saver_enable_button" msgid="4399405762586419726">"Attiva"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 5ae9436..a8810ab 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"שירות GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"שירות להתראות מחיישנים"</string>
<string name="twilight_service" msgid="8964898045693187224">"שירות דמדומים"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"מזהה אזור זמן (ללא צורך בקישוריות)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"תתבצע מחיקה של המכשיר"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"לא ניתן להשתמש באפליקציה של מנהל המערכת.\n\nאם יש לך שאלות, יש ליצור קשר עם מנהל המערכת של הארגון."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"ההדפסה הושבתה על ידי <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"חיבור USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"אפליקציה פועלת"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"אפליקציות שמרוקנות את הסוללה"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"הגדלה"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> משתמשת בסוללה"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> אפליקציות משתמשות בסוללה"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"הקש לקבלת פרטים על צריכה של נתונים וסוללה"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"חדש: Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"עכשיו אפשר להגדיל את המסך או חלקים ממנו"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"הפעלה בהגדרות"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"סגירה"</string>
</resources>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 7a54a15..079598b 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS サービス"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"センサー通知サービス"</string>
<string name="twilight_service" msgid="8964898045693187224">"トワイライト サービス"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Time Zone Detector(未接続)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"デバイスのデータが消去されます"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"管理アプリを使用できません。デバイスのデータはこれから消去されます。\n\nご不明な点がある場合は、組織の管理者にお問い合わせください。"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"「<xliff:g id="OWNER_APP">%s</xliff:g>」により印刷は無効にされています。"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB 接続"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"実行中のアプリ"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"電池を消費しているアプリ"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"拡大"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」が電池を使用しています"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> 個のアプリが電池を使用しています"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"タップして電池やデータの使用量を確認"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"新機能: Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"画面の一部または全体を拡大できるようになりました"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"[設定] で ON にする"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"閉じる"</string>
</resources>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index 1653cb9..22d69d6 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS სერვისი"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"სენსორის შეტყობინების სერვისი"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight სერვისი"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"სასაათო სარტყლის დეტექტორი (კავშირის გარეშე)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"თქვენი მოწყობილობა წაიშლება"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"ადმინისტრატორის აპის გამოყენება ვერ მოხერხდება. თქვენი მოწყობილობა ახლა ამოიშლება.\n\nთუ შეკითხვები გაქვთ, დაუკავშირდით თქვენი ორგანიზაციის ადმინისტრატორს."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"ბეჭდვა გათიშულია <xliff:g id="OWNER_APP">%s</xliff:g>-ის მიერ."</string>
diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml
index 635fed7..464b798 100644
--- a/core/res/res/values-kk/strings.xml
+++ b/core/res/res/values-kk/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS қызметі"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Датчик хабарландыруы қызметі"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight қызметі"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Уақыт белдеуін анықтағыш (қосылу мүмкіндігі жоқ)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Құрылғыңыздағы деректер өшіріледі"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Әкімші қолданбасын пайдалану мүмкін емес. Қазір құрылғыдағы деректер өшіріледі\n\nСұрақтарыңыз болса, ұйым әкімшісіне хабарласыңыз."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Басып шығаруды <xliff:g id="OWNER_APP">%s</xliff:g> өшірді."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB байланысы"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Қолданба қосулы"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Батареяны пайдаланып жатқан қолданбалар"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Ұлғайту"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> батареяны пайдалануда"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> қолданба батареяны пайдалануда"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Батарея мен деректер трафигі туралы білу үшін түртіңіз"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Жаңа: Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Енді экранның бір бөлігін не барлығын ұлғайта аласыз."</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Параметрлер бөлімінен қосу"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Қабылдамау"</string>
</resources>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index 1160a40..823a574 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"សេវាកម្ម GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"សេវាកម្មជូនដំណឹងឧបករណ៍ចាប់សញ្ញា"</string>
<string name="twilight_service" msgid="8964898045693187224">"សេវាកម្មព្រលប់"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ឧបករណ៍សម្គាល់ល្វែងម៉ោង (គ្មានការតភ្ជាប់ទេ)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"ឧបករណ៍របស់អ្នកនឹងត្រូវបានលុប"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"មិនអាចប្រើកម្មវិធីអ្នកគ្រប់គ្រងបានទេ។ ឧបករណ៍របស់អ្នកនឹងលុបឥឡូវនេះ។\n\nប្រសិនបើអ្នកមានសំណួរផ្សេងៗ សូមទាក់ទងទៅអ្នកគ្រប់គ្រងស្ថាប័នរបស់អ្នក។"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"ការបោះពុម្ពត្រូវបានបិទដោយ <xliff:g id="OWNER_APP">%s</xliff:g> ។"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"ការតភ្ជាប់ USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"កម្មវិធីដែលកំពុងដំណើរការ"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"កម្មវិធីដែលកំពុងប្រើថ្ម"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ការពង្រីក"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> កំពុងប្រើថ្ម"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"កម្មវិធីចំនួន <xliff:g id="NUMBER">%1$d</xliff:g> កំពុងប្រើថ្ម"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ចុចដើម្បីមើលព័ត៌មានលម្អិតអំពីការប្រើប្រាស់ទិន្នន័យ និងថ្ម"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"ថ្មី៖ កម្មវិធីពង្រីកវិនដូ"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"ឥឡូវនេះ អ្នកអាចពង្រីកផ្នែកខ្លះ ឬទាំងអស់នៃអេក្រង់របស់អ្នក"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"បើកនៅក្នុងការកំណត់"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ច្រានចោល"</string>
</resources>
diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml
index 8eb3467..bac30ef 100644
--- a/core/res/res/values-kn/strings.xml
+++ b/core/res/res/values-kn/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS ಸೇವೆ"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"ಸೆನ್ಸರ್ ಅಧಿಸೂಚನೆ ಸೇವೆ"</string>
<string name="twilight_service" msgid="8964898045693187224">"ಟ್ವಿಲೈಟ್ ಸೇವೆ"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ಸಮಯವಲಯ ಡಿಟೆಕ್ಟರ್ (ಯಾವುದೇ ಸಂಪರ್ಕ ಕಲ್ಪಿಸುವಿಕೆ ಇಲ್ಲ)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"ನಿಮ್ಮ ಸಾಧನವನ್ನು ಅಳಿಸಲಾಗುತ್ತದೆ"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"ನಿರ್ವಹಣೆ ಅಪ್ಲಿಕೇಶನ್ ಬಳಸಲು ಸಾಧ್ಯವಿಲ್ಲ. ನಿಮ್ಮ ಸಾಧನವನ್ನು ಇದೀಗ ಅಳಿಸಲಾಗುತ್ತದೆ.\n\nನಿಮ್ಮಲ್ಲಿ ಪ್ರಶ್ನೆಗಳಿದ್ದರೆ, ನಿಮ್ಮ ಸಂಸ್ಥೆಯ ನಿರ್ವಾಹಕರನ್ನು ಸಂಪರ್ಕಿಸಿ."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ಮೂಲಕ ಪ್ರಿಂಟಿಂಗ್ ಅನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB ಸಂಪರ್ಕ"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"App ರನ್ ಆಗುತ್ತಿದೆ"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ಅಪ್ಲಿಕೇಶನ್ಗಳು ಬ್ಯಾಟರಿಯನ್ನು ಉಪಯೋಗಿಸುತ್ತಿವೆ"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ಹಿಗ್ಗಿಸುವಿಕೆ"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ಆ್ಯಪ್, ಬ್ಯಾಟರಿಯನ್ನು ಬಳಸುತ್ತಿದೆ"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ಅಪ್ಲಿಕೇಶನ್ಗಳು ಬ್ಯಾಟರಿ ಬಳಸುತ್ತಿವೆ"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ಬ್ಯಾಟರಿ,ಡೇಟಾ ಬಳಕೆಯ ವಿವರಗಳಿಗಾಗಿ ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"ಹೊಸದು: ವಿಂಡೋ ಮ್ಯಾಗ್ನಿಫೈಯರ್"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"ಈಗ ಕೆಲವು ಅಥವಾ ಎಲ್ಲಾ ಸ್ಕ್ರೀನ್ ಅನ್ನು ಹಿಗ್ಗಿಸಬಹುದು"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"ಸೆಟ್ಟಿಂಗ್ಗಳಲ್ಲಿ ಆನ್ ಮಾಡಿ"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ವಜಾಗೊಳಿಸಿ"</string>
</resources>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 46b4a1b..00eb66f 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS 서비스"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"센서 알림 서비스"</string>
<string name="twilight_service" msgid="8964898045693187224">"새벽 서비스"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"시간대 감지(연결되지 않음)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"기기가 삭제됩니다."</string>
<string name="factory_reset_message" msgid="2657049595153992213">"관리자 앱을 사용할 수 없습니다. 곧 기기가 삭제됩니다.\n\n궁금한 점이 있으면 조직의 관리자에게 문의하세요."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g>에 의해 사용 중지되었습니다."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB 연결"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"실행 중인 앱"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"배터리를 소모하는 앱"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"확대"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g>에서 배터리 사용 중"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"앱 <xliff:g id="NUMBER">%1$d</xliff:g>개에서 배터리 사용 중"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"탭하여 배터리 및 데이터 사용량 확인"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"새로운 기능: 창 돋보기"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"이제 화면 일부 또는 전체를 확대할 수 있습니다."</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"설정에서 사용 설정"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"닫기"</string>
</resources>
diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml
index bb005f3..7c1fb98 100644
--- a/core/res/res/values-ky/strings.xml
+++ b/core/res/res/values-ky/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS кызматы"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Сенсордун билдирмелеринин кызматы"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight кызматы"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Убакыт алкагын аныктагыч (байланыш жок)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Түзмөгүңүз тазаланат"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Түзмөктү башкаруучу колдонмо жараксыз. Түзмөгүңүз азыр тазаланат.\n\nСуроолоруңуз болсо, ишканаңыздын администраторуна кайрылыңыз."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Басып чыгаруу <xliff:g id="OWNER_APP">%s</xliff:g> тарабынан өчүрүлдү."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB аркылуу туташуу"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Колдонмо иштеп жатат"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Колдонмолор батареяңызды коротууда"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Чоңойтуу"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> колдонмосу батареяны пайдаланып жатат"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> колдонмо батареяны пайдаланып жатат"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Батареянын кубаты жана трафиктин көлөмү жөнүндө билүү үчүн таптап коюңуз"</string>
@@ -1800,8 +1800,8 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Администраторуңуз жаңыртып койгон"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Администраторуңуз жок кылып салган"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"ЖАРАЙТ"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Батареянын мөөнөтүн узартуу үчүн Батареяны үнөмдөгүч режими төмөнкүлөрдү аткарат:\n\n• Караңгы теманы күйгүзөт\n• Фондогу аракеттерди, айрым визуалдык эффекттерди жана \"Окей Google\" сыяктуу башка функцияларды өчүрөт же чектейт\n\n"<annotation id="url">"Кеңири маалымат"</annotation></string>
- <string name="battery_saver_description" msgid="6794188153647295212">"Батареянын мөөнөтүн узартуу үчүн Батареяны үнөмдөгүч режими:\n\n• Караңгы теманы күйгүзөт\n• Фондогу аракеттерди, айрым визуалдык эффекттерди жана \"Окей Google\" сыяктуу башка функцияларды өчүрөт же чектейт"</string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Батареяны көбүрөөк убакытка жеткирүү үчүн Батареяны үнөмдөгүч режиминде:\n\n• Караңгы тема күйгүзүлөт\n• Фондогу аракеттерди, айрым визуалдык эффекттерди жана \"Окей Google\" сыяктуу башка функцияларды өчүрөт же чектейт\n\n"<annotation id="url">"Кеңири маалымат"</annotation></string>
+ <string name="battery_saver_description" msgid="6794188153647295212">"Батареяны көбүрөөк убакытка жеткирүү үчүн Батареяны үнөмдөгүч режими:\n\n• Караңгы тема күйгүзүлөт\n• Фондогу аракеттерди, айрым визуалдык эффекттерди жана \"Окей Google\" сыяктуу башка функцияларды өчүрөт же чектейт"</string>
<string name="data_saver_description" msgid="4995164271550590517">"Трафикти үнөмдөө режиминде айрым колдонмолор дайын-даректерди фондо өткөрө алышпайт. Учурда сиз пайдаланып жаткан колдонмо дайын-даректерди жөнөтүп/ала алат, бирок адаттагыдан азыраак өткөргөндүктөн, анын айрым функциялары талаптагыдай иштебей коюшу мүмкүн. Мисалы, сүрөттөр басылмайынча жүктөлбөйт."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Трафикти үнөмдөө режимин иштетесизби?"</string>
<string name="data_saver_enable_button" msgid="4399405762586419726">"Күйгүзүү"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Жаңы функция: Терезе чоңойткуч"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Эми толук экранды же анын бөлүгүн чоңойто аласыз"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Жөндөөлөрдөн күйгүзүү"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Жабуу"</string>
</resources>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index 8e4e467..72bd141 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"ບໍລິການ GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"ບໍລິການການແຈ້ງເຕືອນເຊັນເຊີ"</string>
<string name="twilight_service" msgid="8964898045693187224">"ບໍລິການ Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ຕົວກວດຫາເຂດເວລາ (ບໍ່ມີການເຊື່ອມຕໍ່)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"ອຸປະກອນຂອງທ່ານຈະຖືກລຶບ"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"ບໍ່ສາມາດໃຊ້ແອັບຜູ້ເບິ່ງແຍງລະບົບໄດ້. ອຸປະກອນຂອງທ່ານຈະຖືກລຶບຂໍ້ມູນໃນຕອນນີ້.\n\nຫາກທ່ານມີຄຳຖາມ, ໃຫ້ຕິດຕໍ່ຜູ້ເບິ່ງແຍງລະບົບອົງກອນຂອງທ່ານ."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"ການພິມຖືກປິດໄວ້ໂດຍ <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"ການເຊື່ອມຕໍ່ USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ແອັບກຳລັງເຮັດວຽກ"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ແອັບທີ່ກຳລັງໃຊ້ແບັດເຕີຣີ"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ການຂະຫຍາຍ"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ກຳລັງໃຊ້ແບັດເຕີຣີຢູ່"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ແອັບກຳລັງໃຊ້ແບັດເຕີຣີຢູ່"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ແຕະເພື່ອເບິ່ງລາຍລະອຽດການນຳໃຊ້ແບັດເຕີຣີ ແລະ ອິນເຕີເນັດ"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"ໃໝ່: ຕົວຂະຫຍາຍໜ້າຈໍ"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"ຕອນນີ້ທ່ານສາມາດຂະຫຍາຍບາງສ່ວນ ຫຼື ທັງໝົດຂອງໜ້າຈໍໄດ້"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"ເປີດໃຊ້ໃນການຕັ້ງຄ່າ"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ປິດໄວ້"</string>
</resources>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index a922716..a4e1756 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS paslauga"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Jutiklių pranešimų paslauga"</string>
<string name="twilight_service" msgid="8964898045693187224">"Paslauga „Twilight“"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Laiko juostos aptikimo priemonė (nėra ryšio)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Įrenginys bus ištrintas"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Administratoriaus programos negalima naudoti. Dabar įrenginio duomenys bus ištrinti.\n\nJei turite klausimų, susisiekite su organizacijos administratoriumi."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Neleidžiama spausdinti (<xliff:g id="OWNER_APP">%s</xliff:g>)."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB jungtis"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Programa paleista"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Programos, naudojančios akumuliatoriaus energiją"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Didinimas"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"„<xliff:g id="APP_NAME">%1$s</xliff:g>“ naudoja akumuliatoriaus energiją"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Programų, naudojančių akumuliatoriaus energiją: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Palieskite ir sužinokite išsamios informacijos apie akumuliatoriaus bei duomenų naudojimą"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nauja: „Window Magnifier“"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Dabar galite padidinti dalį ekrano ar jį visą"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Įjungti nustatymuose"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Atmesti"</string>
</resources>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 2fec712..088e78d 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS pakalpojums"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensoru paziņojumu pakalpojums"</string>
<string name="twilight_service" msgid="8964898045693187224">"Krēslas noteikšanas pakalpojums"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Laika joslas noteikšanas rīks (nav savienojuma)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Jūsu ierīces dati tiks dzēsti"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Administratora lietotni nevar izmantot. Ierīcē saglabātie dati tiks dzēsti.\n\nJa jums ir kādi jautājumi, sazinieties ar savas organizācijas administratoru."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Drukāšanu atspējoja <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB savienojums"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Lietotne darbojas"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Lietotnes, kas patērē akumulatora jaudu"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Palielinājums"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Lietotne <xliff:g id="APP_NAME">%1$s</xliff:g> izmanto akumulatoru"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> lietotne(-es) izmanto akumulatoru"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Pieskarieties, lai skatītu detalizētu informāciju par akumulatora un datu lietojumu"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Jaunums: funkcija Window Magnifier"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Tagad varat palielināt ekrāna daļu vai visu ekrānu"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Ieslēgt sadaļā Iestatījumi"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Nerādīt"</string>
</resources>
diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml
index 3d02757..23a84c6 100644
--- a/core/res/res/values-mk/strings.xml
+++ b/core/res/res/values-mk/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Услуга GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Услуга за известување од сензорот"</string>
<string name="twilight_service" msgid="8964898045693187224">"Услуга за самрак"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Откривач на временска зона (не може да се поврзе)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Уредот ќе се избрише"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Апликацијата на администраторот не може да се користи. Уредот ќе се избрише сега.\n\nАко имате прашања, контактирајте со администраторот на организацијата."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Печатењето е оневозможено од <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-врска"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Апликацијата работи"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Апликации што ја трошат батеријата"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Зголемување"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> користи батерија"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> апликации користат батерија"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Допрете за детали за батеријата и потрошениот сообраќај"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Ново: „Лупа за прозорци“"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Сега може се зголеми целиот екран или само дел"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Вклучи во „Поставки“"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Отфрли"</string>
</resources>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index 583c46e..1c89b33 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS സേവനം"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"സെൻസർ അറിയിപ്പ് സേവനം"</string>
<string name="twilight_service" msgid="8964898045693187224">"സന്ധ്യാസമയത്തെ സേവനം"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"സമയമേഖല കണ്ടെത്താനുള്ള സംവിധാനം (കണക്റ്റിവിറ്റി ഇല്ല)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"നിങ്ങളുടെ ഉപകരണം മായ്ക്കും"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"അഡ്മിൻ ആപ്പ് ഉപയോഗിക്കാനാകില്ല. നിങ്ങളുടെ ഉപകരണം ഇപ്പോൾ മായ്ക്കപ്പെടും.\n\nനിങ്ങൾക്ക് ചോദ്യങ്ങൾ ഉണ്ടെങ്കിൽ, നിങ്ങളുടെ സ്ഥാപനത്തിന്റെ അഡ്മിനെ ബന്ധപ്പെടുക."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> പ്രിന്റിംഗ് പ്രവർത്തനരഹിതമാക്കി."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB കണക്ഷൻ"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ആപ്പ് പ്രവർത്തിക്കുന്നു"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ആപ്പുകൾ ബാറ്ററി ഉപയോഗിക്കുന്നു"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"മാഗ്നിഫിക്കേഷൻ"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ബാറ്ററി ഉപയോഗിക്കുന്നു"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ആപ്പുകൾ ബാറ്ററി ഉപയോഗിക്കുന്നു"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ബാറ്ററി, ഡാറ്റ ഉപയോഗം എന്നിവയുടെ വിശദാംശങ്ങളറിയാൻ ടാപ്പുചെയ്യുക"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"പുതിയത്: വിൻഡോ മാഗ്നിഫൈയർ"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"സ്ക്രീനിന്റെ ഭാഗങ്ങളോ മുഴുവനുമോ മാഗ്നിഫൈ ചെയ്യാം"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"ക്രമീകരണത്തിൽ ഓണാക്കുക"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ഡിസ്മിസ് ചെയ്യുക"</string>
</resources>
diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml
index 081e170..919112a 100644
--- a/core/res/res/values-mn/strings.xml
+++ b/core/res/res/values-mn/strings.xml
@@ -48,7 +48,7 @@
<string name="invalidPin" msgid="7542498253319440408">"4-8 тооноос бүтэх PIN-г бичнэ үү."</string>
<string name="invalidPuk" msgid="8831151490931907083">"8-с цөөнгүй тооноос бүтэх PUK-г бичнэ үү."</string>
<string name="needPuk" msgid="7321876090152422918">"SIM картны PUK-түгжигдсэн. Тайлах бол PUK кодыг бичнэ үү."</string>
- <string name="needPuk2" msgid="7032612093451537186">"SIM картын хаалтыг болиулах бол PUK2-г бичнэ үү."</string>
+ <string name="needPuk2" msgid="7032612093451537186">"SIM картыг блокоос гаргах бол PUK2-г бичнэ үү."</string>
<string name="enablePin" msgid="2543771964137091212">"Амжилтгүй боллоо, СИМ/РҮИМ түгжээг идэвхжүүлнэ үү."</string>
<plurals name="pinpuk_attempts" formatted="false" msgid="1619867269012213584">
<item quantity="other">Таны СИМ түгжигдэхээс өмнө танд <xliff:g id="NUMBER_1">%d</xliff:g> оролдлого хийх боломж үлдлээ. </item>
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS үйлчилгээ"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Мэдрэгчийн мэдэгдлийн үйлчилгээ"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight үйлчилгээ"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Цагийн бүс илрүүлэгч (Холболт байхгүй)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Таны төхөөрөмж устах болно."</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Админ аппыг ашиглах боломжгүй. Таны төхөөрөмжийг одоо устгана.\n\nХэрэв танд асуулт байгаа бол байгууллагынхаа админтай холбогдоно уу."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> хэвлэх үйлдлийг идэвхгүй болгосон."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB холболт"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Апп ажиллаж байна"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Апп батарей ашиглаж байна"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Томруулах"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> батерей ашиглаж байна"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> апп батерей ашиглаж байна"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Батерей, дата ашиглалтын талаар дэлгэрэнгүйг харахын тулд товшино уу"</string>
@@ -480,10 +480,10 @@
<string name="permdesc_transmitIr" product="tablet" msgid="5884738958581810253">"Апп-д таблетын хэт улаан дамжуулагчийг ашиглахыг зөвшөөрнө."</string>
<string name="permdesc_transmitIr" product="tv" msgid="3278506969529173281">"Аппад таны Android TV төхөөрөмжийн хэт улаан туяаны дамжуулагчийг ашиглахыг зөвшөөрнө."</string>
<string name="permdesc_transmitIr" product="default" msgid="8484193849295581808">"Апп-д утасны хэт улаан дамжуулагчийг ашиглахыг зөвшөөрнө."</string>
- <string name="permlab_setWallpaper" msgid="6959514622698794511">"ханын зургийг тохируулах"</string>
- <string name="permdesc_setWallpaper" msgid="2973996714129021397">"Апп нь системийн ханын зургийг тохируулах боломжтой."</string>
- <string name="permlab_setWallpaperHints" msgid="1153485176642032714">"Таны ханын зурагны хэмжээг тохируулах"</string>
- <string name="permdesc_setWallpaperHints" msgid="6257053376990044668">"Апп нь системийн ханын зургийн хэмжээний саналыг тохируулах боломжтой"</string>
+ <string name="permlab_setWallpaper" msgid="6959514622698794511">"дэлгэцийн зургийг тохируулах"</string>
+ <string name="permdesc_setWallpaper" msgid="2973996714129021397">"Апп нь системийн дэлгэцийн зургийг тохируулах боломжтой."</string>
+ <string name="permlab_setWallpaperHints" msgid="1153485176642032714">"Таны дэлгэцийн зургийн хэмжээг тохируулах"</string>
+ <string name="permdesc_setWallpaperHints" msgid="6257053376990044668">"Апп нь системийн дэлгэцийн зургийн хэмжээний саналыг тохируулах боломжтой"</string>
<string name="permlab_setTimeZone" msgid="7922618798611542432">"цагийн бүсийн тохиргоо"</string>
<string name="permdesc_setTimeZone" product="tablet" msgid="1788868809638682503">"Апп нь таблетын цагийн бүсийг солих боломжтой."</string>
<string name="permdesc_setTimeZone" product="tv" msgid="9069045914174455938">"Аппад таны Android TV төхөөрөмжийн цагийн бүсийг өөрчлөхийг зөвшөөрнө."</string>
@@ -1429,8 +1429,8 @@
<string name="input_method_binding_label" msgid="1166731601721983656">"Оруулах арга"</string>
<string name="sync_binding_label" msgid="469249309424662147">"Синк"</string>
<string name="accessibility_binding_label" msgid="1974602776545801715">"Хандалт"</string>
- <string name="wallpaper_binding_label" msgid="1197440498000786738">"Ханын зураг"</string>
- <string name="chooser_wallpaper" msgid="3082405680079923708">"Ханын зураг солих"</string>
+ <string name="wallpaper_binding_label" msgid="1197440498000786738">"Дэлгэцийн зураг"</string>
+ <string name="chooser_wallpaper" msgid="3082405680079923708">"Дэлгэцийн зураг солих"</string>
<string name="notification_listener_binding_label" msgid="2702165274471499713">"Мэдэгдэл сонсогч"</string>
<string name="vr_listener_binding_label" msgid="8013112996671206429">"VR сонсогч"</string>
<string name="condition_provider_service_binding_label" msgid="8490641013951857673">"Нөхцөл нийлүүлэгч"</string>
@@ -1510,7 +1510,7 @@
<string name="shareactionprovider_share_with_application" msgid="4902832247173666973">"<xliff:g id="APPLICATION_NAME">%s</xliff:g>-тай хуваалцана уу"</string>
<string name="content_description_sliding_handle" msgid="982510275422590757">"Бариулыг гулсуулна. Хүрээд хүлээнэ."</string>
<string name="description_target_unlock_tablet" msgid="7431571180065859551">"Түгжээг тайлах бол татна уу"</string>
- <string name="action_bar_home_description" msgid="1501655419158631974">"Нүүр хуудасруу шилжих"</string>
+ <string name="action_bar_home_description" msgid="1501655419158631974">"Нүүр хуудас руу шилжих"</string>
<string name="action_bar_up_description" msgid="6611579697195026932">"Дээш шилжих"</string>
<string name="action_menu_overflow_description" msgid="4579536843510088170">"Нэмэлт сонголтууд"</string>
<string name="action_bar_home_description_format" msgid="5087107531331621803">"%1$s, %2$s"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Шинэ: Цонх томруулагч"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Та одоо зарим эсвэл бүх дэлгэцээ томруулж болно"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Тохиргоонд асаана уу"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Үл хэрэгсэх"</string>
</resources>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index 0588633..7a8fd1a 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS सेवा"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"सेन्सर सूचना सेवा"</string>
<string name="twilight_service" msgid="8964898045693187224">"ट्वायलाइट सेवा"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"टाइम झोन डिटेक्टर (कनेक्टिव्हिटी नाही)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"तुमचे डिव्हाइस मिटविले जाईल"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"प्रशासक अॅप वापरता येणार नाही. तुमचे डिव्हाइस आता साफ केले जाईल.\n\nतुम्हाला कुठलेही प्रश्न असल्यास, तुमच्या संस्थेच्या प्रशासकाशी संपर्क साधा."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> नी प्रिंट करणे बंद केले आहे."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB कनेक्शन"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"APP चालत आहे"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"बॅटरी लवकर संपवणारी अॅप्स"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"मॅग्निफिकेशन"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> बॅटरी वापरत आहे"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> अॅप्स बॅटरी वापरत आहेत"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"बॅटरी आणि डेटा वापराच्या तपशीलांसाठी टॅप करा"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"नवीन: विंडो मॅग्निफायर"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"आता स्क्रीन अंशतः किंवा पूर्ण मॅग्निफाय करू शकता"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"सेटिंग्ज मध्ये सुरू करा"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"डिसमिस करा"</string>
</resources>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 1d70f76..e94dcde 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Perkhidmatan GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Perkhidmatan Pemberitahuan Penderia"</string>
<string name="twilight_service" msgid="8964898045693187224">"Perkhidmatan Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Pengesan Zon Waktu (Tiada kesambungan)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Peranti anda akan dipadam"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Apl pentadbir tidak dapat digunakan. Peranti anda akan dipadamkan sekarang.\n\nJika anda ingin mengemukakan soalan, hubungi pentadbir organisasi anda."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Pencetakan dilumpuhkan oleh <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Sambungan USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Apl berjalan"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Apl yang menggunakan bateri"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Pembesaran"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> sedang menggunakan bateri"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> apl sedang menggunakan bateri"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Ketik untuk mendapatkan butiran tentang penggunaan kuasa bateri dan data"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Baharu: Pembesar Tetingkap"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Besarkan sebahagian atau keseluruhan skrin anda"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Hidupkan dalam Tetapan"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Tolak"</string>
</resources>
diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml
index 097c6c5..c31b7b2 100644
--- a/core/res/res/values-my/strings.xml
+++ b/core/res/res/values-my/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS ဝန်ဆောင်မှု"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"အာရုံခံကိရိယာ အကြောင်းကြားချက် ဝန်ဆောင်မှု"</string>
<string name="twilight_service" msgid="8964898045693187224">"နေဝင်ဆည်းဆာ ဝန်ဆောင်မှု"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ဒေသစံတော်ချိန် ရှာဖွေစနစ် (ချိတ်ဆက်နိုင်မှု မလိုပါ)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"သင့်ကိရိယာအား ပယ်ဖျက်လိမ့်မည်"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"စီမံခန့်ခွဲမှု အက်ပ်ကို သုံး၍မရပါ။ သင်၏ စက်ပစ္စည်းအတွင်းရှိ အရာများကို ဖျက်လိုက်ပါမည်\n\nမေးစရာများရှိပါက သင့်အဖွဲ့အစည်း၏ စီမံခန့်ခွဲသူကို ဆက်သွယ်ပါ။"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> က ပုံနှိပ်ထုတ်ယူခြင်းကို ပိတ်ထားသည်။"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB ချိတ်ဆက်မှု"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"APP လုပ်ဆောင်နေသည်"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"အက်ပ်များက ဘက်ထရီကုန်စေသည်"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ချဲ့ခြင်း"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> က ဘက်ထရီကို အသုံးပြုနေသည်"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"အက်ပ် <xliff:g id="NUMBER">%1$d</xliff:g> ခုက ဘက်ထရီကို အသုံးပြုနေသည်"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ဘက်ထရီနှင့် ဒေတာအသုံးပြုမှု အသေးစိတ်ကို ကြည့်ရန် တို့ပါ"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"အသစ်- ဝင်းဒိုးမှန်ဘီလူး"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"ဖန်သားပြင် တစ်စိတ်တစ်ပိုင်း (သို့) တစ်ခုလုံး ချဲ့နိုင်ပါပြီ"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"\'ဆက်တင်များ\' တွင် ဖွင့်ရန်"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ပယ်ရန်"</string>
</resources>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 6fa80dd..7f2c6aa 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-tjeneste"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Tidssoneoppdagelse (ingen tilkobling)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Enheten blir slettet"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Administratorappen kan ikke brukes. Enheten din blir nå tømt.\n\nTa kontakt med administratoren for organisasjonen din hvis du har spørsmål."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> har slått av utskrift."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-tilkobling"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"App kjører"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Apper bruker batteri"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Forstørring"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> bruker batteri"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> apper bruker batteri"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Trykk for detaljer om batteri- og databruk"</string>
@@ -1800,8 +1800,8 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Oppdatert av administratoren din"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Slettet av administratoren din"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"OK"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"For å forlenge batterilevetiden gjør Batterisparing dette:\n\n• Slår på mørkt tema\n• Slår av eller begrenser bakgrunnsaktivitet, enkelte visuelle effekter og andre funksjoner, for eksempel «Hey Google»\n\n"<annotation id="url">"Finn ut mer"</annotation></string>
- <string name="battery_saver_description" msgid="6794188153647295212">"For å forlenge batterilevetiden gjør Batterisparing dette:\n\n• Slår på mørkt tema\n• Slår av eller begrenser bakgrunnsaktivitet, enkelte visuelle effekter og andre funksjoner, for eksempel «Hey Google»"</string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"For å forlenge batterilevetiden gjør Batterisparing dette:\n\n• slår på mørkt tema\n• slår av eller begrenser bakgrunnsaktivitet, enkelte visuelle effekter og andre funksjoner, for eksempel «Hey Google»\n\n"<annotation id="url">"Finn ut mer"</annotation></string>
+ <string name="battery_saver_description" msgid="6794188153647295212">"For å forlenge batterilevetiden gjør Batterisparing dette:\n\n• slår på mørkt tema\n• slår av eller begrenser bakgrunnsaktivitet, enkelte visuelle effekter og andre funksjoner, for eksempel «Hey Google»"</string>
<string name="data_saver_description" msgid="4995164271550590517">"Datasparing hindrer noen apper fra å sende og motta data i bakgrunnen, for å redusere dataforbruket. Aktive apper kan bruke data, men kanskje ikke så mye som ellers – for eksempel vises ikke bilder før du trykker på dem."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Vil du slå på Datasparing?"</string>
<string name="data_saver_enable_button" msgid="4399405762586419726">"Slå på"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nytt: vindusforstørrer"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Nå kan du forstørre deler av eller hele skjermen"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Slå på i innstillingene"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Avvis"</string>
</resources>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index 28c3525..d555b7c 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS सेवा"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"सेन्सरको सूचनासम्बन्धी सेवा"</string>
<string name="twilight_service" msgid="8964898045693187224">"ट्वाइलाइट सेवा"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"समय क्षेत्र पत्ता लगाउने सुविधा (नेटवर्क कनेक्सन नहुँदा)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"तपाईंको यन्त्र मेटिनेछ"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"प्रशासकको एप प्रयोग गर्न मिल्दैन। तपाईंको यन्त्रको डेटा अब मेटाइने छ।\n\nतपाईंसँग प्रश्नहरू भएका खण्डमा आफ्नो संगठनका प्रशासकसँग सम्पर्क गर्नुहोस्।"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ले छाप्ने कार्यलाई असक्षम पार्यो।"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB जडान"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"एप चलिरहेको छ"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"एपहरूले ब्याट्री खपत गर्दै छन्"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"जुम इन गर्ने सुविधा"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ले ब्याट्री प्रयोग गर्दै छ"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> एपहरूले ब्याट्री प्रयोग गर्दै छन्"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ब्याट्री र डेटाका प्रयोग सम्बन्धी विवरणहरूका लागि ट्याप गर्नुहोस्"</string>
@@ -1965,7 +1965,7 @@
<string name="autofill_save_type_debit_card" msgid="3169397504133097468">"डेबिट कार्ड"</string>
<string name="autofill_save_type_payment_card" msgid="6555012156728690856">"भुक्तानी कार्ड"</string>
<string name="autofill_save_type_generic_card" msgid="1019367283921448608">"कार्ड"</string>
- <string name="autofill_save_type_username" msgid="1018816929884640882">"प्रयोगकर्ताको नाम"</string>
+ <string name="autofill_save_type_username" msgid="1018816929884640882">"युजरनेम"</string>
<string name="autofill_save_type_email_address" msgid="1303262336895591924">"इमेल ठेगाना"</string>
<string name="etws_primary_default_message_earthquake" msgid="8401079517718280669">"शान्त रहनुहोस् र नजिकै आश्रयस्थल खोज्नुहोस्।"</string>
<string name="etws_primary_default_message_tsunami" msgid="5828171463387976279">"तटीय क्षेत्र र नदीछेउका ठाउँहरू छाडी उच्च सतहमा अवस्थित कुनै अझ सुरक्षित ठाउँमा जानुहोस्।"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"नयाँ सुविधा: विन्डो म्याग्निफायर"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"तपाईं अब स्क्रिनको केही वा सबै भाग जुम इन गर्न सक्नुहुन्छ"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"सेटिङमा गई यो सुविधा अन गर्नुहोस्"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"हटाउनुहोस्"</string>
</resources>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 8b571e8..04f598d 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-service"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Service voor sensormeldingen"</string>
<string name="twilight_service" msgid="8964898045693187224">"Service voor schemering"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Tijdzonedetector (Geen verbinding)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Je apparaat wordt gewist"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"De beheer-app kan niet worden gebruikt. Je apparaat wordt nu gewist.\n\nNeem contact op met de beheerder van je organisatie als je vragen hebt."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Afdrukken uitgeschakeld door <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-verbinding"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"App actief"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Apps die de batterij gebruiken"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Vergroting"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> gebruikt de batterij"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> apps gebruiken de batterij"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Tik voor batterij- en datagebruik"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nieuw: Venstervergroting"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Je kunt je scherm nu (gedeeltelijk) vergroten"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Inschakelen in Instellingen"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Sluiten"</string>
</resources>
diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml
index 4b5c9b0..bccb824 100644
--- a/core/res/res/values-or/strings.xml
+++ b/core/res/res/values-or/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS ସର୍ଭିସ୍"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"ସେନ୍ସର୍ ନୋଟିଫିକେସନ୍ ସର୍ଭିସ୍"</string>
<string name="twilight_service" msgid="8964898045693187224">"ଟ୍ୱିଲାଇଟ୍ ସର୍ଭିସ୍"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ଟାଇମ୍ ଜୋନ୍ ଡିଟେକ୍ଟର୍ (କୌଣସି ସଂଯୋଗ ନାହିଁ)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"ଆପଣଙ୍କ ଡିଭାଇସ୍ ବର୍ତ୍ତମାନ ଲିଭାଯିବ"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"ଆଡମିନ୍ ଆପ୍ ବ୍ୟବହାର କରାଯାଇପାରିବ ନାହିଁ। ଆପଣଙ୍କ ଡିଭାଇସ୍ର ସମସ୍ତ ଡାଟାକୁ ବର୍ତ୍ତମାନ ଲିଭାଇଦିଆଯିବ। \n\nଯଦି ଆପଣଙ୍କର କୌଣସି ପ୍ରଶ୍ନ ରହିଥାଏ, ଆପଣଙ୍କ ସଂସ୍ଥାର ଆଡମିନ୍ଙ୍କ ସହ ଯୋଗାଯୋଗ କରନ୍ତୁ।"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ଦ୍ଵାରା ପ୍ରିଣ୍ଟିଙ୍ଗ ଅକ୍ଷମ କରାଯାଇଛି"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB ସଂଯୋଗ"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ଆପ୍ ଚାଲୁଛି"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ଆପ୍ଗୁଡ଼ିକ ବ୍ୟାଟେରୀ ଖର୍ଚ୍ଚ କରିଥା\'ନ୍ତି"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ମ୍ୟାଗ୍ନିଫିକେସନ୍"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ବ୍ୟାଟେରୀ ବ୍ୟବହାର କରୁଛି"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g>ଟି ଆପ୍ ବ୍ୟାଟେରୀ ବ୍ୟବହାର କରୁଛନ୍ତି"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ବ୍ୟାଟେରୀ ଏବଂ ଡାଟା ବ୍ୟବହାର ଉପରେ ବିବରଣୀ ପାଇଁ ଟାପ୍ କରନ୍ତୁ"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"ନୂଆ: ୱିଣ୍ଡୋ ମ୍ୟାଗ୍ନିଫାୟର୍"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"ଆପଣ ଏବେ ଆଂଶିକ ବା ସମ୍ପୂର୍ଣ୍ଣ ସ୍କ୍ରିନ୍ ବଡ଼ କରିପାରିବେ"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"ସେଟିଂସରେ ଚାଲୁ କରନ୍ତୁ"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ଖାରଜ କରନ୍ତୁ"</string>
</resources>
diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml
index 5de0885..2d16de8 100644
--- a/core/res/res/values-pa/strings.xml
+++ b/core/res/res/values-pa/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS ਸੇਵਾ"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"ਸੈਂਸਰ ਸੂਚਨਾ ਸੇਵਾ"</string>
<string name="twilight_service" msgid="8964898045693187224">"ਟਵੀਲਾਈਟ ਸੇਵਾ"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ਸਮਾਂ ਖੇਤਰ ਦਾ ਪਤਾ ਲਗਾਉਣ ਦੀ ਸੁਵਿਧਾ (ਕੋਈ ਕਨੈਕਟੀਵਿਟੀ ਨਹੀਂ)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"ਤੁਹਾਡਾ ਡੀਵਾਈਸ ਮਿਟਾਇਆ ਜਾਏਗਾ"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"ਪ੍ਰਸ਼ਾਸਕ ਐਪ ਵਰਤੀ ਨਹੀਂ ਜਾ ਸਕਦੀ। ਹੁਣ ਤੁਹਾਡੇ ਡੀਵਾਈਸ ਦਾ ਡਾਟਾ ਮਿਟਾਇਆ ਜਾਵੇਗਾ।\n\nਜੇਕਰ ਤੁਹਾਡੇ ਕੋਲ ਕੋਈ ਸਵਾਲ ਹਨ, ਤਾਂ ਆਪਣੀ ਸੰਸਥਾ ਦੇ ਪ੍ਰਸ਼ਾਸਕ ਨੂੰ ਸੰਪਰਕ ਕਰੋ।"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ਵੱਲੋਂ ਪ੍ਰਿੰਟ ਕਰਨਾ ਬੰਦ ਕੀਤਾ ਗਿਆ।"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB ਕਨੈਕਸ਼ਨ"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ਚੱਲ ਰਹੀ ਐਪ"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ਬੈਟਰੀ ਦੀ ਖਪਤ ਕਰਨ ਵਾਲੀਆਂ ਐਪਾਂ"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"ਵੱਡਦਰਸ਼ੀਕਰਨ"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ਵੱਲੋਂ ਬੈਟਰੀ ਦੀ ਵਰਤੋਂ ਕੀਤੀ ਜਾ ਰਹੀ ਹੈ"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ਐਪਾਂ ਬੈਟਰੀ ਦੀ ਵਰਤੋਂ ਕਰ ਰਹੀਆਂ ਹਨ"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"ਬੈਟਰੀ ਅਤੇ ਡਾਟਾ ਵਰਤੋਂ ਸਬੰਧੀ ਵੇਰਵਿਆਂ ਲਈ ਟੈਪ ਕਰੋ"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"ਨਵਾਂ: Window ਵੱਡਦਰਸ਼ੀ"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"ਹੁਣ ਤੁਸੀਂ ਕੁਝ ਜਾਂ ਪੂਰੀ ਸਕ੍ਰੀਨ ਵੱਡਦਰਸ਼ੀ ਕਰ ਸਕਦੇ ਹੋ"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"ਸੈਟਿੰਗਾਂ ਵਿੱਚ ਚਾਲੂ ਕਰੋ"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ਖਾਰਜ ਕਰੋ"</string>
</resources>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 427beb5..9534359 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Usługa GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Usługa powiadomień czujnika"</string>
<string name="twilight_service" msgid="8964898045693187224">"Usługa Zmierzch"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Wykrywanie strefy czasowej (brak połączenia)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Twoje urządzenie zostanie wyczyszczone"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Nie można użyć aplikacji administratora. Dane z urządzenia zostaną wykasowane.\n\nJeśli masz pytania, skontaktuj się z administratorem organizacji."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Drukowanie wyłączone przez: <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Połączenie USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Działa aplikacja"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikacje zużywające baterię"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Powiększenie"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Aplikacja <xliff:g id="APP_NAME">%1$s</xliff:g> zużywa baterię"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Liczba aplikacji zużywających baterię: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Kliknij, by wyświetlić szczegóły wykorzystania baterii i użycia danych"</string>
@@ -1846,7 +1846,7 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Zaktualizowany przez administratora"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Usunięty przez administratora"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"OK"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Aby wydłużyć czas pracy na baterii, funkcja Oszczędzanie baterii:\n\n•włącza tryb ciemny,\n• wyłącza lub ogranicza aktywność w tle, niektóre efekty wizualne oraz inne funkcje, np. „OK Google”.\n\n"<annotation id="url">"Więcej informacji"</annotation></string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Aby wydłużyć czas pracy na baterii, funkcja Oszczędzanie baterii:\n\n• włącza tryb ciemny,\n• wyłącza lub ogranicza aktywność w tle, niektóre efekty wizualne oraz inne funkcje, np. „OK Google”.\n\n"<annotation id="url">"Więcej informacji"</annotation></string>
<string name="battery_saver_description" msgid="6794188153647295212">"Aby wydłużyć czas pracy na baterii, Oszczędzanie baterii:\n\n• włącza tryb ciemny,\n• wyłącza lub ogranicza aktywność w tle, niektóre efekty wizualne oraz inne funkcje, np. „OK Google”."</string>
<string name="data_saver_description" msgid="4995164271550590517">"Oszczędzanie danych uniemożliwia niektórym aplikacjom wysyłanie i odbieranie danych w tle, zmniejszając w ten sposób ich użycie. Aplikacja, z której w tej chwili korzystasz, może uzyskiwać dostęp do danych, ale rzadziej. Może to powodować, że obrazy będą się wyświetlać dopiero po kliknięciu."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Włączyć Oszczędzanie danych?"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nowość: powiększanie okna"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Możesz teraz powiększyć część lub całość ekranu"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Włącz w Ustawieniach"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Odrzuć"</string>
</resources>
diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml
index 3fed028..8198a62 100644
--- a/core/res/res/values-pt-rBR/strings.xml
+++ b/core/res/res/values-pt-rBR/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Serviço de GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Serviço de notificações do sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Serviço de crepúsculo"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector de fuso horário (sem conectividade)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Seu dispositivo será limpo"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Não é possível usar o aplicativo para administrador. Seu dispositivo passará por uma limpeza agora.\n\nEm caso de dúvidas, entre em contato com o administrador da sua organização."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Impressão desativada por <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 1c890dd..71dd2b9 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Serviço GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Serviço de notificações do sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Serviço de crepúsculo"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detetor do fuso horário (sem conetividade)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"O seu dispositivo será apagado"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Não é possível utilizar a app de administrador. O seu dispositivo será agora apagado.\n\nSe tiver questões, contacte o administrador da entidade."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Impressão desativada por <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 3fed028..8198a62 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Serviço de GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Serviço de notificações do sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Serviço de crepúsculo"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector de fuso horário (sem conectividade)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Seu dispositivo será limpo"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Não é possível usar o aplicativo para administrador. Seu dispositivo passará por uma limpeza agora.\n\nEm caso de dúvidas, entre em contato com o administrador da sua organização."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Impressão desativada por <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index 5cf3076..4d091e9 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Serviciul GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Serviciu pentru notificări de la senzori"</string>
<string name="twilight_service" msgid="8964898045693187224">"Serviciul Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector de fus orar (fără conexiune)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Datele de pe dispozitiv vor fi șterse"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Aplicația de administrare nu poate fi utilizată. Dispozitivul va fi șters.\n\nDacă aveți întrebări, contactați administratorul organizației dvs."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Printare dezactivată de <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Conexiune USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplicația rulează"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplicațiile consumă bateria"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Mărire"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> folosește bateria"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplicații folosesc bateria"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Atingeți pentru mai multe detalii privind bateria și utilizarea datelor"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nou: lupă fereastră"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Acum puteți mări o parte sau tot ecranul"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Activați din Setări"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Respingeți"</string>
</resources>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index efd3c6c..783ec9a 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Служба GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Сервис для обработки уведомлений от датчиков"</string>
<string name="twilight_service" msgid="8964898045693187224">"Сервис для определения наступления сумерек"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Определитель часового пояса (работает без Интернета)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Все данные с устройства будут удалены"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Невозможно использовать приложение для администрирования. С устройства будут удалены все данные.\n\nЕсли у вас возникли вопросы, обратитесь к администратору."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Функция печати отключена приложением \"<xliff:g id="OWNER_APP">%s</xliff:g>\""</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-подключение"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Приложение активно"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Приложения, расходующие заряд"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Увеличение"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Приложение \"<xliff:g id="APP_NAME">%1$s</xliff:g>\" расходует заряд"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Несколько приложений (<xliff:g id="NUMBER">%1$d</xliff:g>) расходуют заряд"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Нажмите, чтобы проверить энергопотребление и трафик"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Новинка: экранная лупа"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Теперь можно увеличивать весь экран или его часть."</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Включить в настройках"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Закрыть"</string>
</resources>
diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml
index 100aed1..74b4008 100644
--- a/core/res/res/values-si/strings.xml
+++ b/core/res/res/values-si/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS සේවාව"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"සංවේදක දැනුම් දීමේ සේවාව"</string>
<string name="twilight_service" msgid="8964898045693187224">"ඇඳිරි සේවාව"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"වේලා කලාප අනාවරකය (සම්බන්ධතාවක් නොමැත)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"ඔබගේ උපාංගය මකා දැමෙනු ඇත"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"පරිපාලක යෙදුම භාවිතා කළ නොහැකිය. ඔබේ උපාංගය දැන් මකා දමනු ඇත.\n\nඔබට ප්රශ්න තිබේ නම්, ඔබේ සංවිධානයේ පරිපාලකට අමතන්න."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> විසින් මුද්රණය කිරීම අබල කර ඇත."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB සම්බන්ධතාවය"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"යෙදුම ධාවනය කරමින්"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"බැටරිය භාවිත කරන යෙදුම්"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"විශාලනය"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> බැටරිය භාවිත කරයි"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"යෙදුම් <xliff:g id="NUMBER">%1$d</xliff:g>ක් බැටරිය භාවිත කරයි"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"බැටරි හා දත්ත භාවිතය පිළිබඳව විස්තර සඳහා තට්ටු කරන්න"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"නව: කවුළු විශාලකය"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"ඔබට දැන් තිරයේ සමහර හෝ සියලු දේ විශාලනය කළ හැකිය"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"සැකසීම් තුළ ක්රියාත්මක කරන්න"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ඉවත ලන්න"</string>
</resources>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index f7756e5..74e2b69 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Služba GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Služba upozornení senzora"</string>
<string name="twilight_service" msgid="8964898045693187224">"Služba stmievania"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detektor časového pásma (bez pripojenia)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Vaše zariadenie bude vymazané"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Daná aplikácia na správu sa nedá použiť. Vaše zariadenie bude vymazané.\n\nV prípade otázok kontaktujte správcu organizácie."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Tlač zakázala aplikácia <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Pripojenie USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplikácia je spustená"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikácie spotrebúvajúce batériu"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Zväčšenie"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> používa batériu"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Aplikácie (<xliff:g id="NUMBER">%1$d</xliff:g>) používajú batériu"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Klepnutím zobrazíte podrobnosti o batérii a spotrebe dát"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Novinka: Lupa pre okná"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Teraz môžete zväčšiť celú obrazovku alebo jej časť"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Zapnúť v Nastaveniach"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Zavrieť"</string>
</resources>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index df7e0ee..755db5c 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Storitev GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Storitev obvestil tipal"</string>
<string name="twilight_service" msgid="8964898045693187224">"Storitev Somrak"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Zaznavanje časovnega pasu (brez povezave)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Podatki v napravi bodo izbrisani"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Skrbniške aplikacije ni mogoče uporabljati. Podatki v napravi bodo izbrisani.\n\nČe imate vprašanja, se obrnite na skrbnika organizacije."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Tiskanje je onemogočil pravilnik <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Povezava USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplikacija se izvaja"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikacije, ki porabljajo energijo baterije"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Povečava"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Aplikacija <xliff:g id="APP_NAME">%1$s</xliff:g> porablja energijo baterije"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Toliko aplikacij porablja energijo baterije: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Dotaknite se za prikaz podrobnosti porabe baterije in prenosa podatkov"</string>
@@ -1846,7 +1846,7 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Posodobil skrbnik"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Izbrisal skrbnik"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"V redu"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Funkcija varčevanja z energijo baterije podaljša čas delovanja baterije tako:\n\n•vklopi temno temo,\n•izklopi ali omeji dejavnost v ozadju, nekatere vizualne učinke in druge funkcije, kot je »Hey Google«.\n\n"<annotation id="url">"Več o tem"</annotation></string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Funkcija varčevanja z energijo baterije podaljša čas delovanja baterije tako:\n\n• vklopi temno temo,\n• izklopi ali omeji dejavnost v ozadju, nekatere vizualne učinke in druge funkcije, kot je »Hey Google«.\n\n"<annotation id="url">"Več o tem"</annotation></string>
<string name="battery_saver_description" msgid="6794188153647295212">"Funkcija varčevanja z energijo baterije podaljša čas delovanja baterije tako:\n\n• vklopi temno temo;\n• izklopi ali omeji dejavnost v ozadju, nekatere vizualne učinke in druge funkcije, kot je »Hey Google«."</string>
<string name="data_saver_description" msgid="4995164271550590517">"Zaradi zmanjševanja prenesene količine podatkov funkcija varčevanja s podatki nekaterim aplikacijam preprečuje, da bi v ozadju pošiljale ali prejemale podatke. Aplikacija, ki jo trenutno uporabljate, lahko prenaša podatke, vendar to morda počne manj pogosto. To na primer pomeni, da se slike ne prikažejo, dokler se jih ne dotaknete."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Vklop varčevanja s podatki?"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Novo: Lupa v oknu"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Zdaj lahko povečate del zaslona ali celotni zaslon"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Vklopite v nastavitvah"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Opusti"</string>
</resources>
diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml
index 8de3f8c..bd970a0 100644
--- a/core/res/res/values-sq/strings.xml
+++ b/core/res/res/values-sq/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Shërbimi GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Shërbimi i njoftimeve të sensorit"</string>
<string name="twilight_service" msgid="8964898045693187224">"Shërbimi i muzgut"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Zbuluesi i brezit orar (nuk nevojitet lidhja)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Pajisja do të spastrohet"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Aplikacioni i administratorit nuk mund të përdoret. Pajisja jote tani do të fshihet.\n\nNëse ke pyetje, kontakto me administratorin e organizatës."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Printimi është çaktivizuar nga <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Lidhja USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Aplikacioni është në ekzekutim"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Aplikacionet që konsumojnë baterinë"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Zmadhimi"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> po përdor baterinë"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> aplikacione po përdorin baterinë"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Trokit për detaje mbi baterinë dhe përdorimin e të dhënave"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Risi: Zmadhuesi i dritareve"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Tani mund t\'i zmadhosh një pjesë apo të gjithë ekranin tënd"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Aktivizo te \"Cilësimet\""</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Hiq"</string>
</resources>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index e403118..a3acb3d 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -201,6 +201,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS услуга"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Услуга обавештења сензора"</string>
<string name="twilight_service" msgid="8964898045693187224">"Услуга Сумрак"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Детектор временске зоне (нема интернет везе)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Уређај ће бити обрисан"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Не можете да користите ову апликацију за администраторе. Уређај ће сада бити обрисан.\n\nАко имате питања, контактирајте администратора организације."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Штампање је онемогућила апликација <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -290,8 +291,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB веза"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Активна апликација"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Апликације које троше батерију"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Увећање"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> користи батерију"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Апликације (<xliff:g id="NUMBER">%1$d</xliff:g>) користе батерију"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Додирните за детаље о батерији и потрошњи података"</string>
@@ -932,7 +932,7 @@
<string name="granularity_label_link" msgid="9007852307112046526">"линк"</string>
<string name="granularity_label_line" msgid="376204904280620221">"ред"</string>
<string name="factorytest_failed" msgid="3190979160945298006">"Фабричко тестирање није успело"</string>
- <string name="factorytest_not_system" msgid="5658160199925519869">"Радња FACTORY_TEST је подржана само за пакете инсталиране у директоријуму /system/app."</string>
+ <string name="factorytest_not_system" msgid="5658160199925519869">"Радња FACTORY_TEST је подржана само за пакете инсталиране у фолдеру /system/app."</string>
<string name="factorytest_no_action" msgid="339252838115675515">"Није пронађен ниједан пакет који обезбеђује радњу FACTORY_TEST."</string>
<string name="factorytest_reboot" msgid="2050147445567257365">"Рестартуј"</string>
<string name="js_dialog_title" msgid="7464775045615023241">"На страници на адреси „<xliff:g id="TITLE">%s</xliff:g>“ пише:"</string>
@@ -2048,7 +2048,7 @@
<string name="battery_saver_charged_notification_summary" product="default" msgid="5544457317418624367">"Батерија телефона је довољно напуњена. Функције више нису ограничене."</string>
<string name="battery_saver_charged_notification_summary" product="tablet" msgid="4426317048139996888">"Батерија таблета је довољно напуњена. Функције више нису ограничене."</string>
<string name="battery_saver_charged_notification_summary" product="device" msgid="1031562417867646649">"Батерија уређаја је довољно напуњена. Функције више нису ограничене."</string>
- <string name="mime_type_folder" msgid="2203536499348787650">"Директоријум"</string>
+ <string name="mime_type_folder" msgid="2203536499348787650">"Фолдер"</string>
<string name="mime_type_apk" msgid="3168784749499623902">"Android апликација"</string>
<string name="mime_type_generic" msgid="4606589110116560228">"Датотека"</string>
<string name="mime_type_generic_ext" msgid="9220220924380909486">"<xliff:g id="EXTENSION">%1$s</xliff:g> датотека"</string>
@@ -2224,12 +2224,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Ново: Лупа за прозор"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Можете да увећате део екрана или цео екран"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Укључите у Подешавањима"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Одбаци"</string>
</resources>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index cc21f39..ddd3faa 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS-tjänst"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensor Notification Service"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Tidszondetektering (ingen anslutning)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Enheten kommer att rensas"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Det går inte att använda administratörsappen. Enheten rensas.\n\nKontakta organisationens administratör om du har några frågor."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Utskrift har inaktiverats av <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB-anslutning"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"App körs"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Appar som drar batteri"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Förstoring"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> drar batteri"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> appar drar batteri"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Tryck för information om batteri- och dataanvändning"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Nyhet: Fönsterförstoring"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Nu kan du förstora delar av eller hela skärmen"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Aktivera i inställningarna"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Stäng"</string>
</resources>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 9478b0b..62b1c06 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Huduma ya GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Huduma ya Arifa ya Kitambuzi"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Kitambua Saa za Eneo (Hakuna muunganisho)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Data iliyomo kwenye kifaa chako itafutwa"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Huwezi kutumia programu ya msimamizi. Sasa data iliyo kwenye kifaa chako itafutwa.\n\nIkiwa una maswali yoyote, wasiliana na msimamizi wa shirika lako."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Kipengele cha kuchapisha kimezimwa na <xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Muunganisho wa USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Programu inaendelea kutekelezwa"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Programu zinazotumia betri"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Ukuzaji"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> inatumia betri"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Programu <xliff:g id="NUMBER">%1$d</xliff:g> zinatumia betri"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Gusa ili upate maelezo kuhusu betri na matumizi ya data"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Mpya: Kikuza Dirisha"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Sasa unaweza kukuza sehemu ya au skrini yako yote"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Washa katika Mipangilio"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Ondoa"</string>
</resources>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index ebaeadd..28a9cb7 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS சேவை"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"சென்சார் அறிவிப்புச் சேவை"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight சேவை"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"நேர மண்டல டிடெக்டர் (இணைப்பு இல்லை)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"சாதனத் தரவு அழிக்கப்படும்"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"நிர்வாகி ஆப்ஸை உபயோகிக்க முடியாது. இப்போது, உங்கள் சாதனம் ஆரம்ப நிலைக்கு மீட்டமைக்கப்படும்.\n\nஏதேனும் கேள்விகள் இருப்பின், உங்கள் நிறுவனத்தின் நிர்வாகியைத் தொடர்புகொள்ளவும்."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"பிரிண்ட் செய்வதை <xliff:g id="OWNER_APP">%s</xliff:g> தடுத்துள்ளது."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB இணைப்பு"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ஆப்ஸ் இயங்குகிறது"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"பேட்டரியைப் பயன்படுத்தும் ஆப்ஸ்"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"பெரிதாக்கல்"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ஆப்ஸ் பேட்டரியைப் பயன்படுத்துகிறது"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ஆப்ஸ் பேட்டரியைப் பயன்படுத்துகின்றன"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"பேட்டரி மற்றும் டேட்டா உபயோக விவரங்களைக் காண, தட்டவும்"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"புதிது: சாளரம் பெரிதாக்கும் கருவி"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"திரை முழுவதையுமோ ஒரு பகுதியையோ பெரிதாக்கலாம்"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"அமைப்புகளில் ஆன் செய்க"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"மூடுக"</string>
</resources>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index c63d175..f9e0934 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS సర్వీస్"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"సెన్సార్ నోటిఫికేషన్ సర్వీస్"</string>
<string name="twilight_service" msgid="8964898045693187224">"ట్విలైట్ సర్వీస్"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"టైమ్ జోన్ డిటెక్టర్ (కనెక్టివిటీ లేదు)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"మీ పరికరంలోని డేటా తొలగించబడుతుంది"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"నిర్వాహక యాప్ ఉపయోగించడం సాధ్యపడదు. మీ పరికరంలోని డేటా ఇప్పుడు తొలగించబడుతుంది.\n\nమీకు ప్రశ్నలు ఉంటే, మీ సంస్థ యొక్క నిర్వాహకులను సంప్రదించండి."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"ముద్రణ <xliff:g id="OWNER_APP">%s</xliff:g> ద్వారా నిలిపివేయబడింది."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB కనెక్షన్"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"యాప్ అమలవుతోంది"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"బ్యాటరీని ఉపయోగిస్తున్న యాప్లు"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"మాగ్నిఫికేషన్"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> బ్యాటరీని ఉపయోగిస్తోంది"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> యాప్లు బ్యాటరీని ఉపయోగిస్తున్నాయి"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"బ్యాటరీ మరియు డేటా వినియోగ వివరాల కోసం నొక్కండి"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"కొత్తది: విండో మాగ్నిఫయర్"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"స్క్రీన్ మొత్తం లేదా కొంత భాగాన్ని జూమ్ చేయవచ్చు"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"సెట్టింగ్లలో ఆన్ చేయండి"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"విస్మరించు"</string>
</resources>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index b0acb12..c23cf2b 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"บริการ GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"บริการแจ้งเตือนเกี่ยวกับเซ็นเซอร์"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight Service"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ตัวตรวจจับเขตเวลา (ไม่มีการเชื่อมต่อ)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"ระบบจะลบข้อมูลในอุปกรณ์ของคุณ"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"ใช้แอปผู้ดูแลระบบนี้ไม่ได้ ขณะนี้ระบบจะลบข้อมูลในอุปกรณ์ของคุณ\n\nโปรดติดต่อผู้ดูแลระบบขององค์กรหากมีคำถาม"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> ปิดใช้การพิมพ์แล้ว"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"การเชื่อมต่อ USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"แอปที่ทำงานอยู่"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"แอปหลายแอปกำลังใช้แบตเตอรี่"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"การขยาย"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> กำลังใช้แบตเตอรี่"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"แอป <xliff:g id="NUMBER">%1$d</xliff:g> แอปกำลังใช้แบตเตอรี่"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"แตะเพื่อดูรายละเอียดเกี่ยวกับแบตเตอรี่และปริมาณการใช้อินเทอร์เน็ต"</string>
@@ -1800,7 +1800,7 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"อัปเดตโดยผู้ดูแลระบบ"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"ลบโดยผู้ดูแลระบบ"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"ตกลง"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"โหมดประหยัดแบตเตอรี่จะดำเนินการดังต่อไปนี้เพื่อยืดอายุการใช้งานแบตเตอรี่\n\n• เปิดธีมมืด\n•ปิดหรือจำกัดกิจกรรมในเบื้องหลัง เอฟเฟกต์ภาพบางอย่าง และฟีเจอร์อื่นๆ อย่างเช่น “Ok Google”\n\n"<annotation id="url">"ดูข้อมูลเพิ่มเติม"</annotation></string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"โหมดประหยัดแบตเตอรี่จะดำเนินการดังต่อไปนี้เพื่อยืดอายุการใช้งานแบตเตอรี่\n\n• เปิดธีมมืด\n• ปิดหรือจำกัดกิจกรรมในเบื้องหลัง เอฟเฟกต์ภาพบางอย่าง และฟีเจอร์อื่นๆ อย่างเช่น “Ok Google”\n\n"<annotation id="url">"ดูข้อมูลเพิ่มเติม"</annotation></string>
<string name="battery_saver_description" msgid="6794188153647295212">"โหมดประหยัดแบตเตอรี่จะดำเนินการดังต่อไปนี้เพื่อยืดอายุการใช้งานแบตเตอรี่\n\n• เปิดธีมมืด\n• ปิดหรือจำกัดกิจกรรมในเบื้องหลัง เอฟเฟกต์ภาพบางอย่าง และฟีเจอร์อื่นๆ อย่างเช่น \"Ok Google\""</string>
<string name="data_saver_description" msgid="4995164271550590517">"เพื่อช่วยลดปริมาณการใช้อินเทอร์เน็ต โปรแกรมประหยัดอินเทอร์เน็ตจะช่วยป้องกันไม่ให้บางแอปส่งหรือรับข้อมูลโดยการใช้อินเทอร์เน็ตอยู่เบื้องหลัง แอปที่คุณกำลังใช้งานสามารถเข้าถึงอินเทอร์เน็ตได้ แต่อาจไม่บ่อยเท่าเดิม ตัวอย่างเช่น ภาพต่างๆ จะไม่แสดงจนกว่าคุณจะแตะที่ภาพเหล่านั้น"</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"เปิดการประหยัดอินเทอร์เน็ตไหม"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"ใหม่: แว่นขยายหน้าต่าง"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"คุณสามารถขยายหน้าจอบางส่วนหรือทั้งหมดได้แล้วตอนนี้"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"เปิดในการตั้งค่า"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"ปิด"</string>
</resources>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index f04e7e1..8a6ad7e 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Serbisyo ng GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Serbisyo ng Notification ng Sensor"</string>
<string name="twilight_service" msgid="8964898045693187224">"Serbisyo ng Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Detector ng Time Zone (Walang koneksyon)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Buburahin ang iyong device"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Hindi magamit ang admin app. Mabubura na ang iyong device.\n\nKung mayroon kang mga tanong, makipag-ugnayan sa admin ng iyong organisasyon."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Na-disable ng <xliff:g id="OWNER_APP">%s</xliff:g> ang pag-print."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Koneksyon ng USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Tumatakbo ang app"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Mga app na kumokonsumo ng baterya"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Pag-magnify"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Gumagamit ng baterya ang <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Gumagamit ng baterya ang <xliff:g id="NUMBER">%1$d</xliff:g> (na) app"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"I-tap para sa mga detalye tungkol sa paggamit ng baterya at data"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Bago: Magnifier ng Window"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Mama-magnify na ang bahagi o kabuuan ng screen mo"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"I-on sa Mga Setting"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"I-dismiss"</string>
</resources>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 79cfe19..d31d7e9 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS Hizmeti"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensör Bildirim Hizmeti"</string>
<string name="twilight_service" msgid="8964898045693187224">"Alacakaranlık Hizmeti"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Zaman Dilimi Algılayıcı (Bağlantı yok)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Cihazınız silinecek"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Yönetim uygulaması kullanılamıyor. Cihazınız şimdi silinecek.\n\nSorularınız varsa kuruluşunuzun yöneticisine başvurun."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Yazdırma işlemi <xliff:g id="OWNER_APP">%s</xliff:g> tarafından devre dışı bırakıldı."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB bağlantısı"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Uygulama çalışıyor"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Pil kullanan uygulamalar"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Büyütme"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> pil kullanıyor"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> uygulama pil kullanıyor"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Pil ve veri kullanımı ile ilgili ayrıntılar için dokunun"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Yeni: Pencere Büyüteci"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Artık ekranınızın bir kısmını veya tamamını büyütebilirsiniz"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Ayarlar\'da aç"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Kapat"</string>
</resources>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index a752010..2352584 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -203,6 +203,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Сервіс GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Сервіс \"Сповіщення датчика\""</string>
<string name="twilight_service" msgid="8964898045693187224">"Сервіс \"Сутінки\""</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Визначення часового поясу (без Інтернету)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"З вашого пристрою буде стерто всі дані"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Не можна запускати додаток для адміністраторів. Буде відновлено заводські налаштування пристрою.\n\nЯкщо у вас є запитання, зв’яжіться з адміністратором своєї організації."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Додаток <xliff:g id="OWNER_APP">%s</xliff:g> вимкнув друк."</string>
@@ -293,8 +294,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"З’єднання USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Працює додаток"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Додатки, що використовують заряд акумулятора"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Збільшення"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"Додаток <xliff:g id="APP_NAME">%1$s</xliff:g> використовує заряд акумулятора"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"Додатків, що використовують заряд акумулятора: <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Торкніться, щоб перевірити використання акумулятора й трафік"</string>
@@ -2258,12 +2258,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Нове: збільшення вікон"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Тепер можна збільшити весь екран або його частину"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Увімкнути в налаштуваннях"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Закрити"</string>
</resources>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index 4324e36..68572d8 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS سروس"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"سینسر نوٹیفکیشن سروس"</string>
<string name="twilight_service" msgid="8964898045693187224">"شفقی سروس"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"ٹائم زون ڈیٹیکٹر (کوئی کنیکٹوٹی نہیں ہے)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"آپ کا آلہ صاف کر دیا جائے گا"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"منتظم کی ایپ استعمال نہیں کی جا سکتی۔ آپ کا آلہ اب مٹا دیا جائے گا۔\n\nاگر آپ کے سوالات ہیں تو اپنی تنظیم کے منتظم سے رابطہ کریں۔"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> نے پرنٹنگ کو غیر فعال کر دیا ہے۔"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB کنکشن"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"ایپ چل رہی ہے"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"ایپس بیٹری خرچ کر رہی ہیں"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"میگنیفکیشن"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> بیٹری کا استعمال کر رہی ہے"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ایپس بیٹری کا استعمال کر رہی ہیں"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"بیٹری اور ڈیٹا استعمال کے بارے میں تفصیلات کے لیے تھپتھپائیں"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"نیا: ونڈو میگنیفائر"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"اب آپ اپنی تمام یا کچھ اسکرین کو بڑا کر سکتے ہیں"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"ترتیبات میں آن کریں"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"برخاست کریں"</string>
</resources>
diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml
index 923831c..423669d 100644
--- a/core/res/res/values-uz/strings.xml
+++ b/core/res/res/values-uz/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS xizmati"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Sensorli bildirishnoma xizmati"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight xizmati"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Vaqt mintaqasini aniqlagich (Oflayn)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Qurilmangizdagi ma’lumotlar o‘chirib tashlanadi"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Administrator ilovasini ishlatib bo‘lmaydi. Qurilmada barcha ma’lumotlar o‘chirib tashlanadi.\n\nSavollaringiz bo‘lsa, administrator bilan bog‘laning."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Chop etish funksiyasi <xliff:g id="OWNER_APP">%s</xliff:g> tomonidan faolsizlantirilgan."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB orqali ulanish"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Ilova faol"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Batareya quvvatini sarflayotgan ilovalar"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Kattalashtirish"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> ilovasi batareya quvvatini sarflamoqda"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ta ilova batareya quvvatini sarflamoqda"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Batareya va trafik sarfi tafsilotlari uchun ustiga bosing"</string>
@@ -593,7 +593,7 @@
<string name="face_acquired_too_right" msgid="2513391513020932655">"Telefonni chapga suring."</string>
<string name="face_acquired_too_left" msgid="8882499346502714350">"Telefonni oʻngga suring."</string>
<string name="face_acquired_poor_gaze" msgid="4427153558773628020">"Qurilmaga tik qarang."</string>
- <string name="face_acquired_not_detected" msgid="2945945257956443257">"Telefoningizga yuzingizni tik tuting."</string>
+ <string name="face_acquired_not_detected" msgid="2945945257956443257">"Telefonni yuzingizga tik qarating."</string>
<string name="face_acquired_too_much_motion" msgid="8199691445085189528">"Ortiqcha harakatlanmoqda. Qimirlatmasdan ushlang."</string>
<string name="face_acquired_recalibrate" msgid="8724013080976469746">"Yuzingizni qaytadan qayd qildiring."</string>
<string name="face_acquired_too_different" msgid="4699657338753282542">"Yuz tanilmadi. Qaytadan urining."</string>
@@ -1800,7 +1800,7 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Administrator tomonidan yangilangan"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Administrator tomonidan o‘chirilgan"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"OK"</string>
- <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Batareya quvvatini uzaytirish uchun Quvvat tejash funksiyasi:\n\n• Tungi mavzuni yoqadi\n• Fondagi harakatlar, vizual effektlar va “Hey Google” kabi boshqa funksiyalarni faolsizlantiradi\n\n"<annotation id="url">"Batafsil"</annotation></string>
+ <string name="battery_saver_description_with_learn_more" msgid="4424488535318105801">"Batareya quvvatini uzaytirish uchun Quvvat tejash funksiyasi:\n\n• Tungi mavzuni yoqadi\n• Fondagi harakatlar, vizual effektlar va “Ok Google” kabi boshqa funksiyalarni faolsizlantiradi\n\n"<annotation id="url">"Batafsil"</annotation></string>
<string name="battery_saver_description" msgid="6794188153647295212">"Batareya quvvatini uzaytirish uchun Quvvat tejash funksiyasi:\n\n• Tungi mavzuni yoqadi\n• Fondagi harakatlar, vizual effektlar va “Ok Google” kabi boshqa funksiyalarni faolsizlantiradi"</string>
<string name="data_saver_description" msgid="4995164271550590517">"Trafik tejash rejimida ayrim ilovalar uchun orqa fonda internetdan foydalanish imkoniyati cheklanadi. Siz ishlatayotgan ilova zaruratga qarab internet-trafik sarflashi mumkin, biroq cheklangan miqdorda. Masalan, rasmlar ustiga bosmaguningizcha ular yuklanmaydi."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Trafik tejash yoqilsinmi?"</string>
@@ -1894,7 +1894,7 @@
<string name="app_suspended_title" msgid="888873445010322650">"Ilova ishlamayapti"</string>
<string name="app_suspended_default_message" msgid="6451215678552004172">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> ishlamayapti. Uning ishlashini <xliff:g id="APP_NAME_1">%2$s</xliff:g> cheklamoqda."</string>
<string name="app_suspended_more_details" msgid="211260942831587014">"Batafsil"</string>
- <string name="app_suspended_unsuspend_message" msgid="1665438589450555459">"Ilovani ishga tushirish"</string>
+ <string name="app_suspended_unsuspend_message" msgid="1665438589450555459">"Ilovani pauzadan chiqarish"</string>
<string name="work_mode_off_title" msgid="5503291976647976560">"Ish profili yoqilsinmi?"</string>
<string name="work_mode_off_message" msgid="8417484421098563803">"Ishga oid ilovalar, bildirishnomalar, ma’lumotlar va boshqa ish profili imkoniyatlari yoqiladi"</string>
<string name="work_mode_turn_on" msgid="3662561662475962285">"Yoqish"</string>
@@ -2009,7 +2009,7 @@
<string name="notification_feedback_indicator" msgid="663476517711323016">"Fikr-mulohaza yuborish"</string>
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"Kun tartibi rejimi haqidagi bildirishnoma"</string>
<string name="dynamic_mode_notification_title" msgid="9205715501274608016">"Batareya quvvati odatdagidan ertaroq tugashi mumkin"</string>
- <string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Batareya quvvati uzoqroq ishlashi uchun Tejamkor rejim yoqildi"</string>
+ <string name="dynamic_mode_notification_summary" msgid="4141614604437372157">"Batareya quvvatini uzoqroq vaqtga yetkazish uchun quvvat tejash rejimi yoqildi"</string>
<string name="battery_saver_notification_channel_name" msgid="3918243458067916913">"Quvvat tejash"</string>
<string name="battery_saver_off_notification_title" msgid="7637255960468032515">"Quvvat tejash rejimi faolsizlantirildi"</string>
<string name="battery_saver_charged_notification_summary" product="default" msgid="5544457317418624367">"Telefon yetarli quvvatlandi. Funksiyalar endi cheklovlarsiz ishlaydi."</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Yangi: Ekran lupasi"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Ekranni toʻliq yoki qisman kattalashtirish mumkin"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Sozlamalar orqali yoqish"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Yopish"</string>
</resources>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 296261f..7533196 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Dịch vụ GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Dịch vụ Thông báo của cảm biến"</string>
<string name="twilight_service" msgid="8964898045693187224">"Dịch vụ Twilight"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Trình phát hiện múi giờ (Không có kết nối)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Thiết bị của bạn sẽ bị xóa"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Không thể sử dụng ứng dụng quản trị. Thiết bị của bạn sẽ bị xóa ngay bây giờ.\n\nHãy liên hệ với quản trị viên của tổ chức nếu bạn có thắc mắc."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"<xliff:g id="OWNER_APP">%s</xliff:g> đã tắt tính năng in."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Kết nối USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Ứng dụng đang chạy"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Các ứng dụng tiêu thụ pin"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Phóng to"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> đang sử dụng pin"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> ứng dụng đang sử dụng pin"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Nhấn để biết chi tiết về mức sử dụng dữ liệu và pin"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Tính năng mới: Phóng to cửa sổ"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Giờ đây, bạn có thể phóng to một phần hoặc toàn màn hình"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Bật trong phần Cài đặt"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Đóng"</string>
</resources>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index a27e7b1..811992e 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS 服务"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"传感器通知服务"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight 服务"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"时区检测器(无网络连接)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"系统将清空您的设备"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"无法使用管理应用,系统现在将清空您的设备。\n\n如有疑问,请与您所在单位的管理员联系。"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"“<xliff:g id="OWNER_APP">%s</xliff:g>”已停用打印功能。"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB 连接"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"应用正在运行中"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"消耗电量的应用"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"放大功能"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g>正在消耗电量"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> 个应用正在消耗电量"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"点按即可详细了解电量和流量消耗情况"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"新功能:窗口放大镜"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"您现在可以放大屏幕上的部分或所有内容"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"在“设置”中开启"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"关闭"</string>
</resources>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index 5099ebf..25807ca 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS 服務"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"感應器通知服務"</string>
<string name="twilight_service" msgid="8964898045693187224">"暮光服務"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"時區偵測器 (沒有連線)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"您的裝置將被清除"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"無法使用管理員應用程式。系統會現在清除您的裝置。\n\n如有任何疑問,請聯絡您的機構管理員。"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"「<xliff:g id="OWNER_APP">%s</xliff:g>」暫停了列印。"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB 連線"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"應用程式正在執行"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"耗用電量的應用程式"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"放大"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」正在使用電量"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> 個應用程式正在使用電量"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"輕按即可查看電池和數據用量詳情"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"新功能:視窗放大鏡"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"您現在可以放大部分或整個畫面"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"在「設定」中開啟"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"關閉"</string>
</resources>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 31bd99b..238a890 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"GNSS 服務"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"感應器通知服務"</string>
<string name="twilight_service" msgid="8964898045693187224">"Twilight 服務"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"時區偵測器 (不必連上網路)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"你的裝置資料將遭到清除"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"無法使用管理應用程式,系統現在將清除你裝置中的資料。\n\n如有任何問題,請與貴機構的管理員聯絡。"</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"「<xliff:g id="OWNER_APP">%s</xliff:g>」已停用列印功能。"</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"USB 連線"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"應用程式執行中"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"正在耗用電量的應用程式"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"放大"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"「<xliff:g id="APP_NAME">%1$s</xliff:g>」正在耗用電量"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> 個應用程式正在耗用電量"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"輕觸即可查看電池和數據用量詳情"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"新功能:視窗放大鏡"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"你可以放大局部或整個畫面"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"在「設定」中開啟"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"關閉"</string>
</resources>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 28eed9b..6a23502 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -199,6 +199,7 @@
<string name="gnss_service" msgid="8907781262179951385">"Isevisi ye-GNSS"</string>
<string name="sensor_notification_service" msgid="7474531979178682676">"Isevisi Yesaziso Senzwa"</string>
<string name="twilight_service" msgid="8964898045693187224">"Isevisi Yangovivi"</string>
+ <string name="offline_location_time_zone_detection_service_attribution" msgid="303754195048744816">"Isitholi Sezoni Yesikhathi (Akukho ukuxhumana)"</string>
<string name="factory_reset_warning" msgid="6858705527798047809">"Idivayisi yakho izosulwa"</string>
<string name="factory_reset_message" msgid="2657049595153992213">"Uhlelo lokusebenza lomlawuli alikwazi ukusetshenziswa. Idivayisi yakho manje izosuswa.\n\nUma unemibuzo, xhumana nomlawuli wezinhlangano zakho."</string>
<string name="printing_disabled_by" msgid="3517499806528864633">"Ukuphrinta kukhutshazwe nge-<xliff:g id="OWNER_APP">%s</xliff:g>."</string>
@@ -287,8 +288,7 @@
<string name="notification_channel_usb" msgid="1528280969406244896">"Ukuxhumeka kwe-USB"</string>
<string name="notification_channel_heavy_weight_app" msgid="17455756500828043">"Uhlelo loksuebenza olusebenzayo"</string>
<string name="notification_channel_foreground_service" msgid="7102189948158885178">"Izinhlelo zokusebenza ezidla ibhethri"</string>
- <!-- no translation found for notification_channel_accessibility_magnification (1707913872219798098) -->
- <skip />
+ <string name="notification_channel_accessibility_magnification" msgid="1707913872219798098">"Ukukhuliswa"</string>
<string name="foreground_service_app_in_background" msgid="1439289699671273555">"<xliff:g id="APP_NAME">%1$s</xliff:g> isebenzisa ibhethri"</string>
<string name="foreground_service_apps_in_background" msgid="7340037176412387863">"<xliff:g id="NUMBER">%1$d</xliff:g> izinhlelo zokusebenza zisebenzisa ibhethri"</string>
<string name="foreground_service_tap_for_details" msgid="9078123626015586751">"Thepha ngemininingwane ekusetshenzisweni kwebhethri nedatha"</string>
@@ -817,7 +817,7 @@
<string name="relationTypeReferredBy" msgid="5285082289602849400">"Kusikiselwe ngu-"</string>
<string name="relationTypeRelative" msgid="3396498519818009134">"Isihlobo"</string>
<string name="relationTypeSister" msgid="3721676005094140671">"Usisi"</string>
- <string name="relationTypeSpouse" msgid="6916682664436031703">"Umlingane"</string>
+ <string name="relationTypeSpouse" msgid="6916682664436031703">"Umlingani"</string>
<string name="sipAddressTypeCustom" msgid="6283889809842649336">"Ngokwezifiso"</string>
<string name="sipAddressTypeHome" msgid="5918441930656878367">"Ekhaya"</string>
<string name="sipAddressTypeWork" msgid="7873967986701216770">"Umsebenzi"</string>
@@ -2190,12 +2190,8 @@
<string name="config_pdp_reject_user_authentication_failed" msgid="4531693033885744689"></string>
<string name="config_pdp_reject_service_not_subscribed" msgid="8190338397128671588"></string>
<string name="config_pdp_reject_multi_conn_to_same_pdn_not_allowed" msgid="6024904218067254186"></string>
- <!-- no translation found for window_magnification_prompt_title (8197528399699536320) -->
- <skip />
- <!-- no translation found for window_magnification_prompt_content (4166711383253283838) -->
- <skip />
- <!-- no translation found for turn_on_magnification_settings_action (8521433346684847700) -->
- <skip />
- <!-- no translation found for dismiss_action (1728820550388704784) -->
- <skip />
+ <string name="window_magnification_prompt_title" msgid="8197528399699536320">"Okusha: Isikhulisi sewindi"</string>
+ <string name="window_magnification_prompt_content" msgid="4166711383253283838">"Manje usungakwazi ukukhulisa esinye noma sonke isikrini sakho"</string>
+ <string name="turn_on_magnification_settings_action" msgid="8521433346684847700">"Vula Kumasethingi"</string>
+ <string name="dismiss_action" msgid="1728820550388704784">"Cashisa"</string>
</resources>
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 85b19e7..060c8b1 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -226,6 +226,9 @@
to share specific features explicitly because they are being built
together. -->
<flag name="signatureOrSystem" value="3" />
+ <!-- <strong>Base permission type</strong>: a permission that is managed internally by the
+ system and only granted according to the protection flags. -->
+ <flag name="internal" value="4" />
<!-- Additional flag from base permission type: this permission can also
be granted to any applications installed as privileged apps on the system image.
Please avoid using this option, as the
@@ -306,6 +309,8 @@
<!-- Additional flag from base permission type: this permission will be granted to the
recents app. -->
<flag name="recents" value="0x2000000" />
+ <!-- Additional flag from base permission type: this permission is managed by role. -->
+ <flag name="role" value="0x4000000" />
</attr>
<!-- Flags indicating more context for a permission group. -->
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 40e11cb..fab65d0 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -654,10 +654,9 @@
The default is false. -->
<bool name="config_lidControlsSleep">false</bool>
- <!-- Indicate whether closing the lid causes the device to enter the folded state which means
- to get a smaller screen and opening the lid causes the device to enter the unfolded state
- which means to get a larger screen. -->
- <bool name="config_lidControlsDisplayFold">false</bool>
+ <!-- The device state (supplied by DeviceStateManager) that should be treated as folded by the
+ display fold controller. Default is DeviceStateManager.INVALID_DEVICE_STATE. -->
+ <integer name="config_foldedDeviceState">-1</integer>
<!-- Indicate the display area rect for foldable devices in folded state. -->
<string name="config_foldedArea"></string>
@@ -3303,6 +3302,10 @@
is non-interactive. -->
<bool name="config_cameraDoubleTapPowerGestureEnabled">true</bool>
+ <!-- Allow the gesture to quick tap the power button multiple times to start the emergency sos
+ experience while the device is non-interactive. -->
+ <bool name="config_emergencyGestureEnabled">true</bool>
+
<!-- Allow the gesture power + volume up to change the ringer mode while the device
is interactive. -->
<bool name="config_volumeHushGestureEnabled">true</bool>
@@ -4570,6 +4573,6 @@
<!-- Indicates that default fitness tracker app needs to request sensor and location permissions. -->
<bool name="config_trackerAppNeedsPermissions">false</bool>
- <!-- Component with platform query permissions for AppSearch -->
- <string name="config_defaultAppSearchPlatformQuerierComponent" translatable="false"></string>
+ <!-- Package with global data query permissions for AppSearch -->
+ <string name="config_globalAppSearchDataQuerierPackage" translatable="false"></string>
</resources>
diff --git a/core/res/res/values/dimens_car.xml b/core/res/res/values/dimens_car.xml
index 2c4f4c8..c3cd80b 100644
--- a/core/res/res/values/dimens_car.xml
+++ b/core/res/res/values/dimens_car.xml
@@ -84,6 +84,14 @@
<dimen name="car_button_radius">@dimen/car_radius_1</dimen>
<dimen name="car_pill_button_size">56dp</dimen>
<dimen name="car_touch_target_size">76dp</dimen>
+ <dimen name="car_touch_target_size_minus_one">75dp</dimen>
+
+ <!-- Switch. -->
+ <!-- Thumb size + 2*thumb margin size must equal car_touch_target_size -->
+ <!-- 2 * Thumb size + 2*track margin size must equal car_touch_target_size -->
+ <dimen name="car_switch_thumb_size">24dp</dimen>
+ <dimen name="car_switch_thumb_margin_size">26dp</dimen>
+ <dimen name="car_switch_track_margin_size">14dp</dimen>
<!-- Seekbar -->
<dimen name="car_seekbar_height">6dp</dimen>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 89b986b..31aee4a 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -928,6 +928,15 @@
interfere with the performance or operation of your device when an
emergency cell broadcast is received.</string>
+ <!-- Title for an application which grants an app the ability to see and manage calls on
+ the user's device. Usually reserved for apps associated with wearable devices that
+ can show information about calls. -->
+ <string name="permlab_manageOngoingCalls">Manage ongoing calls</string>
+ <!-- Description of an application permission, listed so the user can choose whether they
+ want to allow the application to do this. -->
+ <string name="permdesc_manageOngoingCalls">Allows an app to see details about ongoing calls
+ on your device and to control these calls.</string>
+
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_readCellBroadcasts">read cell broadcast messages</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index e50eee6..611808d 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2823,6 +2823,7 @@
<java-symbol type="bool" name="config_cameraDoubleTapPowerGestureEnabled" />
<java-symbol type="integer" name="config_cameraLiftTriggerSensorType" />
<java-symbol type="string" name="config_cameraLiftTriggerSensorStringType" />
+ <java-symbol type="bool" name="config_emergencyGestureEnabled" />
<java-symbol type="bool" name="config_volumeHushGestureEnabled" />
<java-symbol type="drawable" name="platlogo_m" />
@@ -3701,7 +3702,7 @@
<java-symbol type="string" name="config_customCountryDetector" />
<!-- For Foldables -->
- <java-symbol type="bool" name="config_lidControlsDisplayFold" />
+ <java-symbol type="integer" name="config_foldedDeviceState" />
<java-symbol type="string" name="config_foldedArea" />
<java-symbol type="array" name="config_disableApksUnlessMatchedSku_apk_list" />
@@ -4115,8 +4116,8 @@
<java-symbol type="bool" name="config_trackerAppNeedsPermissions"/>
- <!-- Component with platform query permissions for AppSearch -->
- <java-symbol type="string" name="config_defaultAppSearchPlatformQuerierComponent" />
+ <!-- Package with global data query permissions for AppSearch -->
+ <java-symbol type="string" name="config_globalAppSearchDataQuerierPackage" />
<!-- Color used by the accessibility focus rectangle -->
<java-symbol type="color" name="accessibility_focus_highlight_color" />
diff --git a/core/tests/ConnectivityManagerTest/OWNERS b/core/tests/ConnectivityManagerTest/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/core/tests/ConnectivityManagerTest/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/core/tests/PackageInstallerSessions/OWNERS b/core/tests/PackageInstallerSessions/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/core/tests/PackageInstallerSessions/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
new file mode 100644
index 0000000..ade97b8
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
@@ -0,0 +1,13 @@
+android_test {
+ name: "BatteryStatsLoadTests",
+ srcs: ["src/**/*.java"],
+ static_libs: [
+ "androidx.test.rules",
+ "androidx.test.ext.junit",
+ "compatibility-device-util-axt",
+ "junit",
+ ],
+ libs: ["android.test.runner"],
+ platform_apis: true,
+ certificate: "platform",
+}
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/AndroidManifest.xml b/core/tests/batterystatstests/BatteryStatsLoadTests/AndroidManifest.xml
new file mode 100644
index 0000000..adc20c6
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/AndroidManifest.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.frameworks.core.batterystatsloadtests">
+
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+ <uses-permission android:name="android.permission.BATTERY_STATS"/>
+ <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
+ <uses-permission android:name="android.permission.DEVICE_POWER"/>
+ <uses-permission android:name="android.permission.INTERNET"/>
+
+ <instrumentation
+ android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="com.android.frameworks.core.batterystatsloadtests"
+ android:label="Power Stats Load Tests" />
+
+ <queries>
+ <!-- The load test resolves http://... intents. Let it do so. -->
+ <package android:name="com.android.chrome"/>
+ </queries>
+</manifest>
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/ConnectivitySetupRule.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/ConnectivitySetupRule.java
new file mode 100644
index 0000000..1afc22b7
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/ConnectivitySetupRule.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsloadtests;
+
+import static org.junit.Assert.assertEquals;
+
+import android.app.Instrumentation;
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.LinkProperties;
+import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.net.NetworkRequest;
+import android.net.wifi.WifiManager;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.compatibility.common.util.SystemUtil;
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class ConnectivitySetupRule implements TestRule {
+
+ private final boolean mWifiEnabled;
+ private final ConnectivityManager mConnectivityManager;
+ private final WifiManager mWifiManager;
+ private boolean mInitialWifiState;
+
+ public ConnectivitySetupRule(boolean wifiEnabled) {
+ mWifiEnabled = wifiEnabled;
+
+ Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+ Context context = instrumentation.getContext();
+ mConnectivityManager = context.getSystemService(ConnectivityManager.class);
+ mWifiManager = context.getSystemService(WifiManager.class);
+ }
+
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ try {
+ mInitialWifiState = isWiFiConnected();
+ setWiFiState(mWifiEnabled);
+ base.evaluate();
+ } finally {
+ setWiFiState(mInitialWifiState);
+ }
+ }
+ };
+ }
+
+ private void setWiFiState(final boolean enable) throws InterruptedException {
+ boolean wiFiConnected = isWiFiConnected();
+ if (enable == wiFiConnected) {
+ return;
+ }
+
+ NetworkTracker tracker = new NetworkTracker(!mWifiEnabled);
+ mConnectivityManager.registerNetworkCallback(
+ new NetworkRequest.Builder()
+ .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED).build(),
+ tracker);
+
+ if (enable) {
+ SystemUtil.runShellCommand("svc wifi enable");
+ //noinspection deprecation
+ SystemUtil.runWithShellPermissionIdentity(mWifiManager::reconnect,
+ android.Manifest.permission.NETWORK_SETTINGS);
+ } else {
+ SystemUtil.runShellCommand("svc wifi disable");
+ }
+
+ tracker.waitForExpectedState();
+
+ assertEquals("Wifi must be " + (enable ? "connected to" : "disconnected from")
+ + " an access point for this test.", enable, isWiFiConnected());
+
+ mConnectivityManager.unregisterNetworkCallback(tracker);
+ }
+
+ private boolean isWiFiConnected() {
+ return mWifiManager.isWifiEnabled() && mConnectivityManager.getActiveNetwork() != null
+ && !mConnectivityManager.isActiveNetworkMetered();
+ }
+
+ private class NetworkTracker extends ConnectivityManager.NetworkCallback {
+ private static final int MSG_CHECK_ACTIVE_NETWORK = 1;
+
+ private final CountDownLatch mReceiveLatch = new CountDownLatch(1);
+
+ private final boolean mExpectedMetered;
+
+ private final Handler mHandler = new Handler(Looper.getMainLooper()) {
+ @Override
+ public void handleMessage(Message msg) {
+ if (msg.what == MSG_CHECK_ACTIVE_NETWORK) {
+ checkActiveNetwork();
+ }
+ }
+ };
+
+ private NetworkTracker(boolean expectedMetered) {
+ mExpectedMetered = expectedMetered;
+ }
+
+ @Override
+ public void onAvailable(Network network, NetworkCapabilities networkCapabilities,
+ LinkProperties linkProperties, boolean blocked) {
+ checkActiveNetwork();
+ }
+
+ @Override
+ public void onLost(Network network) {
+ checkActiveNetwork();
+ }
+
+ boolean waitForExpectedState() throws InterruptedException {
+ checkActiveNetwork();
+ return mReceiveLatch.await(60, TimeUnit.SECONDS);
+ }
+
+ private void checkActiveNetwork() {
+ if (mReceiveLatch.getCount() == 0) {
+ return;
+ }
+
+ if (mConnectivityManager.getActiveNetwork() != null
+ && mConnectivityManager.isActiveNetworkMetered() == mExpectedMetered) {
+ mReceiveLatch.countDown();
+ } else {
+ mHandler.sendEmptyMessageDelayed(MSG_CHECK_ACTIVE_NETWORK, 5000);
+ }
+ }
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetrics.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetrics.java
new file mode 100644
index 0000000..dbe5773
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetrics.java
@@ -0,0 +1,278 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsloadtests;
+
+import android.os.Process;
+
+import com.android.internal.os.BatterySipper;
+import com.android.internal.os.BatteryStatsHelper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PowerMetrics {
+ private static final String PACKAGE_CALENDAR_PROVIDER = "com.android.providers.calendar";
+ private static final String PACKAGE_MEDIA_PROVIDER = "com.android.providers.media";
+ private static final String PACKAGE_SYSTEMUI = "com.android.systemui";
+ private static final String[] PACKAGES_SYSTEM = {PACKAGE_MEDIA_PROVIDER,
+ PACKAGE_CALENDAR_PROVIDER, PACKAGE_SYSTEMUI};
+
+ enum MetricKind {
+ POWER,
+ DURATION,
+ }
+
+ public static final String METRIC_APP_POWER = "appPower";
+ public static final String METRIC_APP_POWER_EXCLUDE_SYSTEM_FROM_TOTAL = "appPowerExcludeSystem";
+ public static final String METRIC_APP_POWER_EXCLUDE_SMEARED = "appPowerExcludeSmeared";
+ public static final String METRIC_SCREEN_POWER = "screenPower";
+ public static final String METRIC_WIFI_POWER = "wifiPower";
+ public static final String METRIC_SYSTEM_SERVICE_CPU_POWER = "systemService";
+ public static final String METRIC_OTHER_POWER = "otherPower";
+ public static final String METRIC_CPU_POWER = "cpuPower";
+ public static final String METRIC_RAM_POWER = "ramPower";
+ public static final String METRIC_WAKELOCK_POWER = "wakelockPower";
+ public static final String METRIC_MOBILE_RADIO_POWER = "mobileRadioPower";
+ public static final String METRIC_BLUETOOTH_POWER = "bluetoothPower";
+ public static final String METRIC_GPS_POWER = "gpsPower";
+ public static final String METRIC_CAMERA_POWER = "cameraPower";
+ public static final String METRIC_FLASHLIGHT_POWER = "flashlightPower";
+ public static final String METRIC_SENSORS_POWER = "sensorsPower";
+ public static final String METRIC_AUDIO_POWER = "audioPower";
+ public static final String METRIC_VIDEO_POWER = "videoPower";
+ public static final String METRIC_CPU_TIME = "cpuTime";
+ public static final String METRIC_CPU_FOREGROUND_TIME = "cpuForegroundTime";
+ public static final String METRIC_WAKELOCK_TIME = "wakelockTime";
+ public static final String METRIC_WIFI_RUNNING_TIME = "wifiRunningTime";
+ public static final String METRIC_BLUETOOTH_RUNNING_TIME = "bluetoothRunningTime";
+ public static final String METRIC_GPS_TIME = "gpsTime";
+ public static final String METRIC_CAMERA_TIME = "cameraTime";
+ public static final String METRIC_FLASHLIGHT_TIME = "flashlightTime";
+ public static final String METRIC_AUDIO_TIME = "audioTime";
+ public static final String METRIC_VIDEO_TIME = "videoTime";
+
+ public static class Metric {
+ public String metricType;
+ public MetricKind metricKind;
+ public String title;
+ public double value;
+ public double total;
+ }
+
+ private final double mMinDrainedPower;
+ private final double mMaxDrainedPower;
+
+ private List<Metric> mMetrics = new ArrayList<>();
+
+ public PowerMetrics(BatteryStatsHelper batteryStatsHelper, int uid) {
+ mMinDrainedPower = batteryStatsHelper.getMinDrainedPower();
+ mMaxDrainedPower = batteryStatsHelper.getMaxDrainedPower();
+
+ List<BatterySipper> usageList = batteryStatsHelper.getUsageList();
+
+ double totalPowerMah = 0;
+ double totalSmearedPowerMah = 0;
+ double totalPowerExcludeSystemMah = 0;
+ double totalScreenPower = 0;
+ double totalProportionalSmearMah = 0;
+ double totalCpuPowerMah = 0;
+ double totalSystemServiceCpuPowerMah = 0;
+ double totalUsagePowerMah = 0;
+ double totalWakeLockPowerMah = 0;
+ double totalMobileRadioPowerMah = 0;
+ double totalWifiPowerMah = 0;
+ double totalBluetoothPowerMah = 0;
+ double totalGpsPowerMah = 0;
+ double totalCameraPowerMah = 0;
+ double totalFlashlightPowerMah = 0;
+ double totalSensorPowerMah = 0;
+ double totalAudioPowerMah = 0;
+ double totalVideoPowerMah = 0;
+
+ long totalCpuTimeMs = 0;
+ long totalCpuFgTimeMs = 0;
+ long totalWakeLockTimeMs = 0;
+ long totalWifiRunningTimeMs = 0;
+ long totalBluetoothRunningTimeMs = 0;
+ long totalGpsTimeMs = 0;
+ long totalCameraTimeMs = 0;
+ long totalFlashlightTimeMs = 0;
+ long totalAudioTimeMs = 0;
+ long totalVideoTimeMs = 0;
+
+ BatterySipper uidSipper = null;
+ for (BatterySipper sipper : usageList) {
+ if (sipper.drainType == BatterySipper.DrainType.SCREEN) {
+ totalScreenPower = sipper.sumPower();
+ }
+
+ if (isHiddenDrainType(sipper.drainType)) {
+ continue;
+ }
+
+ if (sipper.drainType == BatterySipper.DrainType.APP && sipper.getUid() == uid) {
+ uidSipper = sipper;
+ }
+
+ totalPowerMah += sipper.sumPower();
+ totalSmearedPowerMah += sipper.totalSmearedPowerMah;
+ totalProportionalSmearMah += sipper.proportionalSmearMah;
+
+ if (!isSystemSipper(sipper)) {
+ totalPowerExcludeSystemMah += sipper.totalSmearedPowerMah;
+ }
+
+ totalCpuPowerMah += sipper.cpuPowerMah;
+ totalSystemServiceCpuPowerMah += sipper.systemServiceCpuPowerMah;
+ totalUsagePowerMah += sipper.usagePowerMah;
+ totalWakeLockPowerMah += sipper.wakeLockPowerMah;
+ totalMobileRadioPowerMah += sipper.mobileRadioPowerMah;
+ totalWifiPowerMah += sipper.wifiPowerMah;
+ totalBluetoothPowerMah += sipper.bluetoothPowerMah;
+ totalGpsPowerMah += sipper.gpsPowerMah;
+ totalCameraPowerMah += sipper.cameraPowerMah;
+ totalFlashlightPowerMah += sipper.flashlightPowerMah;
+ totalSensorPowerMah += sipper.sensorPowerMah;
+ totalAudioPowerMah += sipper.audioPowerMah;
+ totalVideoPowerMah += sipper.videoPowerMah;
+
+ totalCpuTimeMs += sipper.cpuTimeMs;
+ totalCpuFgTimeMs += sipper.cpuFgTimeMs;
+ totalWakeLockTimeMs += sipper.wakeLockTimeMs;
+ totalWifiRunningTimeMs += sipper.wifiRunningTimeMs;
+ totalBluetoothRunningTimeMs += sipper.bluetoothRunningTimeMs;
+ totalGpsTimeMs += sipper.gpsTimeMs;
+ totalCameraTimeMs += sipper.cameraTimeMs;
+ totalFlashlightTimeMs += sipper.flashlightTimeMs;
+ totalAudioTimeMs += sipper.audioTimeMs;
+ totalVideoTimeMs += sipper.videoTimeMs;
+ }
+
+ if (uidSipper == null) {
+ return;
+ }
+
+ addMetric(METRIC_APP_POWER, MetricKind.POWER, "Total power",
+ uidSipper.totalSmearedPowerMah, totalSmearedPowerMah);
+ addMetric(METRIC_APP_POWER_EXCLUDE_SYSTEM_FROM_TOTAL, MetricKind.POWER,
+ "Total power excluding system",
+ uidSipper.totalSmearedPowerMah, totalPowerExcludeSystemMah);
+ addMetric(METRIC_SCREEN_POWER, MetricKind.POWER, "Screen, smeared",
+ uidSipper.screenPowerMah, totalScreenPower);
+ addMetric(METRIC_OTHER_POWER, MetricKind.POWER, "Other, smeared",
+ uidSipper.proportionalSmearMah, totalProportionalSmearMah);
+ addMetric(METRIC_APP_POWER_EXCLUDE_SMEARED, MetricKind.POWER, "Excluding smeared",
+ uidSipper.totalPowerMah, totalPowerMah);
+ addMetric(METRIC_CPU_POWER, MetricKind.POWER, "CPU",
+ uidSipper.cpuPowerMah, totalCpuPowerMah);
+ addMetric(METRIC_SYSTEM_SERVICE_CPU_POWER, MetricKind.POWER, "System services",
+ uidSipper.systemServiceCpuPowerMah, totalSystemServiceCpuPowerMah);
+ addMetric(METRIC_RAM_POWER, MetricKind.POWER, "RAM",
+ uidSipper.usagePowerMah, totalUsagePowerMah);
+ addMetric(METRIC_WAKELOCK_POWER, MetricKind.POWER, "Wake lock",
+ uidSipper.wakeLockPowerMah, totalWakeLockPowerMah);
+ addMetric(METRIC_MOBILE_RADIO_POWER, MetricKind.POWER, "Mobile radio",
+ uidSipper.mobileRadioPowerMah, totalMobileRadioPowerMah);
+ addMetric(METRIC_WIFI_POWER, MetricKind.POWER, "WiFi",
+ uidSipper.wifiPowerMah, totalWifiPowerMah);
+ addMetric(METRIC_BLUETOOTH_POWER, MetricKind.POWER, "Bluetooth",
+ uidSipper.bluetoothPowerMah, totalBluetoothPowerMah);
+ addMetric(METRIC_GPS_POWER, MetricKind.POWER, "GPS",
+ uidSipper.gpsPowerMah, totalGpsPowerMah);
+ addMetric(METRIC_CAMERA_POWER, MetricKind.POWER, "Camera",
+ uidSipper.cameraPowerMah, totalCameraPowerMah);
+ addMetric(METRIC_FLASHLIGHT_POWER, MetricKind.POWER, "Flashlight",
+ uidSipper.flashlightPowerMah, totalFlashlightPowerMah);
+ addMetric(METRIC_SENSORS_POWER, MetricKind.POWER, "Sensors",
+ uidSipper.sensorPowerMah, totalSensorPowerMah);
+ addMetric(METRIC_AUDIO_POWER, MetricKind.POWER, "Audio",
+ uidSipper.audioPowerMah, totalAudioPowerMah);
+ addMetric(METRIC_VIDEO_POWER, MetricKind.POWER, "Video",
+ uidSipper.videoPowerMah, totalVideoPowerMah);
+
+ addMetric(METRIC_CPU_TIME, MetricKind.DURATION, "CPU time",
+ uidSipper.cpuTimeMs, totalCpuTimeMs);
+ addMetric(METRIC_CPU_FOREGROUND_TIME, MetricKind.DURATION, "CPU foreground time",
+ uidSipper.cpuFgTimeMs, totalCpuFgTimeMs);
+ addMetric(METRIC_WAKELOCK_TIME, MetricKind.DURATION, "Wake lock time",
+ uidSipper.wakeLockTimeMs, totalWakeLockTimeMs);
+ addMetric(METRIC_WIFI_RUNNING_TIME, MetricKind.DURATION, "WiFi running time",
+ uidSipper.wifiRunningTimeMs, totalWifiRunningTimeMs);
+ addMetric(METRIC_BLUETOOTH_RUNNING_TIME, MetricKind.DURATION, "Bluetooth time",
+ uidSipper.bluetoothRunningTimeMs, totalBluetoothRunningTimeMs);
+ addMetric(METRIC_GPS_TIME, MetricKind.DURATION, "GPS time",
+ uidSipper.gpsTimeMs, totalGpsTimeMs);
+ addMetric(METRIC_CAMERA_TIME, MetricKind.DURATION, "Camera time",
+ uidSipper.cameraTimeMs, totalCameraTimeMs);
+ addMetric(METRIC_FLASHLIGHT_TIME, MetricKind.DURATION, "Flashlight time",
+ uidSipper.flashlightTimeMs, totalFlashlightTimeMs);
+ addMetric(METRIC_AUDIO_TIME, MetricKind.DURATION, "Audio time",
+ uidSipper.audioTimeMs, totalAudioTimeMs);
+ addMetric(METRIC_VIDEO_TIME, MetricKind.DURATION, "Video time",
+ uidSipper.videoTimeMs, totalVideoTimeMs);
+ }
+
+ public List<Metric> getMetrics() {
+ return mMetrics;
+ }
+
+ public double getMinDrainedPower() {
+ return mMinDrainedPower;
+ }
+
+ public double getMaxDrainedPower() {
+ return mMaxDrainedPower;
+ }
+
+ protected boolean isHiddenDrainType(BatterySipper.DrainType drainType) {
+ return drainType == BatterySipper.DrainType.IDLE
+ || drainType == BatterySipper.DrainType.CELL
+ || drainType == BatterySipper.DrainType.SCREEN
+ || drainType == BatterySipper.DrainType.UNACCOUNTED
+ || drainType == BatterySipper.DrainType.OVERCOUNTED
+ || drainType == BatterySipper.DrainType.BLUETOOTH
+ || drainType == BatterySipper.DrainType.WIFI;
+ }
+
+ private boolean isSystemSipper(BatterySipper sipper) {
+ final int uid = sipper.uidObj == null ? -1 : sipper.getUid();
+ if (uid >= Process.ROOT_UID && uid < Process.FIRST_APPLICATION_UID) {
+ return true;
+ } else if (sipper.mPackages != null) {
+ for (final String packageName : sipper.mPackages) {
+ for (final String systemPackage : PACKAGES_SYSTEM) {
+ if (systemPackage.equals(packageName)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private void addMetric(String metricType, MetricKind metricKind, String title, double amount,
+ double totalAmount) {
+ Metric metric = new Metric();
+ metric.metricType = metricType;
+ metric.metricKind = metricKind;
+ metric.title = title;
+ metric.value = amount;
+ metric.total = totalAmount;
+ mMetrics.add(metric);
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetricsCollector.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetricsCollector.java
new file mode 100644
index 0000000..254458c
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetricsCollector.java
@@ -0,0 +1,305 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsloadtests;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import android.app.Instrumentation;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.BatteryManager;
+import android.os.BatteryStats;
+import android.os.Bundle;
+import android.os.Process;
+import android.os.SystemClock;
+import android.os.UserManager;
+import android.util.Log;
+import android.util.TimeUtils;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.android.compatibility.common.util.SystemUtil;
+import com.android.internal.os.BatteryStatsHelper;
+import com.android.internal.os.LoggingPrintStream;
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+public class PowerMetricsCollector implements TestRule {
+ private final String mTag;
+ private final float mBatteryDrainThresholdPct;
+ private final int mTimeoutMillis;
+
+ private final Context mContext;
+ private final UserManager mUserManager;
+ private final int mUid;
+ private final BatteryStatsHelper mStatsHelper;
+ private final CountDownLatch mSuspendingBatteryInput = new CountDownLatch(1);
+
+ private long mStartTime;
+ private volatile float mInitialBatteryLevel;
+ private volatile float mCurrentBatteryLevel;
+ private int mIterations;
+ private PowerMetrics mInitialPowerMetrics;
+ private PowerMetrics mFinalPowerMetrics;
+ private List<PowerMetrics.Metric> mPowerMetricsDelta;
+ private Intent mBatteryStatus;
+
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ BroadcastReceiver batteryBroadcastReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ handleBatteryStatus(intent);
+ }
+ };
+ mBatteryStatus = mContext.registerReceiver(batteryBroadcastReceiver,
+ new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
+ disableCharger();
+ try {
+ prepareBatteryLevelMonitor();
+ mStartTime = SystemClock.uptimeMillis();
+ base.evaluate();
+ captureFinalPowerStatsData();
+ } finally {
+ mContext.unregisterReceiver(batteryBroadcastReceiver);
+ enableCharger();
+ }
+ }
+ };
+ }
+
+ public PowerMetricsCollector(String tag, float batteryDrainThresholdPct, int timeoutMillis) {
+ mTag = tag;
+ mBatteryDrainThresholdPct = batteryDrainThresholdPct;
+ mTimeoutMillis = timeoutMillis;
+
+ Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+ mContext = instrumentation.getContext();
+ mUid = Process.myUid();
+ mUserManager = mContext.getSystemService(UserManager.class);
+ // TODO(b/175324611): Use BatteryUsageStats instead
+ mStatsHelper = new BatteryStatsHelper(mContext, false /* collectBatteryBroadcast */);
+ mStatsHelper.create((Bundle) null);
+ }
+
+ private void disableCharger() throws InterruptedException {
+ SystemUtil.runShellCommand("dumpsys battery suspend_input");
+ final boolean success = mSuspendingBatteryInput.await(10, TimeUnit.SECONDS);
+ assertTrue("Timed out waiting for battery input to be suspended", success);
+ }
+
+ private void enableCharger() {
+ SystemUtil.runShellCommand("dumpsys battery reset");
+ }
+
+ private PowerMetrics readBatteryStatsData() {
+ mStatsHelper.clearStats();
+ mStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
+ mUserManager.getUserProfiles());
+ return new PowerMetrics(mStatsHelper, mUid);
+ }
+
+ protected void prepareBatteryLevelMonitor() {
+ handleBatteryStatus(mBatteryStatus);
+ mInitialBatteryLevel = mCurrentBatteryLevel;
+ }
+
+ protected void handleBatteryStatus(Intent intent) {
+ if (mFinalPowerMetrics != null) {
+ return;
+ }
+
+ final boolean isCharging = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) != 0;
+
+ if (mSuspendingBatteryInput.getCount() > 0) {
+ if (!isCharging) {
+ mSuspendingBatteryInput.countDown();
+ }
+ return;
+ }
+
+ if (isCharging) {
+ fail("Device must remain disconnected from the power source "
+ + "for the duration of the test");
+ }
+
+ int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+ int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
+
+ mCurrentBatteryLevel = level * 100 / (float) scale;
+ Log.i(mTag, "Battery level = " + mCurrentBatteryLevel);
+
+ // We delay tracking until the battery level drops. If the resolution of
+ // battery level is 1%, and the initially reported level is 73, we don't know whether
+ // it's 73.1 or 73.7. Once it drops to 72, we can be confident that the real battery
+ // level it is very close to 72.0 and can start tracking.
+ if (mInitialPowerMetrics == null && mCurrentBatteryLevel < mInitialBatteryLevel) {
+ mInitialBatteryLevel = mCurrentBatteryLevel;
+ mInitialPowerMetrics = readBatteryStatsData();
+ }
+ }
+
+ private void captureFinalPowerStatsData() {
+ if (mFinalPowerMetrics != null) {
+ return;
+ }
+
+ mFinalPowerMetrics = readBatteryStatsData();
+
+ mPowerMetricsDelta = new ArrayList<>();
+ List<PowerMetrics.Metric> initialPowerMetrics = mInitialPowerMetrics.getMetrics();
+ List<PowerMetrics.Metric> finalPowerMetrics = mFinalPowerMetrics.getMetrics();
+ for (PowerMetrics.Metric initialMetric : initialPowerMetrics) {
+ PowerMetrics.Metric finalMetric = null;
+ for (PowerMetrics.Metric metric : finalPowerMetrics) {
+ if (metric.title.equals(initialMetric.title)) {
+ finalMetric = metric;
+ break;
+ }
+ }
+
+ if (finalMetric != null) {
+ PowerMetrics.Metric delta = new PowerMetrics.Metric();
+ delta.metricType = initialMetric.metricType;
+ delta.metricKind = initialMetric.metricKind;
+ delta.title = initialMetric.title;
+ delta.total = finalMetric.total - initialMetric.total;
+ delta.value = finalMetric.value - initialMetric.value;
+ mPowerMetricsDelta.add(delta);
+ }
+ }
+ }
+
+ /**
+ * Returns false if sufficient data has been accumulated.
+ */
+ public boolean checkpoint() {
+ long elapsedTime = SystemClock.uptimeMillis() - mStartTime;
+ if (elapsedTime >= mTimeoutMillis) {
+ Log.i(mTag, "Timeout reached " + TimeUtils.formatDuration(elapsedTime));
+ captureFinalPowerStatsData();
+ return false;
+ }
+
+ if (mInitialPowerMetrics == null) {
+ return true;
+ }
+
+ if (mInitialBatteryLevel - mCurrentBatteryLevel >= mBatteryDrainThresholdPct) {
+ Log.i(mTag,
+ "Battery drain reached " + (mInitialBatteryLevel - mCurrentBatteryLevel) + "%");
+ captureFinalPowerStatsData();
+ return false;
+ }
+
+ mIterations++;
+ return true;
+ }
+
+
+ public int getIterationCount() {
+ return mIterations;
+ }
+
+ public void dumpMetrics() {
+ dumpMetrics(new LoggingPrintStream() {
+ @Override
+ protected void log(String line) {
+ Log.i(mTag, line);
+ }
+ });
+ }
+
+ public void dumpMetrics(PrintStream out) {
+ List<PowerMetrics.Metric> initialPowerMetrics = mInitialPowerMetrics.getMetrics();
+ List<PowerMetrics.Metric> finalPowerMetrics = mFinalPowerMetrics.getMetrics();
+
+ out.println("== Power metrics at test start");
+ dumpPowerStatsData(out, initialPowerMetrics);
+
+ out.println("== Power metrics at test end");
+ dumpPowerStatsData(out, finalPowerMetrics);
+
+ out.println("== Power metrics delta");
+ dumpPowerStatsData(out, mPowerMetricsDelta);
+ }
+
+ protected void dumpPowerStatsData(PrintStream out, List<PowerMetrics.Metric> metrics) {
+ Locale locale = Locale.getDefault();
+ for (PowerMetrics.Metric metric : metrics) {
+ double proportion = metric.total != 0 ? metric.value * 100 / metric.total : 0;
+ switch (metric.metricKind) {
+ case POWER:
+ out.println(
+ String.format(locale, " %-30s %7.1f mAh %4.1f%%", metric.title,
+ metric.value, proportion));
+ break;
+ case DURATION:
+ out.println(
+ String.format(locale, " %-30s %,7d ms %4.1f%%", metric.title,
+ (long) metric.value, proportion));
+ break;
+ }
+ }
+ }
+
+ public void dumpMetricAsPercentageOfDrainedPower(String metricType) {
+ double minDrainedPower =
+ mFinalPowerMetrics.getMinDrainedPower() - mInitialPowerMetrics.getMinDrainedPower();
+ double maxDrainedPower =
+ mFinalPowerMetrics.getMaxDrainedPower() - mInitialPowerMetrics.getMaxDrainedPower();
+
+ PowerMetrics.Metric metric = getMetric(metricType);
+ double metricDelta = metric.value;
+
+ if (maxDrainedPower - minDrainedPower < 0.1f) {
+ Log.i(mTag, String.format(Locale.getDefault(),
+ "%s power consumed by the test: %.1f of %.1f mAh (%.1f%%)",
+ metric.title, metricDelta, maxDrainedPower,
+ metricDelta / maxDrainedPower * 100));
+ } else {
+ Log.i(mTag, String.format(Locale.getDefault(),
+ "%s power consumed by the test: %.1f of %.1f - %.1f mAh (%.1f%% - %.1f%%)",
+ metric.title, metricDelta, minDrainedPower, maxDrainedPower,
+ metricDelta / minDrainedPower * 100, metricDelta / maxDrainedPower * 100));
+ }
+ }
+
+ public PowerMetrics.Metric getMetric(String metricType) {
+ for (PowerMetrics.Metric metric : mPowerMetricsDelta) {
+ if (metric.metricType.equals(metricType)) {
+ return metric;
+ }
+ }
+ return null;
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/SystemServiceCallLoadTest.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/SystemServiceCallLoadTest.java
new file mode 100644
index 0000000..488469d
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/SystemServiceCallLoadTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsloadtests;
+
+import static org.junit.Assert.assertNotNull;
+
+import android.app.Instrumentation;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.net.Uri;
+import android.util.Log;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class SystemServiceCallLoadTest {
+ private static final String TAG = "SystemServiceCallLoadTest";
+ private static final int TIMEOUT_MILLIS = 60 * 60 * 1000;
+ private static final float BATTERY_DRAIN_THRESHOLD_PCT = 2.99f;
+
+ @Rule
+ public PowerMetricsCollector mPowerMetricsCollector = new PowerMetricsCollector(TAG,
+ BATTERY_DRAIN_THRESHOLD_PCT, TIMEOUT_MILLIS);
+
+ private PackageManager mPackageManager;
+
+ @Before
+ public void setup() {
+ Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+ mPackageManager = instrumentation.getContext().getPackageManager();
+ }
+
+ @Test
+ public void test() {
+ while (mPowerMetricsCollector.checkpoint()) {
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setDataAndType(Uri.parse("http://example.com/"), "text/plain");
+ intent.addCategory(Intent.CATEGORY_BROWSABLE);
+ ResolveInfo resolveInfo = mPackageManager.resolveActivity(intent, 0);
+ assertNotNull(resolveInfo);
+ }
+
+ mPowerMetricsCollector.dumpMetrics();
+
+ Log.i(TAG, "==");
+ Log.i(TAG, "Total system server calls made " + mPowerMetricsCollector.getIterationCount());
+
+ mPowerMetricsCollector.dumpMetricAsPercentageOfDrainedPower(
+ PowerMetrics.METRIC_SYSTEM_SERVICE_CPU_POWER);
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/WiFiLoadTest.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/WiFiLoadTest.java
new file mode 100644
index 0000000..27495da
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/WiFiLoadTest.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsloadtests;
+
+import android.util.Log;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+public class WiFiLoadTest {
+ private static final String TAG = "WiFiLoadTest";
+ private static final String DOWNLOAD_TEST_URL =
+ "https://i.ytimg.com/vi/l5mE3Tpjejs/maxresdefault.jpg";
+
+ private static final int TIMEOUT_MILLIS = 60 * 60 * 1000;
+ private static final float BATTERY_DRAIN_THRESHOLD_PCT = 0.99f;
+
+ @Rule
+ public PowerMetricsCollector mPowerMetricsCollector = new PowerMetricsCollector(TAG,
+ BATTERY_DRAIN_THRESHOLD_PCT, TIMEOUT_MILLIS);
+
+ @Rule
+ public ConnectivitySetupRule mConnectivitySetupRule =
+ new ConnectivitySetupRule(/* WiFi enabled */true);
+
+ @Test
+ public void test() throws IOException {
+ long totalBytesRead = 0;
+ URL url = new URL(DOWNLOAD_TEST_URL);
+ byte[] buffer = new byte[131072]; // Large buffer to minimize CPU usage
+
+ while (mPowerMetricsCollector.checkpoint()) {
+ try (InputStream inputStream = url.openStream()) {
+ while (true) {
+ int count = inputStream.read(buffer);
+ if (count < 0) {
+ break;
+ }
+ totalBytesRead += count;
+ }
+ }
+ }
+
+ mPowerMetricsCollector.dumpMetrics();
+
+ Log.i(TAG, "==");
+ Log.i(TAG, "WiFi running time: " + (long) mPowerMetricsCollector.getMetric(
+ PowerMetrics.METRIC_WIFI_RUNNING_TIME).value);
+ Log.i(TAG, "Total bytes read over WiFi: " + totalBytesRead);
+
+ mPowerMetricsCollector.dumpMetricAsPercentageOfDrainedPower(
+ PowerMetrics.METRIC_WIFI_POWER);
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/Android.bp b/core/tests/batterystatstests/BatteryStatsViewer/Android.bp
new file mode 100644
index 0000000..1e0498b
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/Android.bp
@@ -0,0 +1,13 @@
+android_test {
+ name: "BatteryStatsViewer",
+ srcs: ["src/**/*.java"],
+ defaults: ["SettingsLibDefaults"],
+ static_libs: [
+ "androidx.appcompat_appcompat",
+ "androidx.cardview_cardview",
+ "androidx.recyclerview_recyclerview",
+ "com.google.android.material_material",
+ ],
+ platform_apis: true,
+ certificate: "platform",
+}
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/AndroidManifest.xml b/core/tests/batterystatstests/BatteryStatsViewer/AndroidManifest.xml
new file mode 100644
index 0000000..edb1b10
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/AndroidManifest.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.frameworks.core.batterystatsviewer"
+ android:sharedUserId="android.uid.system">
+
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+ <uses-permission android:name="android.permission.BATTERY_STATS"/>
+
+ <application
+ android:theme="@style/Theme"
+ android:label="Battery Stats Viewer">
+ <activity android:name=".BatteryStatsViewerActivity"
+ android:label="Battery Stats Viewer"
+ android:launchMode="singleTop"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".BatteryConsumerPickerActivity"
+ android:label="Select a battery consumer"/>
+ </application>
+</manifest>
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_entry_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_entry_layout.xml
similarity index 100%
rename from core/tests/powertests/PowerStatsViewer/res/layout/power_stats_entry_layout.xml
rename to core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_entry_layout.xml
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_info_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_info_layout.xml
similarity index 100%
rename from core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_info_layout.xml
rename to core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_info_layout.xml
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_activity_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_activity_layout.xml
similarity index 100%
rename from core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_activity_layout.xml
rename to core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_activity_layout.xml
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_layout.xml
similarity index 100%
rename from core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_layout.xml
rename to core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_layout.xml
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_stats_viewer_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_stats_viewer_layout.xml
new file mode 100644
index 0000000..e58a08f
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_stats_viewer_layout.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <androidx.cardview.widget.CardView
+ style="@style/LoadTestCardView"
+ android:id="@+id/app_card"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="10dp"
+ android:layout_marginEnd="10dp"
+ android:layout_marginBottom="10dp"
+ android:layout_marginStart="10dp"
+ android:padding="20dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:minHeight="80dp"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp">
+
+ <include layout="@layout/battery_consumer_info_layout"/>
+
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/battery_consumer_data_view"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"/>
+
+ <TextView
+ android:id="@+id/empty_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:visibility="gone"
+ android:text="No battery stats available"/>
+ </LinearLayout>
+
+ <FrameLayout
+ android:id="@+id/loading_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#AAFFFFFF">
+ <ProgressBar
+ style="?android:attr/progressBarStyleLarge"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:indeterminate="true"/>
+ </FrameLayout>
+</FrameLayout>
diff --git a/core/tests/powertests/PowerStatsViewer/res/values/styles.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/values/styles.xml
similarity index 100%
rename from core/tests/powertests/PowerStatsViewer/res/values/styles.xml
rename to core/tests/batterystatstests/BatteryStatsViewer/res/values/styles.xml
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerData.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerData.java
new file mode 100644
index 0000000..b077ea3
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerData.java
@@ -0,0 +1,302 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsviewer;
+
+import android.content.Context;
+import android.os.BatteryConsumer;
+import android.os.BatteryStats;
+import android.os.BatteryUsageStats;
+import android.os.Process;
+import android.os.UidBatteryConsumer;
+import android.os.UserHandle;
+
+import com.android.internal.os.BatterySipper;
+import com.android.internal.os.BatteryStatsHelper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BatteryConsumerData {
+ private static final String PACKAGE_CALENDAR_PROVIDER = "com.android.providers.calendar";
+ private static final String PACKAGE_MEDIA_PROVIDER = "com.android.providers.media";
+ private static final String PACKAGE_SYSTEMUI = "com.android.systemui";
+ private static final String[] PACKAGES_SYSTEM = {PACKAGE_MEDIA_PROVIDER,
+ PACKAGE_CALENDAR_PROVIDER, PACKAGE_SYSTEMUI};
+
+ // Temporary placeholder voltage for converting energy to charge
+ // TODO: remove this when b/173765509 is resolved
+ private static final double MOCK_NOMINAL_VOLTAGE = 3.7;
+
+ // Unit conversion:
+ // mAh = uWs * (1/1000)(milli/micro) * (1/Voltage) * (1/3600)(hours/second)
+ private static final double UJ_2_MAH =
+ (1.0 / 1000) * (1.0 / MOCK_NOMINAL_VOLTAGE) * (1.0 / 3600);
+
+ enum EntryType {
+ POWER,
+ DURATION,
+ }
+
+ public static class Entry {
+ public String title;
+ public EntryType entryType;
+ public double value;
+ public double total;
+ }
+
+ private final BatteryConsumerInfoHelper.BatteryConsumerInfo mBatteryConsumerInfo;
+ private final List<Entry> mEntries = new ArrayList<>();
+
+ public BatteryConsumerData(Context context, BatteryStatsHelper batteryStatsHelper,
+ BatteryUsageStats batteryUsageStats, String batteryConsumerId) {
+ List<BatterySipper> usageList = batteryStatsHelper.getUsageList();
+ BatteryStats batteryStats = batteryStatsHelper.getStats();
+
+ double totalPowerMah = 0;
+ double totalSmearedPowerMah = 0;
+ double totalPowerExcludeSystemMah = 0;
+ double totalScreenPower = 0;
+ double totalProportionalSmearMah = 0;
+ double totalCpuPowerMah = 0;
+ double totalSystemServiceCpuPowerMah = 0;
+ double totalUsagePowerMah = 0;
+ double totalWakeLockPowerMah = 0;
+ double totalMobileRadioPowerMah = 0;
+ double totalWifiPowerMah = 0;
+ double totalBluetoothPowerMah = 0;
+ double totalGpsPowerMah = 0;
+ double totalCameraPowerMah = 0;
+ double totalFlashlightPowerMah = 0;
+ double totalSensorPowerMah = 0;
+ double totalAudioPowerMah = 0;
+ double totalVideoPowerMah = 0;
+
+ long totalCpuTimeMs = 0;
+ long totalCpuFgTimeMs = 0;
+ long totalWakeLockTimeMs = 0;
+ long totalWifiRunningTimeMs = 0;
+ long totalBluetoothRunningTimeMs = 0;
+ long totalGpsTimeMs = 0;
+ long totalCameraTimeMs = 0;
+ long totalFlashlightTimeMs = 0;
+ long totalAudioTimeMs = 0;
+ long totalVideoTimeMs = 0;
+
+ BatterySipper requestedBatterySipper = null;
+ for (BatterySipper sipper : usageList) {
+ if (sipper.drainType == BatterySipper.DrainType.SCREEN) {
+ totalScreenPower = sipper.sumPower();
+ }
+
+ if (batteryConsumerId(sipper).equals(batteryConsumerId)) {
+ requestedBatterySipper = sipper;
+ }
+
+ totalPowerMah += sipper.sumPower();
+ totalSmearedPowerMah += sipper.totalSmearedPowerMah;
+ totalProportionalSmearMah += sipper.proportionalSmearMah;
+
+ if (!isSystemSipper(sipper)) {
+ totalPowerExcludeSystemMah += sipper.totalSmearedPowerMah;
+ }
+
+ totalCpuPowerMah += sipper.cpuPowerMah;
+ totalSystemServiceCpuPowerMah += sipper.systemServiceCpuPowerMah;
+ totalUsagePowerMah += sipper.usagePowerMah;
+ totalWakeLockPowerMah += sipper.wakeLockPowerMah;
+ totalMobileRadioPowerMah += sipper.mobileRadioPowerMah;
+ totalWifiPowerMah += sipper.wifiPowerMah;
+ totalBluetoothPowerMah += sipper.bluetoothPowerMah;
+ totalGpsPowerMah += sipper.gpsPowerMah;
+ totalCameraPowerMah += sipper.cameraPowerMah;
+ totalFlashlightPowerMah += sipper.flashlightPowerMah;
+ totalSensorPowerMah += sipper.sensorPowerMah;
+ totalAudioPowerMah += sipper.audioPowerMah;
+ totalVideoPowerMah += sipper.videoPowerMah;
+
+ totalCpuTimeMs += sipper.cpuTimeMs;
+ totalCpuFgTimeMs += sipper.cpuFgTimeMs;
+ totalWakeLockTimeMs += sipper.wakeLockTimeMs;
+ totalWifiRunningTimeMs += sipper.wifiRunningTimeMs;
+ totalBluetoothRunningTimeMs += sipper.bluetoothRunningTimeMs;
+ totalGpsTimeMs += sipper.gpsTimeMs;
+ totalCameraTimeMs += sipper.cameraTimeMs;
+ totalFlashlightTimeMs += sipper.flashlightTimeMs;
+ totalAudioTimeMs += sipper.audioTimeMs;
+ totalVideoTimeMs += sipper.videoTimeMs;
+ }
+
+ BatteryConsumer requestedBatteryConsumer = null;
+
+ for (BatteryConsumer consumer : batteryUsageStats.getUidBatteryConsumers()) {
+ if (batteryConsumerId(consumer).equals(batteryConsumerId)) {
+ requestedBatteryConsumer = consumer;
+ break;
+ }
+ }
+
+ if (requestedBatterySipper == null) {
+ mBatteryConsumerInfo = null;
+ return;
+ }
+
+ mBatteryConsumerInfo = BatteryConsumerInfoHelper.makeBatteryConsumerInfo(
+ context.getPackageManager(), requestedBatterySipper);
+ long totalScreenMeasuredEnergyUJ = batteryStats.getScreenOnEnergy();
+
+ addEntry("Total power", EntryType.POWER,
+ requestedBatterySipper.totalSmearedPowerMah, totalSmearedPowerMah);
+ maybeAddMeasuredEnergyEntry(requestedBatterySipper.drainType, batteryStats);
+
+ addEntry("... excluding system", EntryType.POWER,
+ requestedBatterySipper.totalSmearedPowerMah, totalPowerExcludeSystemMah);
+ addEntry("Screen, smeared", EntryType.POWER,
+ requestedBatterySipper.screenPowerMah, totalScreenPower);
+ if (totalScreenMeasuredEnergyUJ != BatteryStats.ENERGY_DATA_UNAVAILABLE) {
+ final double measuredCharge = UJ_2_MAH * totalScreenMeasuredEnergyUJ;
+ final double ratio = measuredCharge / totalScreenPower;
+ addEntry("Screen, smeared (PowerStatsHal adjusted)", EntryType.POWER,
+ requestedBatterySipper.screenPowerMah * ratio, measuredCharge);
+ }
+ addEntry("Other, smeared", EntryType.POWER,
+ requestedBatterySipper.proportionalSmearMah, totalProportionalSmearMah);
+ addEntry("Excluding smeared", EntryType.POWER,
+ requestedBatterySipper.totalPowerMah, totalPowerMah);
+ if (requestedBatteryConsumer != null) {
+ addEntry("CPU", EntryType.POWER,
+ requestedBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU),
+ totalCpuPowerMah);
+ }
+ addEntry("CPU (sipper)", EntryType.POWER,
+ requestedBatterySipper.cpuPowerMah, totalCpuPowerMah);
+ addEntry("System services", EntryType.POWER,
+ requestedBatterySipper.systemServiceCpuPowerMah, totalSystemServiceCpuPowerMah);
+ addEntry("Usage", EntryType.POWER,
+ requestedBatterySipper.usagePowerMah, totalUsagePowerMah);
+ addEntry("Wake lock", EntryType.POWER,
+ requestedBatterySipper.wakeLockPowerMah, totalWakeLockPowerMah);
+ addEntry("Mobile radio", EntryType.POWER,
+ requestedBatterySipper.mobileRadioPowerMah, totalMobileRadioPowerMah);
+ addEntry("WiFi", EntryType.POWER,
+ requestedBatterySipper.wifiPowerMah, totalWifiPowerMah);
+ addEntry("Bluetooth", EntryType.POWER,
+ requestedBatterySipper.bluetoothPowerMah, totalBluetoothPowerMah);
+ addEntry("GPS", EntryType.POWER,
+ requestedBatterySipper.gpsPowerMah, totalGpsPowerMah);
+ addEntry("Camera", EntryType.POWER,
+ requestedBatterySipper.cameraPowerMah, totalCameraPowerMah);
+ addEntry("Flashlight", EntryType.POWER,
+ requestedBatterySipper.flashlightPowerMah, totalFlashlightPowerMah);
+ addEntry("Sensors", EntryType.POWER,
+ requestedBatterySipper.sensorPowerMah, totalSensorPowerMah);
+ addEntry("Audio", EntryType.POWER,
+ requestedBatterySipper.audioPowerMah, totalAudioPowerMah);
+ addEntry("Video", EntryType.POWER,
+ requestedBatterySipper.videoPowerMah, totalVideoPowerMah);
+
+ addEntry("CPU time", EntryType.DURATION,
+ requestedBatterySipper.cpuTimeMs, totalCpuTimeMs);
+ addEntry("CPU foreground time", EntryType.DURATION,
+ requestedBatterySipper.cpuFgTimeMs, totalCpuFgTimeMs);
+ addEntry("Wake lock time", EntryType.DURATION,
+ requestedBatterySipper.wakeLockTimeMs, totalWakeLockTimeMs);
+ addEntry("WiFi running time", EntryType.DURATION,
+ requestedBatterySipper.wifiRunningTimeMs, totalWifiRunningTimeMs);
+ addEntry("Bluetooth time", EntryType.DURATION,
+ requestedBatterySipper.bluetoothRunningTimeMs, totalBluetoothRunningTimeMs);
+ addEntry("GPS time", EntryType.DURATION,
+ requestedBatterySipper.gpsTimeMs, totalGpsTimeMs);
+ addEntry("Camera time", EntryType.DURATION,
+ requestedBatterySipper.cameraTimeMs, totalCameraTimeMs);
+ addEntry("Flashlight time", EntryType.DURATION,
+ requestedBatterySipper.flashlightTimeMs, totalFlashlightTimeMs);
+ addEntry("Audio time", EntryType.DURATION,
+ requestedBatterySipper.audioTimeMs, totalAudioTimeMs);
+ addEntry("Video time", EntryType.DURATION,
+ requestedBatterySipper.videoTimeMs, totalVideoTimeMs);
+ }
+
+ private boolean isSystemSipper(BatterySipper sipper) {
+ final int uid = sipper.uidObj == null ? -1 : sipper.getUid();
+ if (uid >= Process.ROOT_UID && uid < Process.FIRST_APPLICATION_UID) {
+ return true;
+ } else if (sipper.mPackages != null) {
+ for (final String packageName : sipper.mPackages) {
+ for (final String systemPackage : PACKAGES_SYSTEM) {
+ if (systemPackage.equals(packageName)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private void addEntry(String title, EntryType entryType, double amount, double totalAmount) {
+ Entry entry = new Entry();
+ entry.title = title;
+ entry.entryType = entryType;
+ entry.value = amount;
+ entry.total = totalAmount;
+ mEntries.add(entry);
+ }
+
+ private void maybeAddMeasuredEnergyEntry(BatterySipper.DrainType drainType,
+ BatteryStats batteryStats) {
+ switch (drainType) {
+ case AMBIENT_DISPLAY:
+ final long totalDozeMeasuredEnergyUJ = batteryStats.getScreenDozeEnergy();
+ if (totalDozeMeasuredEnergyUJ != BatteryStats.ENERGY_DATA_UNAVAILABLE) {
+ final double measuredCharge = UJ_2_MAH * totalDozeMeasuredEnergyUJ;
+ addEntry("Measured ambient display power", EntryType.POWER, measuredCharge,
+ measuredCharge);
+ }
+ break;
+ case SCREEN:
+ final long totalScreenMeasuredEnergyUJ = batteryStats.getScreenOnEnergy();
+ if (totalScreenMeasuredEnergyUJ != BatteryStats.ENERGY_DATA_UNAVAILABLE) {
+ final double measuredCharge = UJ_2_MAH * totalScreenMeasuredEnergyUJ;
+ addEntry("Measured screen power", EntryType.POWER, measuredCharge,
+ measuredCharge);
+ }
+ break;
+ }
+ }
+
+ public BatteryConsumerInfoHelper.BatteryConsumerInfo getBatteryConsumerInfo() {
+ return mBatteryConsumerInfo;
+ }
+
+ public List<Entry> getEntries() {
+ return mEntries;
+ }
+
+ public static String batteryConsumerId(BatterySipper sipper) {
+ return sipper.drainType + "|" + sipper.userId + "|" + sipper.getUid();
+ }
+
+ public static String batteryConsumerId(BatteryConsumer consumer) {
+ if (consumer instanceof UidBatteryConsumer) {
+ return BatterySipper.DrainType.APP + "|"
+ + UserHandle.getUserId(((UidBatteryConsumer) consumer).getUid()) + "|"
+ + ((UidBatteryConsumer) consumer).getUid();
+ } else {
+ return "";
+ }
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerInfoHelper.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerInfoHelper.java
new file mode 100644
index 0000000..8ee6c604
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerInfoHelper.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsviewer;
+
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.os.Process;
+
+import androidx.annotation.NonNull;
+
+import com.android.internal.os.BatterySipper;
+
+import java.util.Locale;
+
+class BatteryConsumerInfoHelper {
+
+ private static final String SYSTEM_SERVER_PACKAGE_NAME = "android";
+
+ public static class BatteryConsumerInfo {
+ public String id;
+ public CharSequence label;
+ public double powerMah;
+ public ApplicationInfo iconInfo;
+ public CharSequence packages;
+ public CharSequence details;
+ }
+
+ @NonNull
+ public static BatteryConsumerInfo makeBatteryConsumerInfo(PackageManager packageManager,
+ @NonNull BatterySipper sipper) {
+ BatteryConsumerInfo info = new BatteryConsumerInfo();
+ info.id = BatteryConsumerData.batteryConsumerId(sipper);
+ sipper.sumPower();
+ info.powerMah = sipper.totalSmearedPowerMah;
+ switch (sipper.drainType) {
+ case APP: {
+ int uid = sipper.getUid();
+ info.details = String.format("UID: %d", uid);
+ String packageWithHighestDrain = sipper.packageWithHighestDrain;
+ if (uid == Process.ROOT_UID) {
+ info.label = "<root>";
+ } else {
+ String[] packages = packageManager.getPackagesForUid(uid);
+ String primaryPackageName = null;
+ if (uid == Process.SYSTEM_UID) {
+ primaryPackageName = SYSTEM_SERVER_PACKAGE_NAME;
+ } else if (packages != null) {
+ for (String name : packages) {
+ primaryPackageName = name;
+ if (name.equals(packageWithHighestDrain)) {
+ break;
+ }
+ }
+ }
+
+ if (primaryPackageName != null) {
+ try {
+ ApplicationInfo applicationInfo =
+ packageManager.getApplicationInfo(primaryPackageName, 0);
+ info.label = applicationInfo.loadLabel(packageManager);
+ info.iconInfo = applicationInfo;
+ } catch (PackageManager.NameNotFoundException e) {
+ info.label = primaryPackageName;
+ }
+ } else if (packageWithHighestDrain != null) {
+ info.label = packageWithHighestDrain;
+ }
+
+ if (packages != null && packages.length > 0) {
+ StringBuilder sb = new StringBuilder();
+ if (primaryPackageName != null) {
+ sb.append(primaryPackageName);
+ }
+ for (String packageName : packages) {
+ if (packageName.equals(primaryPackageName)) {
+ continue;
+ }
+
+ if (sb.length() != 0) {
+ sb.append(", ");
+ }
+ sb.append(packageName);
+ }
+
+ info.packages = sb;
+ }
+ }
+ break;
+ }
+ case USER:
+ info.label = "User";
+ info.details = String.format(Locale.getDefault(), "User ID: %d", sipper.userId);
+ break;
+ case AMBIENT_DISPLAY:
+ info.label = "Ambient display";
+ break;
+ case BLUETOOTH:
+ info.label = "Bluetooth";
+ break;
+ case CAMERA:
+ info.label = "Camera";
+ break;
+ case CELL:
+ info.label = "Cell";
+ break;
+ case FLASHLIGHT:
+ info.label = "Flashlight";
+ break;
+ case IDLE:
+ info.label = "Idle";
+ break;
+ case MEMORY:
+ info.label = "Memory";
+ break;
+ case OVERCOUNTED:
+ info.label = "Overcounted";
+ break;
+ case PHONE:
+ info.label = "Phone";
+ break;
+ case SCREEN:
+ info.label = "Screen";
+ break;
+ case UNACCOUNTED:
+ info.label = "Unaccounted";
+ break;
+ case WIFI:
+ info.label = "WiFi";
+ break;
+ }
+ // Default the app icon to System Server. This includes root, dex2oat and other UIDs.
+ if (info.iconInfo == null) {
+ try {
+ info.iconInfo =
+ packageManager.getApplicationInfo(SYSTEM_SERVER_PACKAGE_NAME, 0);
+ } catch (PackageManager.NameNotFoundException nameNotFoundException) {
+ // Won't happen
+ }
+ }
+ return info;
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerActivity.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerActivity.java
new file mode 100644
index 0000000..2db848b
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerActivity.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsviewer;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+
+import androidx.activity.result.contract.ActivityResultContract;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentStatePagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+
+import com.google.android.material.tabs.TabLayout;
+
+/**
+ * Picker, showing a sorted lists of applications and other types of entities consuming power.
+ * Returns the selected entity ID or null.
+ */
+public class BatteryConsumerPickerActivity extends FragmentActivity {
+
+ public static final ActivityResultContract<Void, String> CONTRACT =
+ new ActivityResultContract<Void, String>() {
+ @NonNull
+ @Override
+ public Intent createIntent(@NonNull Context context, Void aVoid) {
+ return new Intent(context, BatteryConsumerPickerActivity.class);
+ }
+
+ @Override
+ public String parseResult(int resultCode, @Nullable Intent intent) {
+ if (resultCode != RESULT_OK || intent == null) {
+ return null;
+ }
+ return intent.getStringExtra(Intent.EXTRA_RETURN_RESULT);
+ }
+ };
+
+ @Override
+ protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+
+ setContentView(R.layout.battery_consumer_picker_activity_layout);
+
+ ViewPager viewPager = findViewById(R.id.pager);
+
+ FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(
+ getSupportFragmentManager()) {
+
+ @Override
+ public int getCount() {
+ return 2;
+ }
+
+ @NonNull
+ @Override
+ public Fragment getItem(int position) {
+ switch (position) {
+ case 0:
+ return new BatteryConsumerPickerFragment(
+ BatteryConsumerPickerFragment.PICKER_TYPE_APP);
+ case 1:
+ default:
+ return new BatteryConsumerPickerFragment(
+ BatteryConsumerPickerFragment.PICKER_TYPE_DRAIN);
+ }
+ }
+
+ @Override
+ public CharSequence getPageTitle(int position) {
+ switch (position) {
+ case 0:
+ return "Apps";
+ case 1:
+ return "Drains";
+ }
+ return null;
+ }
+ };
+
+ viewPager.setAdapter(adapter);
+ TabLayout tabLayout = findViewById(R.id.tab_layout);
+ tabLayout.setupWithViewPager(viewPager);
+ }
+
+ public void setSelectedBatteryConsumer(String batteryConsumerId) {
+ Intent intent = new Intent();
+ intent.putExtra(Intent.EXTRA_RETURN_RESULT, batteryConsumerId);
+ setResult(RESULT_OK, intent);
+ finish();
+ }
+
+ @Override
+ public boolean onNavigateUp() {
+ onBackPressed();
+ return true;
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerFragment.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerFragment.java
new file mode 100644
index 0000000..bb11fd5
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerFragment.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2008 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.frameworks.core.batterystatsviewer;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.BatteryStats;
+import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.loader.app.LoaderManager;
+import androidx.loader.content.Loader;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.android.frameworks.core.batterystatsviewer.BatteryConsumerInfoHelper.BatteryConsumerInfo;
+import com.android.internal.os.BatterySipper;
+import com.android.internal.os.BatteryStatsHelper;
+import com.android.settingslib.utils.AsyncLoaderCompat;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Picker, showing a sorted lists of applications or other types of entities consuming power.
+ * Returns the selected entity ID or null.
+ */
+public class BatteryConsumerPickerFragment extends Fragment {
+ private static final String TAG = "AppPicker";
+
+ public static final String PICKER_TYPE = "pickertype";
+
+ public static final int PICKER_TYPE_APP = 0;
+ public static final int PICKER_TYPE_DRAIN = 1;
+
+ private BatteryConsumerListAdapter mBatteryConsumerListAdapter;
+ private RecyclerView mAppList;
+ private View mLoadingView;
+
+ private interface OnBatteryConsumerSelectedListener {
+ void onBatteryConsumerSelected(String batteryConsumerId);
+ }
+
+ public BatteryConsumerPickerFragment(int pickerType) {
+ Bundle args = new Bundle();
+ args.putInt(PICKER_TYPE, pickerType);
+ setArguments(args);
+ }
+
+ public BatteryConsumerPickerFragment() {
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.battery_consumer_picker_layout, container, false);
+ mLoadingView = view.findViewById(R.id.loading_view);
+
+ mAppList = view.findViewById(R.id.list_view);
+ mAppList.setLayoutManager(new LinearLayoutManager(getContext()));
+ mBatteryConsumerListAdapter = new BatteryConsumerListAdapter(
+ BatteryConsumerPickerFragment.this::setSelectedBatteryConsumer);
+ mAppList.setAdapter(mBatteryConsumerListAdapter);
+
+ LoaderManager.getInstance(this).initLoader(0, getArguments(),
+ new BatteryConsumerListLoaderCallbacks());
+ return view;
+ }
+
+ public void setSelectedBatteryConsumer(String id) {
+ ((BatteryConsumerPickerActivity) getActivity()).setSelectedBatteryConsumer(id);
+ }
+
+ private static class BatteryConsumerListLoader extends
+ AsyncLoaderCompat<List<BatteryConsumerInfo>> {
+ private final BatteryStatsHelper mStatsHelper;
+ private final int mPickerType;
+ private final UserManager mUserManager;
+ private final PackageManager mPackageManager;
+
+ BatteryConsumerListLoader(Context context, int pickerType) {
+ super(context);
+ mUserManager = context.getSystemService(UserManager.class);
+ mStatsHelper = new BatteryStatsHelper(context, false /* collectBatteryBroadcast */);
+ mPickerType = pickerType;
+ mStatsHelper.create((Bundle) null);
+ mStatsHelper.clearStats();
+ mPackageManager = context.getPackageManager();
+ }
+
+ @Override
+ public List<BatteryConsumerInfo> loadInBackground() {
+ List<BatteryConsumerInfo> batteryConsumerList = new ArrayList<>();
+
+ mStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, UserHandle.myUserId());
+
+ final List<BatterySipper> usageList = mStatsHelper.getUsageList();
+ for (BatterySipper sipper : usageList) {
+ switch (mPickerType) {
+ case PICKER_TYPE_APP:
+ if (sipper.drainType != BatterySipper.DrainType.APP) {
+ continue;
+ }
+ break;
+ case PICKER_TYPE_DRAIN:
+ default:
+ if (sipper.drainType == BatterySipper.DrainType.APP) {
+ continue;
+ }
+ }
+
+ batteryConsumerList.add(
+ BatteryConsumerInfoHelper.makeBatteryConsumerInfo(mPackageManager, sipper));
+ }
+
+ batteryConsumerList.sort(
+ Comparator.comparing((BatteryConsumerInfo a) -> a.powerMah).reversed());
+ return batteryConsumerList;
+ }
+
+ @Override
+ protected void onDiscardResult(List<BatteryConsumerInfo> result) {
+ }
+ }
+
+ private class BatteryConsumerListLoaderCallbacks implements
+ LoaderManager.LoaderCallbacks<List<BatteryConsumerInfo>> {
+
+ @NonNull
+ @Override
+ public Loader<List<BatteryConsumerInfo>> onCreateLoader(int id, Bundle args) {
+ return new BatteryConsumerListLoader(getContext(), args.getInt(PICKER_TYPE));
+ }
+
+ @Override
+ public void onLoadFinished(@NonNull Loader<List<BatteryConsumerInfo>> loader,
+ List<BatteryConsumerInfo> batteryConsumerList) {
+ mBatteryConsumerListAdapter.setBatteryConsumerList(batteryConsumerList);
+ mAppList.setVisibility(View.VISIBLE);
+ mLoadingView.setVisibility(View.GONE);
+ }
+
+ @Override
+ public void onLoaderReset(
+ @NonNull Loader<List<BatteryConsumerInfo>> loader) {
+ }
+ }
+
+ public class BatteryConsumerListAdapter extends
+ RecyclerView.Adapter<BatteryConsumerViewHolder> {
+ private final OnBatteryConsumerSelectedListener mListener;
+ private List<BatteryConsumerInfo> mBatteryConsumerList;
+
+ public BatteryConsumerListAdapter(OnBatteryConsumerSelectedListener listener) {
+ mListener = listener;
+ }
+
+ void setBatteryConsumerList(List<BatteryConsumerInfo> batteryConsumerList) {
+ mBatteryConsumerList = batteryConsumerList;
+ notifyDataSetChanged();
+ }
+
+ @Override
+ public int getItemCount() {
+ return mBatteryConsumerList.size();
+ }
+
+ @NonNull
+ @Override
+ public BatteryConsumerViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup,
+ int position) {
+ LayoutInflater layoutInflater = LayoutInflater.from(viewGroup.getContext());
+ View view = layoutInflater.inflate(R.layout.battery_consumer_info_layout, viewGroup,
+ false);
+ return new BatteryConsumerViewHolder(view, mListener);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull BatteryConsumerViewHolder viewHolder, int position) {
+ BatteryConsumerInfo item = mBatteryConsumerList.get(position);
+ viewHolder.id = item.id;
+ viewHolder.titleView.setText(item.label);
+ if (item.details != null) {
+ viewHolder.detailsView.setText(item.details);
+ viewHolder.detailsView.setVisibility(View.VISIBLE);
+ } else {
+ viewHolder.detailsView.setVisibility(View.GONE);
+ }
+ viewHolder.powerView.setText(
+ String.format(Locale.getDefault(), "%.1f mAh", item.powerMah));
+ viewHolder.iconView.setImageDrawable(
+ item.iconInfo.loadIcon(getContext().getPackageManager()));
+ if (item.packages != null) {
+ viewHolder.packagesView.setText(item.packages);
+ viewHolder.packagesView.setVisibility(View.VISIBLE);
+ } else {
+ viewHolder.packagesView.setVisibility(View.GONE);
+ }
+ }
+ }
+
+ // View Holder used when displaying apps
+ public static class BatteryConsumerViewHolder extends RecyclerView.ViewHolder
+ implements View.OnClickListener {
+ private final OnBatteryConsumerSelectedListener mListener;
+
+ public String id;
+ public TextView titleView;
+ public TextView detailsView;
+ public ImageView iconView;
+ public TextView packagesView;
+ public TextView powerView;
+
+ BatteryConsumerViewHolder(View view, OnBatteryConsumerSelectedListener listener) {
+ super(view);
+ mListener = listener;
+ view.setOnClickListener(this);
+ titleView = view.findViewById(android.R.id.title);
+ detailsView = view.findViewById(R.id.details);
+ iconView = view.findViewById(android.R.id.icon);
+ packagesView = view.findViewById(R.id.packages);
+ powerView = view.findViewById(R.id.power_mah);
+ powerView.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ public void onClick(View v) {
+ mListener.onBatteryConsumerSelected(id);
+ }
+ }
+}
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryStatsViewerActivity.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryStatsViewerActivity.java
new file mode 100644
index 0000000..4978010f
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryStatsViewerActivity.java
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2020 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.frameworks.core.batterystatsviewer;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.BatteryStats;
+import android.os.BatteryStatsManager;
+import android.os.BatteryUsageStats;
+import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.activity.ComponentActivity;
+import androidx.activity.result.ActivityResultLauncher;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.loader.app.LoaderManager;
+import androidx.loader.app.LoaderManager.LoaderCallbacks;
+import androidx.loader.content.Loader;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.android.internal.os.BatteryStatsHelper;
+import com.android.settingslib.utils.AsyncLoaderCompat;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+
+public class BatteryStatsViewerActivity extends ComponentActivity {
+ private static final int BATTERY_STATS_REFRESH_RATE_MILLIS = 60 * 1000;
+ public static final String PREF_SELECTED_BATTERY_CONSUMER = "batteryConsumerId";
+ public static final int LOADER_BATTERY_STATS_HELPER = 0;
+ public static final int LOADER_BATTERY_USAGE_STATS = 1;
+
+ private BatteryStatsDataAdapter mBatteryStatsDataAdapter;
+ private Runnable mBatteryStatsRefresh = this::periodicBatteryStatsRefresh;
+ private SharedPreferences mSharedPref;
+ private String mBatteryConsumerId;
+ private TextView mTitleView;
+ private TextView mDetailsView;
+ private ImageView mIconView;
+ private TextView mPackagesView;
+ private RecyclerView mBatteryConsumerDataView;
+ private View mLoadingView;
+ private View mEmptyView;
+ private ActivityResultLauncher<Void> mStartAppPicker = registerForActivityResult(
+ BatteryConsumerPickerActivity.CONTRACT, this::onApplicationSelected);
+ private BatteryStatsHelper mBatteryStatsHelper;
+ private BatteryUsageStats mBatteryUsageStats;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ mSharedPref = getPreferences(Context.MODE_PRIVATE);
+
+ setContentView(R.layout.battery_stats_viewer_layout);
+
+ View appCard = findViewById(R.id.app_card);
+ appCard.setOnClickListener((e) -> startAppPicker());
+
+ mTitleView = findViewById(android.R.id.title);
+ mDetailsView = findViewById(R.id.details);
+ mIconView = findViewById(android.R.id.icon);
+ mPackagesView = findViewById(R.id.packages);
+
+ mBatteryConsumerDataView = findViewById(R.id.battery_consumer_data_view);
+ mBatteryConsumerDataView.setLayoutManager(new LinearLayoutManager(this));
+ mBatteryStatsDataAdapter = new BatteryStatsDataAdapter();
+ mBatteryConsumerDataView.setAdapter(mBatteryStatsDataAdapter);
+
+ mLoadingView = findViewById(R.id.loading_view);
+ mEmptyView = findViewById(R.id.empty_view);
+
+ mBatteryConsumerId = mSharedPref.getString(PREF_SELECTED_BATTERY_CONSUMER, null);
+ loadBatteryStats();
+ if (mBatteryConsumerId == null) {
+ startAppPicker();
+ }
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ periodicBatteryStatsRefresh();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ getMainThreadHandler().removeCallbacks(mBatteryStatsRefresh);
+ }
+
+ private void startAppPicker() {
+ mStartAppPicker.launch(null);
+ }
+
+ private void onApplicationSelected(String batteryConsumerId) {
+ if (batteryConsumerId == null) {
+ if (mBatteryConsumerId == null) {
+ finish();
+ }
+ } else {
+ mBatteryConsumerId = batteryConsumerId;
+ mSharedPref.edit()
+ .putString(PREF_SELECTED_BATTERY_CONSUMER, mBatteryConsumerId)
+ .apply();
+ mLoadingView.setVisibility(View.VISIBLE);
+ loadBatteryStats();
+ }
+ }
+
+ private void periodicBatteryStatsRefresh() {
+ loadBatteryStats();
+ getMainThreadHandler().postDelayed(mBatteryStatsRefresh, BATTERY_STATS_REFRESH_RATE_MILLIS);
+ }
+
+ private void loadBatteryStats() {
+ LoaderManager loaderManager = LoaderManager.getInstance(this);
+ loaderManager.restartLoader(LOADER_BATTERY_STATS_HELPER, null,
+ new BatteryStatsHelperLoaderCallbacks());
+ loaderManager.restartLoader(LOADER_BATTERY_USAGE_STATS, null,
+ new BatteryUsageStatsLoaderCallbacks());
+ }
+
+ private static class BatteryStatsHelperLoader extends AsyncLoaderCompat<BatteryStatsHelper> {
+ private final BatteryStatsHelper mBatteryStatsHelper;
+ private final UserManager mUserManager;
+
+ BatteryStatsHelperLoader(Context context) {
+ super(context);
+ mUserManager = context.getSystemService(UserManager.class);
+ mBatteryStatsHelper = new BatteryStatsHelper(context,
+ false /* collectBatteryBroadcast */);
+ mBatteryStatsHelper.create((Bundle) null);
+ mBatteryStatsHelper.clearStats();
+ }
+
+ @Override
+ public BatteryStatsHelper loadInBackground() {
+ mBatteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
+ UserHandle.myUserId());
+ return mBatteryStatsHelper;
+ }
+
+ @Override
+ protected void onDiscardResult(BatteryStatsHelper result) {
+ }
+ }
+
+ private class BatteryStatsHelperLoaderCallbacks implements LoaderCallbacks<BatteryStatsHelper> {
+ @NonNull
+ @Override
+ public Loader<BatteryStatsHelper> onCreateLoader(int id, Bundle args) {
+ return new BatteryStatsHelperLoader(BatteryStatsViewerActivity.this);
+ }
+
+ @Override
+ public void onLoadFinished(@NonNull Loader<BatteryStatsHelper> loader,
+ BatteryStatsHelper batteryStatsHelper) {
+ onBatteryStatsHelperLoaded(batteryStatsHelper);
+ }
+
+ @Override
+ public void onLoaderReset(@NonNull Loader<BatteryStatsHelper> loader) {
+ }
+ }
+
+ private static class BatteryUsageStatsLoader extends AsyncLoaderCompat<BatteryUsageStats> {
+ private final BatteryStatsManager mBatteryStatsManager;
+
+ BatteryUsageStatsLoader(Context context) {
+ super(context);
+ mBatteryStatsManager = context.getSystemService(BatteryStatsManager.class);
+ }
+
+ @Override
+ public BatteryUsageStats loadInBackground() {
+ return mBatteryStatsManager.getBatteryUsageStats();
+ }
+
+ @Override
+ protected void onDiscardResult(BatteryUsageStats result) {
+ }
+ }
+
+ private class BatteryUsageStatsLoaderCallbacks implements LoaderCallbacks<BatteryUsageStats> {
+ @NonNull
+ @Override
+ public Loader<BatteryUsageStats> onCreateLoader(int id, Bundle args) {
+ return new BatteryUsageStatsLoader(BatteryStatsViewerActivity.this);
+ }
+
+ @Override
+ public void onLoadFinished(@NonNull Loader<BatteryUsageStats> loader,
+ BatteryUsageStats batteryUsageStats) {
+ onBatteryUsageStatsLoaded(batteryUsageStats);
+ }
+
+ @Override
+ public void onLoaderReset(@NonNull Loader<BatteryUsageStats> loader) {
+ }
+ }
+
+ public void onBatteryStatsHelperLoaded(BatteryStatsHelper batteryStatsHelper) {
+ mBatteryStatsHelper = batteryStatsHelper;
+ onBatteryStatsDataLoaded();
+ }
+
+ private void onBatteryUsageStatsLoaded(BatteryUsageStats batteryUsageStats) {
+ mBatteryUsageStats = batteryUsageStats;
+ onBatteryStatsDataLoaded();
+ }
+
+ public void onBatteryStatsDataLoaded() {
+ if (mBatteryStatsHelper == null || mBatteryUsageStats == null) {
+ return;
+ }
+
+ BatteryConsumerData batteryConsumerData = new BatteryConsumerData(this, mBatteryStatsHelper,
+ mBatteryUsageStats, mBatteryConsumerId);
+
+ BatteryConsumerInfoHelper.BatteryConsumerInfo
+ batteryConsumerInfo = batteryConsumerData.getBatteryConsumerInfo();
+ if (batteryConsumerInfo == null) {
+ mTitleView.setText("Battery consumer not found");
+ mPackagesView.setVisibility(View.GONE);
+ } else {
+ mTitleView.setText(batteryConsumerInfo.label);
+ if (batteryConsumerInfo.details != null) {
+ mDetailsView.setText(batteryConsumerInfo.details);
+ mDetailsView.setVisibility(View.VISIBLE);
+ } else {
+ mDetailsView.setVisibility(View.GONE);
+ }
+ mIconView.setImageDrawable(
+ batteryConsumerInfo.iconInfo.loadIcon(getPackageManager()));
+
+ if (batteryConsumerInfo.packages != null) {
+ mPackagesView.setText(batteryConsumerInfo.packages);
+ mPackagesView.setVisibility(View.VISIBLE);
+ } else {
+ mPackagesView.setVisibility(View.GONE);
+ }
+ }
+
+ mBatteryStatsDataAdapter.setEntries(batteryConsumerData.getEntries());
+ if (batteryConsumerData.getEntries().isEmpty()) {
+ mEmptyView.setVisibility(View.VISIBLE);
+ mBatteryConsumerDataView.setVisibility(View.GONE);
+ } else {
+ mEmptyView.setVisibility(View.GONE);
+ mBatteryConsumerDataView.setVisibility(View.VISIBLE);
+ }
+
+ mLoadingView.setVisibility(View.GONE);
+ }
+
+ private static class BatteryStatsDataAdapter extends
+ RecyclerView.Adapter<BatteryStatsDataAdapter.ViewHolder> {
+ public static class ViewHolder extends RecyclerView.ViewHolder {
+ public TextView titleTextView;
+ public TextView amountTextView;
+ public TextView percentTextView;
+
+ ViewHolder(View itemView) {
+ super(itemView);
+
+ titleTextView = itemView.findViewById(R.id.title);
+ amountTextView = itemView.findViewById(R.id.amount);
+ percentTextView = itemView.findViewById(R.id.percent);
+ }
+ }
+
+ private List<BatteryConsumerData.Entry> mEntries = Collections.emptyList();
+
+ public void setEntries(List<BatteryConsumerData.Entry> entries) {
+ mEntries = entries;
+ notifyDataSetChanged();
+ }
+
+ @Override
+ public int getItemCount() {
+ return mEntries.size();
+ }
+
+ @NonNull
+ @Override
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int position) {
+ LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
+ View itemView = layoutInflater.inflate(R.layout.battery_consumer_entry_layout, parent,
+ false);
+ return new ViewHolder(itemView);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) {
+ BatteryConsumerData.Entry entry = mEntries.get(position);
+ switch (entry.entryType) {
+ case POWER:
+ viewHolder.titleTextView.setText(entry.title);
+ viewHolder.amountTextView.setText(
+ String.format(Locale.getDefault(), "%.1f mAh", entry.value));
+ break;
+ case DURATION:
+ viewHolder.titleTextView.setText(entry.title);
+ viewHolder.amountTextView.setText(
+ String.format(Locale.getDefault(), "%,d ms", (long) entry.value));
+ break;
+ }
+
+ double proportion = entry.total != 0 ? entry.value * 100 / entry.total : 0;
+ viewHolder.percentTextView.setText(String.format(Locale.getDefault(), "%.1f%%",
+ proportion));
+ }
+ }
+}
diff --git a/core/tests/batterystatstests/OWNERS b/core/tests/batterystatstests/OWNERS
new file mode 100644
index 0000000..c22f6a4
--- /dev/null
+++ b/core/tests/batterystatstests/OWNERS
@@ -0,0 +1,2 @@
+include /BATTERY_STATS_OWNERS
+include /services/core/java/com/android/server/power/OWNERS
diff --git a/core/tests/benchmarks/src/android/net/OWNERS b/core/tests/benchmarks/src/android/net/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/core/tests/benchmarks/src/android/net/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/core/tests/bluetoothtests/OWNERS b/core/tests/bluetoothtests/OWNERS
new file mode 100644
index 0000000..98bb877
--- /dev/null
+++ b/core/tests/bluetoothtests/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/bluetooth/OWNERS
diff --git a/core/tests/coretests/apks/OWNERS b/core/tests/coretests/apks/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/core/tests/coretests/apks/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/core/tests/coretests/src/android/accessibilityservice/OWNERS b/core/tests/coretests/src/android/accessibilityservice/OWNERS
new file mode 100644
index 0000000..b74281e
--- /dev/null
+++ b/core/tests/coretests/src/android/accessibilityservice/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/accessibility/OWNERS
diff --git a/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java b/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java
index 95da532..4b0ed65 100644
--- a/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java
+++ b/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java
@@ -90,7 +90,7 @@
private boolean mAllow3rdPartyOnInternal = true;
public MockedApplicationPackageManager() {
- super(null, null, null);
+ super(null, null);
}
public void setForceAllowOnExternal(boolean forceAllowOnExternal) {
diff --git a/core/tests/coretests/src/android/app/OWNERS b/core/tests/coretests/src/android/app/OWNERS
new file mode 100644
index 0000000..bd7da0c
--- /dev/null
+++ b/core/tests/coretests/src/android/app/OWNERS
@@ -0,0 +1 @@
+per-file Window*.java = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/core/tests/coretests/src/android/app/activity/OWNERS b/core/tests/coretests/src/android/app/activity/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/core/tests/coretests/src/android/app/activity/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/core/tests/coretests/src/android/app/servertransaction/OWNERS b/core/tests/coretests/src/android/app/servertransaction/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/core/tests/coretests/src/android/app/servertransaction/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java b/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java
index 4654f63..b2b34d6 100644
--- a/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java
+++ b/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java
@@ -26,6 +26,7 @@
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
+import android.app.servertransaction.TestUtils.LaunchActivityItemBuilder;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
@@ -43,6 +44,8 @@
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.function.Supplier;
+
/**
* Tests for {@link ObjectPool}.
*
@@ -144,24 +147,22 @@
persistableBundle.putInt("k", 4);
IBinder assistToken = new Binder();
- LaunchActivityItem emptyItem = LaunchActivityItem.obtain(null, 0, null, null, null, null,
- null, null, 0, null, null, null, null, false, null, null, null);
- LaunchActivityItem item = LaunchActivityItem.obtain(intent, ident, activityInfo,
- config(), overrideConfig, compat, referrer, null /* voiceInteractor */,
- procState, bundle, persistableBundle, resultInfoList(), referrerIntentList(),
- true /* isForward */, null /* profilerInfo */, assistToken,
- null /* fixedRotationAdjustments */);
+ Supplier<LaunchActivityItem> itemSupplier = () -> new LaunchActivityItemBuilder()
+ .setIntent(intent).setIdent(ident).setInfo(activityInfo).setCurConfig(config())
+ .setOverrideConfig(overrideConfig).setCompatInfo(compat).setReferrer(referrer)
+ .setProcState(procState).setState(bundle).setPersistentState(persistableBundle)
+ .setPendingResults(resultInfoList()).setPendingNewIntents(referrerIntentList())
+ .setIsForward(true).setAssistToken(assistToken).build();
+
+ LaunchActivityItem emptyItem = new LaunchActivityItemBuilder().build();
+ LaunchActivityItem item = itemSupplier.get();
assertNotSame(item, emptyItem);
assertFalse(item.equals(emptyItem));
item.recycle();
assertEquals(item, emptyItem);
- LaunchActivityItem item2 = LaunchActivityItem.obtain(intent, ident, activityInfo,
- config(), overrideConfig, compat, referrer, null /* voiceInteractor */,
- procState, bundle, persistableBundle, resultInfoList(), referrerIntentList(),
- true /* isForward */, null /* profilerInfo */, assistToken,
- null /* fixedRotationAdjustments */);
+ LaunchActivityItem item2 = itemSupplier.get();
assertSame(item, item2);
assertFalse(item2.equals(emptyItem));
}
diff --git a/core/tests/coretests/src/android/app/servertransaction/TestUtils.java b/core/tests/coretests/src/android/app/servertransaction/TestUtils.java
index d125fe7..7e9933c 100644
--- a/core/tests/coretests/src/android/app/servertransaction/TestUtils.java
+++ b/core/tests/coretests/src/android/app/servertransaction/TestUtils.java
@@ -18,11 +18,19 @@
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
+import android.app.ProfilerInfo;
import android.app.ResultInfo;
import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.PersistableBundle;
import android.util.MergedConfiguration;
+import android.view.DisplayAdjustments.FixedRotationAdjustments;
+import com.android.internal.app.IVoiceInteractor;
import com.android.internal.content.ReferrerIntent;
import java.util.ArrayList;
@@ -81,4 +89,117 @@
return referrerIntents;
}
+
+ static class LaunchActivityItemBuilder {
+ private Intent mIntent;
+ private int mIdent;
+ private ActivityInfo mInfo;
+ private Configuration mCurConfig;
+ private Configuration mOverrideConfig;
+ private CompatibilityInfo mCompatInfo;
+ private String mReferrer;
+ private IVoiceInteractor mVoiceInteractor;
+ private int mProcState;
+ private Bundle mState;
+ private PersistableBundle mPersistentState;
+ private List<ResultInfo> mPendingResults;
+ private List<ReferrerIntent> mPendingNewIntents;
+ private boolean mIsForward;
+ private ProfilerInfo mProfilerInfo;
+ private IBinder mAssistToken;
+ private FixedRotationAdjustments mFixedRotationAdjustments;
+
+ LaunchActivityItemBuilder setIntent(Intent intent) {
+ mIntent = intent;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setIdent(int ident) {
+ mIdent = ident;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setInfo(ActivityInfo info) {
+ mInfo = info;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setCurConfig(Configuration curConfig) {
+ mCurConfig = curConfig;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setOverrideConfig(Configuration overrideConfig) {
+ mOverrideConfig = overrideConfig;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setCompatInfo(CompatibilityInfo compatInfo) {
+ mCompatInfo = compatInfo;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setReferrer(String referrer) {
+ mReferrer = referrer;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setVoiceInteractor(IVoiceInteractor voiceInteractor) {
+ mVoiceInteractor = voiceInteractor;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setProcState(int procState) {
+ mProcState = procState;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setState(Bundle state) {
+ mState = state;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setPersistentState(PersistableBundle persistentState) {
+ mPersistentState = persistentState;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setPendingResults(List<ResultInfo> pendingResults) {
+ mPendingResults = pendingResults;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setPendingNewIntents(List<ReferrerIntent> pendingNewIntents) {
+ mPendingNewIntents = pendingNewIntents;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setIsForward(boolean isForward) {
+ mIsForward = isForward;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setProfilerInfo(ProfilerInfo profilerInfo) {
+ mProfilerInfo = profilerInfo;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setAssistToken(IBinder assistToken) {
+ mAssistToken = assistToken;
+ return this;
+ }
+
+ LaunchActivityItemBuilder setFixedRotationAdjustments(FixedRotationAdjustments fra) {
+ mFixedRotationAdjustments = fra;
+ return this;
+ }
+
+ LaunchActivityItem build() {
+ return LaunchActivityItem.obtain(mIntent, mIdent, mInfo,
+ mCurConfig, mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor,
+ mProcState, mState, mPersistentState, mPendingResults, mPendingNewIntents,
+ mIsForward, mProfilerInfo, mAssistToken, null /* activityClientController */,
+ mFixedRotationAdjustments);
+ }
+ }
}
diff --git a/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java b/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java
index 0ae789a..32f8929 100644
--- a/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java
+++ b/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java
@@ -41,6 +41,7 @@
import android.app.ActivityThread.ActivityClientRecord;
import android.app.ClientTransactionHandler;
import android.app.servertransaction.ActivityLifecycleItem.LifecycleState;
+import android.app.servertransaction.TestUtils.LaunchActivityItemBuilder;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
@@ -263,13 +264,7 @@
// A previous queued launch transaction runs on main thread (execute).
final ClientTransaction launchTransaction = ClientTransaction.obtain(null /* client */,
token /* activityToken */);
- final LaunchActivityItem launchItem = spy(LaunchActivityItem.obtain(
- null /* intent */, 0 /* ident */, null /* info */, null /* curConfig */,
- null, /* overrideConfig */ null /* compatInfo */, null /* referrer */ ,
- null /* voiceInteractor */, 0 /* procState */, null /* state */,
- null /* persistentState */, null /* pendingResults */,
- null /* pendingNewIntents */, false /* isForward */, null /* profilerInfo */,
- null /* assistToken */, null /* fixedRotationAdjustments */));
+ final LaunchActivityItem launchItem = spy(new LaunchActivityItemBuilder().build());
launchTransaction.addCallback(launchItem);
mExecutor.execute(launchTransaction);
diff --git a/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java b/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java
index 7e99298..e1c7146 100644
--- a/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java
+++ b/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java
@@ -29,6 +29,7 @@
import android.app.IInstrumentationWatcher;
import android.app.IUiAutomationConnection;
import android.app.ProfilerInfo;
+import android.app.servertransaction.TestUtils.LaunchActivityItemBuilder;
import android.content.AutofillOptions;
import android.content.ComponentName;
import android.content.ContentCaptureOptions;
@@ -195,11 +196,14 @@
FixedRotationAdjustments fixedRotationAdjustments = new FixedRotationAdjustments(
Surface.ROTATION_90, 1920, 1080, DisplayCutout.NO_CUTOUT);
- LaunchActivityItem item = LaunchActivityItem.obtain(intent, ident, activityInfo,
- config(), overrideConfig, compat, referrer, null /* voiceInteractor */,
- procState, bundle, persistableBundle, resultInfoList(), referrerIntentList(),
- true /* isForward */, null /* profilerInfo */, new Binder(),
- fixedRotationAdjustments);
+ LaunchActivityItem item = new LaunchActivityItemBuilder()
+ .setIntent(intent).setIdent(ident).setInfo(activityInfo).setCurConfig(config())
+ .setOverrideConfig(overrideConfig).setCompatInfo(compat).setReferrer(referrer)
+ .setProcState(procState).setState(bundle).setPersistentState(persistableBundle)
+ .setPendingResults(resultInfoList()).setPendingNewIntents(referrerIntentList())
+ .setIsForward(true).setAssistToken(new Binder())
+ .setFixedRotationAdjustments(fixedRotationAdjustments).build();
+
writeAndPrepareForReading(item);
// Read from parcel and assert
diff --git a/core/tests/coretests/src/android/app/time/OWNERS b/core/tests/coretests/src/android/app/time/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/tests/coretests/src/android/app/time/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/android/app/timedetector/GnssTimeSuggestionTest.java b/core/tests/coretests/src/android/app/timedetector/GnssTimeSuggestionTest.java
new file mode 100644
index 0000000..e248010
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timedetector/GnssTimeSuggestionTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2020 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.app.timedetector;
+
+import static android.app.timezonedetector.ParcelableTestSupport.assertRoundTripParcelable;
+import static android.app.timezonedetector.ParcelableTestSupport.roundTripParcelable;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+import android.os.TimestampedValue;
+
+import org.junit.Test;
+
+public class GnssTimeSuggestionTest {
+
+ private static final TimestampedValue<Long> ARBITRARY_TIME =
+ new TimestampedValue<>(1111L, 2222L);
+
+ @Test
+ public void testEquals() {
+ GnssTimeSuggestion one = new GnssTimeSuggestion(ARBITRARY_TIME);
+ assertEquals(one, one);
+
+ GnssTimeSuggestion two = new GnssTimeSuggestion(ARBITRARY_TIME);
+ assertEquals(one, two);
+ assertEquals(two, one);
+
+ TimestampedValue<Long> differentTime = new TimestampedValue<>(
+ ARBITRARY_TIME.getReferenceTimeMillis() + 1,
+ ARBITRARY_TIME.getValue());
+ GnssTimeSuggestion three = new GnssTimeSuggestion(differentTime);
+ assertNotEquals(one, three);
+ assertNotEquals(three, one);
+
+ // DebugInfo must not be considered in equals().
+ one.addDebugInfo("Debug info 1");
+ two.addDebugInfo("Debug info 2");
+ assertEquals(one, two);
+ }
+
+ @Test
+ public void testParcelable() {
+ GnssTimeSuggestion suggestion = new GnssTimeSuggestion(ARBITRARY_TIME);
+ assertRoundTripParcelable(suggestion);
+
+ // DebugInfo should also be stored (but is not checked by equals()
+ suggestion.addDebugInfo("This is debug info");
+ GnssTimeSuggestion rtSuggestion = roundTripParcelable(suggestion);
+ assertEquals(suggestion.getDebugInfo(), rtSuggestion.getDebugInfo());
+ }
+}
diff --git a/core/tests/coretests/src/android/app/timedetector/OWNERS b/core/tests/coretests/src/android/app/timedetector/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/android/app/timezone/OWNERS b/core/tests/coretests/src/android/app/timezone/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/android/app/timezonedetector/OWNERS b/core/tests/coretests/src/android/app/timezonedetector/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timezonedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/android/content/OWNERS b/core/tests/coretests/src/android/content/OWNERS
new file mode 100644
index 0000000..911efb2
--- /dev/null
+++ b/core/tests/coretests/src/android/content/OWNERS
@@ -0,0 +1 @@
+per-file ContextTest.java = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/core/tests/coretests/src/android/database/OWNERS b/core/tests/coretests/src/android/database/OWNERS
new file mode 100644
index 0000000..bb9a2ca
--- /dev/null
+++ b/core/tests/coretests/src/android/database/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/database/OWNERS
diff --git a/core/tests/coretests/src/android/net/OWNERS b/core/tests/coretests/src/android/net/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/core/tests/coretests/src/android/net/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/core/tests/coretests/src/android/os/VibratorInfoTest.java b/core/tests/coretests/src/android/os/VibratorInfoTest.java
new file mode 100644
index 0000000..8941190
--- /dev/null
+++ b/core/tests/coretests/src/android/os/VibratorInfoTest.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2020 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.os;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+
+import android.platform.test.annotations.Presubmit;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@Presubmit
+@RunWith(JUnit4.class)
+public class VibratorInfoTest {
+
+ @Test
+ public void testHasAmplitudeControl() {
+ assertFalse(createInfo(/* capabilities= */ 0).hasAmplitudeControl());
+ assertTrue(createInfo(VibratorInfo.CAPABILITY_COMPOSE_EFFECTS
+ | VibratorInfo.CAPABILITY_AMPLITUDE_CONTROL).hasAmplitudeControl());
+ }
+
+ @Test
+ public void testHasCapabilities() {
+ assertTrue(createInfo(VibratorInfo.CAPABILITY_COMPOSE_EFFECTS)
+ .hasCapability(VibratorInfo.CAPABILITY_COMPOSE_EFFECTS));
+ assertFalse(createInfo(VibratorInfo.CAPABILITY_COMPOSE_EFFECTS)
+ .hasCapability(VibratorInfo.CAPABILITY_AMPLITUDE_CONTROL));
+ }
+
+ @Test
+ public void testIsEffectSupported() {
+ VibratorInfo info = new VibratorInfo(/* id= */ 0, /* capabilities= */0,
+ new int[]{VibrationEffect.EFFECT_CLICK}, null);
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN,
+ createInfo(/* capabilities= */ 0).isEffectSupported(VibrationEffect.EFFECT_CLICK));
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_YES,
+ info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_NO,
+ info.isEffectSupported(VibrationEffect.EFFECT_TICK));
+ }
+
+ @Test
+ public void testIsPrimitiveSupported() {
+ VibratorInfo info = new VibratorInfo(/* id= */ 0, VibratorInfo.CAPABILITY_COMPOSE_EFFECTS,
+ null, new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK});
+ assertTrue(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ assertFalse(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_TICK));
+
+ // Returns false when there is no compose capability.
+ info = new VibratorInfo(/* id= */ 0, /* capabilities= */ 0,
+ null, new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK});
+ assertFalse(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ }
+
+ @Test
+ public void testEquals() {
+ VibratorInfo empty = new VibratorInfo(1, 0, null, null);
+ VibratorInfo complete = new VibratorInfo(1, VibratorInfo.CAPABILITY_AMPLITUDE_CONTROL,
+ new int[]{VibrationEffect.EFFECT_CLICK},
+ new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK});
+
+ assertEquals(complete, complete);
+ assertEquals(complete, new VibratorInfo(1, VibratorInfo.CAPABILITY_AMPLITUDE_CONTROL,
+ new int[]{VibrationEffect.EFFECT_CLICK},
+ new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK}));
+
+ assertFalse(empty.equals(new VibratorInfo(1, 0, new int[]{}, new int[]{})));
+ assertFalse(complete.equals(new VibratorInfo(1, VibratorInfo.CAPABILITY_COMPOSE_EFFECTS,
+ new int[]{VibrationEffect.EFFECT_CLICK},
+ new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK})));
+ assertFalse(complete.equals(new VibratorInfo(1, VibratorInfo.CAPABILITY_AMPLITUDE_CONTROL,
+ new int[]{}, new int[]{})));
+ assertFalse(complete.equals(new VibratorInfo(1, VibratorInfo.CAPABILITY_AMPLITUDE_CONTROL,
+ null, new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK})));
+ assertFalse(complete.equals(new VibratorInfo(1, VibratorInfo.CAPABILITY_AMPLITUDE_CONTROL,
+ new int[]{VibrationEffect.EFFECT_CLICK}, null)));
+ }
+
+ @Test
+ public void testSerialization() {
+ VibratorInfo original = new VibratorInfo(1, VibratorInfo.CAPABILITY_COMPOSE_EFFECTS,
+ new int[]{VibrationEffect.EFFECT_CLICK}, null);
+
+ Parcel parcel = Parcel.obtain();
+ original.writeToParcel(parcel, 0);
+ parcel.setDataPosition(0);
+ VibratorInfo restored = VibratorInfo.CREATOR.createFromParcel(parcel);
+ assertEquals(original, restored);
+ }
+
+ private static VibratorInfo createInfo(long capabilities) {
+ return new VibratorInfo(/* id= */ 0, capabilities, null, null);
+ }
+}
diff --git a/core/tests/coretests/src/android/os/VibratorTest.java b/core/tests/coretests/src/android/os/VibratorTest.java
index c3d84ec..575a1be 100644
--- a/core/tests/coretests/src/android/os/VibratorTest.java
+++ b/core/tests/coretests/src/android/os/VibratorTest.java
@@ -55,6 +55,26 @@
}
@Test
+ public void areEffectsSupported_returnsArrayOfSameSize() {
+ assertEquals(0, mVibratorSpy.areEffectsSupported(new int[0]).length);
+ assertEquals(1,
+ mVibratorSpy.areEffectsSupported(new int[]{VibrationEffect.EFFECT_CLICK}).length);
+ assertEquals(2,
+ mVibratorSpy.areEffectsSupported(new int[]{VibrationEffect.EFFECT_CLICK,
+ VibrationEffect.EFFECT_TICK}).length);
+ }
+
+ @Test
+ public void arePrimitivesSupported_returnsArrayOfSameSize() {
+ assertEquals(0, mVibratorSpy.arePrimitivesSupported(new int[0]).length);
+ assertEquals(1, mVibratorSpy.arePrimitivesSupported(
+ new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK}).length);
+ assertEquals(2, mVibratorSpy.arePrimitivesSupported(
+ new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK,
+ VibrationEffect.Composition.PRIMITIVE_QUICK_RISE}).length);
+ }
+
+ @Test
public void vibrate_withAudioAttributes_createsVibrationAttributesWithSameUsage() {
VibrationEffect effect = VibrationEffect.get(VibrationEffect.EFFECT_CLICK);
AudioAttributes audioAttributes = new AudioAttributes.Builder().setUsage(
diff --git a/core/tests/coretests/src/com/android/internal/accessibility/OWNERS b/core/tests/coretests/src/com/android/internal/accessibility/OWNERS
new file mode 100644
index 0000000..b74281e
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/accessibility/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/accessibility/OWNERS
diff --git a/core/tests/coretests/src/com/android/internal/inputmethod/OWNERS b/core/tests/coretests/src/com/android/internal/inputmethod/OWNERS
new file mode 100644
index 0000000..5deb2ce
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/inputmethod/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/inputmethod/OWNERS
diff --git a/core/tests/coretests/src/com/android/internal/jank/OWNERS b/core/tests/coretests/src/com/android/internal/jank/OWNERS
new file mode 100644
index 0000000..faece08
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/jank/OWNERS
@@ -0,0 +1 @@
+include /core/java/com/android/internal/jank/OWNERS
\ No newline at end of file
diff --git a/core/tests/coretests/src/com/android/internal/os/KernelSingleProcessCpuThreadReaderTest.java b/core/tests/coretests/src/com/android/internal/os/KernelSingleProcessCpuThreadReaderTest.java
index b5720a2..2de800b 100644
--- a/core/tests/coretests/src/com/android/internal/os/KernelSingleProcessCpuThreadReaderTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/KernelSingleProcessCpuThreadReaderTest.java
@@ -19,122 +19,87 @@
import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertTrue;
-
-import android.content.Context;
-import android.os.FileUtils;
-
-import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
-import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.io.File;
import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
@SmallTest
@RunWith(AndroidJUnit4.class)
public class KernelSingleProcessCpuThreadReaderTest {
- private File mProcDirectory;
-
- @Before
- public void setUp() {
- Context context = InstrumentationRegistry.getContext();
- mProcDirectory = context.getDir("proc", Context.MODE_PRIVATE);
- }
-
- @After
- public void tearDown() throws Exception {
- FileUtils.deleteContents(mProcDirectory);
- }
-
@Test
public void getProcessCpuUsage() throws IOException {
- setupDirectory(42,
- new int[] {42, 1, 2, 3},
- new int[] {1000, 2000},
- // Units are 10ms aka 10000Us
- new int[][] {{100, 200}, {0, 200}, {100, 300}, {0, 600}},
- new int[] {4500, 500});
+ // Units are nanoseconds
+ MockCpuTimeInStateReader mockReader = new MockCpuTimeInStateReader(4, new String[] {
+ "0:1000000000 2000000000 3000000000:4000000000",
+ "1:100000000 200000000 300000000:400000000",
+ });
KernelSingleProcessCpuThreadReader reader = new KernelSingleProcessCpuThreadReader(42,
- mProcDirectory.toPath());
+ mockReader);
+ reader.setSelectedThreadIds(new int[] {2, 3});
+ reader.startTrackingThreadCpuTimes();
KernelSingleProcessCpuThreadReader.ProcessCpuUsage processCpuUsage =
- reader.getProcessCpuUsage(new int[] {2, 3});
- assertThat(processCpuUsage.threadCpuTimesMillis).isEqualTo(new long[] {2000, 13000});
- assertThat(processCpuUsage.selectedThreadCpuTimesMillis).isEqualTo(new long[] {1000, 9000});
- assertThat(processCpuUsage.processCpuTimesMillis).isEqualTo(new long[] {6666, 43333});
+ reader.getProcessCpuUsage();
+ assertThat(mockReader.mTrackedTgid).isEqualTo(42);
+ // The strings are formatted as <TID TGID AGG_KEY>, where AGG_KEY is 1 for binder
+ // threads and 0 for all other threads.
+ assertThat(mockReader.mTrackedTasks).containsExactly(
+ "2 1",
+ "3 1");
+ assertThat(processCpuUsage.threadCpuTimesMillis).isEqualTo(
+ new long[] {1100, 2200, 3300, 4400});
+ assertThat(processCpuUsage.selectedThreadCpuTimesMillis).isEqualTo(
+ new long[] {100, 200, 300, 400});
}
@Test
public void getCpuFrequencyCount() throws IOException {
- setupDirectory(13,
- new int[] {13},
- new int[] {1000, 2000, 3000},
- new int[][] {{100, 200, 300}},
- new int[] {14, 15});
+ MockCpuTimeInStateReader mockReader = new MockCpuTimeInStateReader(3, new String[0]);
KernelSingleProcessCpuThreadReader reader = new KernelSingleProcessCpuThreadReader(13,
- mProcDirectory.toPath());
+ mockReader);
int cpuFrequencyCount = reader.getCpuFrequencyCount();
assertThat(cpuFrequencyCount).isEqualTo(3);
}
- private void setupDirectory(int pid, int[] threadIds, int[] cpuFrequencies,
- int[][] threadCpuTimes, int[] processCpuTimes)
- throws IOException {
+ public static class MockCpuTimeInStateReader implements
+ KernelSingleProcessCpuThreadReader.CpuTimeInStateReader {
+ private final int mCpuFrequencyCount;
+ private final String[] mAggregatedTaskCpuFreqTimes;
+ public int mTrackedTgid;
+ public List<String> mTrackedTasks = new ArrayList<>();
- assertTrue(mProcDirectory.toPath().resolve("self").toFile().mkdirs());
-
- try (OutputStream timeInStateStream =
- Files.newOutputStream(
- mProcDirectory.toPath().resolve("self").resolve("time_in_state"))) {
- for (int i = 0; i < cpuFrequencies.length; i++) {
- final String line = cpuFrequencies[i] + " 0\n";
- timeInStateStream.write(line.getBytes());
- }
+ public MockCpuTimeInStateReader(int cpuFrequencyCount,
+ String[] aggregatedTaskCpuFreqTimes) {
+ mCpuFrequencyCount = cpuFrequencyCount;
+ mAggregatedTaskCpuFreqTimes = aggregatedTaskCpuFreqTimes;
}
- Path processPath = mProcDirectory.toPath().resolve(String.valueOf(pid));
-
- // Make /proc/$PID
- assertTrue(processPath.toFile().mkdirs());
-
- // Write /proc/$PID/stat. Only the fields 14-17 matter.
- try (OutputStream timeInStateStream = Files.newOutputStream(processPath.resolve("stat"))) {
- timeInStateStream.write(
- (pid + " (test) S 4 5 6 7 8 9 10 11 12 13 "
- + processCpuTimes[0] + " "
- + processCpuTimes[1] + " "
- + "16 17 18 19 20 ...").getBytes());
+ @Override
+ public int getCpuFrequencyCount() {
+ return mCpuFrequencyCount;
}
- // Make /proc/$PID/task
- final Path selfThreadsPath = processPath.resolve("task");
- assertTrue(selfThreadsPath.toFile().mkdirs());
+ @Override
+ public boolean startTrackingProcessCpuTimes(int tgid) {
+ mTrackedTgid = tgid;
+ return true;
+ }
- // Make thread directories
- for (int i = 0; i < threadIds.length; i++) {
- // Make /proc/$PID/task/$TID
- final Path threadPath = selfThreadsPath.resolve(String.valueOf(threadIds[i]));
- assertTrue(threadPath.toFile().mkdirs());
+ public boolean startAggregatingTaskCpuTimes(int pid, int aggregationKey) {
+ mTrackedTasks.add(pid + " " + aggregationKey);
+ return true;
+ }
- // Make /proc/$PID/task/$TID/time_in_state
- try (OutputStream timeInStateStream =
- Files.newOutputStream(threadPath.resolve("time_in_state"))) {
- for (int j = 0; j < cpuFrequencies.length; j++) {
- final String line = cpuFrequencies[j] + " " + threadCpuTimes[i][j] + "\n";
- timeInStateStream.write(line.getBytes());
- }
- }
+ public String[] getAggregatedTaskCpuFreqTimes(int pid) {
+ return mAggregatedTaskCpuFreqTimes;
}
}
}
diff --git a/core/tests/coretests/src/com/android/internal/os/SystemServerCpuThreadReaderTest.java b/core/tests/coretests/src/com/android/internal/os/SystemServerCpuThreadReaderTest.java
index 121c637..d116d4d 100644
--- a/core/tests/coretests/src/com/android/internal/os/SystemServerCpuThreadReaderTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/SystemServerCpuThreadReaderTest.java
@@ -16,146 +16,86 @@
package com.android.internal.os;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertTrue;
+import static com.google.common.truth.Truth.assertThat;
-import android.content.Context;
-import android.os.FileUtils;
-
-import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
-import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.io.File;
import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
@SmallTest
@RunWith(AndroidJUnit4.class)
public class SystemServerCpuThreadReaderTest {
- private File mProcDirectory;
-
- @Before
- public void setUp() {
- Context context = InstrumentationRegistry.getContext();
- mProcDirectory = context.getDir("proc", Context.MODE_PRIVATE);
- }
-
- @After
- public void tearDown() throws Exception {
- FileUtils.deleteContents(mProcDirectory);
- }
@Test
- public void testReaderDelta_firstTime() throws IOException {
+ public void testReadDelta() throws IOException {
int pid = 42;
- setupDirectory(
- pid,
- new int[] {42, 1, 2, 3},
- new int[] {1000, 2000},
- // Units are 10ms aka 10000Us
- new int[][] {{100, 200}, {0, 200}, {0, 300}, {0, 400}},
- new int[] {1400, 1500});
- SystemServerCpuThreadReader reader = new SystemServerCpuThreadReader(
- mProcDirectory.toPath(), pid);
- reader.setBinderThreadNativeTids(new int[] {1, 3});
- SystemServerCpuThreadReader.SystemServiceCpuThreadTimes systemServiceCpuThreadTimes =
- reader.readDelta();
- assertArrayEquals(new long[] {100 * 10000, 1100 * 10000},
- systemServiceCpuThreadTimes.threadCpuTimesUs);
- assertArrayEquals(new long[] {0, 600 * 10000},
- systemServiceCpuThreadTimes.binderThreadCpuTimesUs);
- }
+ MockCpuTimeInStateReader mockReader = new MockCpuTimeInStateReader(4);
+ // Units are nanoseconds
+ mockReader.setAggregatedTaskCpuFreqTimes(new String[] {
+ "0:1000000000 2000000000 3000000000:4000000000",
+ "1:100000000 200000000 300000000:400000000",
+ });
- @Test
- public void testReaderDelta_nextTime() throws IOException {
- int pid = 42;
- setupDirectory(
- pid,
- new int[] {42, 1, 2, 3},
- new int[] {1000, 2000},
- new int[][] {{100, 200}, {0, 200}, {0, 300}, {0, 400}},
- new int[] {1400, 1500});
-
- SystemServerCpuThreadReader reader = new SystemServerCpuThreadReader(
- mProcDirectory.toPath(), pid);
+ SystemServerCpuThreadReader reader = new SystemServerCpuThreadReader(pid, mockReader);
reader.setBinderThreadNativeTids(new int[] {1, 3});
- // First time, populate "last" snapshot
- reader.readDelta();
-
- FileUtils.deleteContents(mProcDirectory);
- setupDirectory(
- pid,
- new int[] {42, 1, 2, 3},
- new int[] {1000, 2000},
- new int[][] {{500, 600}, {700, 800}, {900, 1000}, {1100, 1200}},
- new int[] {2400, 2500});
-
- // Second time, get the actual delta
+ // The first invocation of readDelta populates the "last" snapshot
SystemServerCpuThreadReader.SystemServiceCpuThreadTimes systemServiceCpuThreadTimes =
reader.readDelta();
- assertArrayEquals(new long[] {3100 * 10000, 2500 * 10000},
- systemServiceCpuThreadTimes.threadCpuTimesUs);
- assertArrayEquals(new long[] {1800 * 10000, 1400 * 10000},
- systemServiceCpuThreadTimes.binderThreadCpuTimesUs);
+ assertThat(systemServiceCpuThreadTimes.threadCpuTimesUs)
+ .isEqualTo(new long[] {1100000, 2200000, 3300000, 4400000});
+ assertThat(systemServiceCpuThreadTimes.binderThreadCpuTimesUs)
+ .isEqualTo(new long[] {100000, 200000, 300000, 400000});
+
+ mockReader.setAggregatedTaskCpuFreqTimes(new String[] {
+ "0:1010000000 2020000000 3030000000:4040000000",
+ "1:101000000 202000000 303000000:404000000",
+ });
+
+ // The second invocation gets the actual delta
+ systemServiceCpuThreadTimes = reader.readDelta();
+
+ assertThat(systemServiceCpuThreadTimes.threadCpuTimesUs)
+ .isEqualTo(new long[] {11000, 22000, 33000, 44000});
+ assertThat(systemServiceCpuThreadTimes.binderThreadCpuTimesUs)
+ .isEqualTo(new long[] {1000, 2000, 3000, 4000});
}
- private void setupDirectory(int pid, int[] threadIds, int[] cpuFrequencies, int[][] cpuTimes,
- int[] processCpuTimes)
- throws IOException {
+ public static class MockCpuTimeInStateReader implements
+ KernelSingleProcessCpuThreadReader.CpuTimeInStateReader {
+ private final int mCpuFrequencyCount;
+ private String[] mAggregatedTaskCpuFreqTimes;
- assertTrue(mProcDirectory.toPath().resolve("self").toFile().mkdirs());
-
- try (OutputStream timeInStateStream =
- Files.newOutputStream(
- mProcDirectory.toPath().resolve("self").resolve("time_in_state"))) {
- for (int i = 0; i < cpuFrequencies.length; i++) {
- final String line = cpuFrequencies[i] + " 0\n";
- timeInStateStream.write(line.getBytes());
- }
+ MockCpuTimeInStateReader(int frequencyCount) {
+ mCpuFrequencyCount = frequencyCount;
}
- Path processPath = mProcDirectory.toPath().resolve(String.valueOf(pid));
- // Make /proc/$PID
- assertTrue(processPath.toFile().mkdirs());
-
- // Write /proc/$PID/stat. Only the fields 14-17 matter.
- try (OutputStream timeInStateStream = Files.newOutputStream(processPath.resolve("stat"))) {
- timeInStateStream.write(
- (pid + " (test) S 4 5 6 7 8 9 10 11 12 13 "
- + processCpuTimes[0] + " "
- + processCpuTimes[1] + " "
- + "16 17 18 19 20 ...").getBytes());
+ @Override
+ public int getCpuFrequencyCount() {
+ return mCpuFrequencyCount;
}
- // Make /proc/$PID/task
- final Path selfThreadsPath = processPath.resolve("task");
- assertTrue(selfThreadsPath.toFile().mkdirs());
+ @Override
+ public boolean startTrackingProcessCpuTimes(int tgid) {
+ return true;
+ }
- // Make thread directories
- for (int i = 0; i < threadIds.length; i++) {
- // Make /proc/$PID/task/$TID
- final Path threadPath = selfThreadsPath.resolve(String.valueOf(threadIds[i]));
- assertTrue(threadPath.toFile().mkdirs());
+ public boolean startAggregatingTaskCpuTimes(int pid, int aggregationKey) {
+ return true;
+ }
- // Make /proc/$PID/task/$TID/time_in_state
- try (OutputStream timeInStateStream =
- Files.newOutputStream(threadPath.resolve("time_in_state"))) {
- for (int j = 0; j < cpuFrequencies.length; j++) {
- final String line = cpuFrequencies[j] + " " + cpuTimes[i][j] + "\n";
- timeInStateStream.write(line.getBytes());
- }
- }
+ public void setAggregatedTaskCpuFreqTimes(String[] mAggregatedTaskCpuFreqTimes) {
+ this.mAggregatedTaskCpuFreqTimes = mAggregatedTaskCpuFreqTimes;
+ }
+
+ public String[] getAggregatedTaskCpuFreqTimes(int pid) {
+ return mAggregatedTaskCpuFreqTimes;
}
}
}
diff --git a/core/tests/coretests/src/com/android/internal/os/SystemServicePowerCalculatorTest.java b/core/tests/coretests/src/com/android/internal/os/SystemServicePowerCalculatorTest.java
index dbb36fb..c8e8585 100644
--- a/core/tests/coretests/src/com/android/internal/os/SystemServicePowerCalculatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/SystemServicePowerCalculatorTest.java
@@ -66,7 +66,6 @@
public void testCalculateApp() {
// Test Power Profile has two CPU clusters with 3 and 4 speeds, thus 7 freq times total
mMockSystemServerCpuThreadReader.setCpuTimes(
- new long[] {10000, 15000, 20000, 25000, 30000, 35000, 40000},
new long[] {30000, 40000, 50000, 60000, 70000, 80000, 90000},
new long[] {20000, 30000, 40000, 50000, 60000, 70000, 80000});
@@ -146,9 +145,7 @@
super(null);
}
- public void setCpuTimes(long[] processCpuTimesUs, long[] threadCpuTimesUs,
- long[] binderThreadCpuTimesUs) {
- mThreadTimes.processCpuTimesUs = processCpuTimesUs;
+ public void setCpuTimes(long[] threadCpuTimesUs, long[] binderThreadCpuTimesUs) {
mThreadTimes.threadCpuTimesUs = threadCpuTimesUs;
mThreadTimes.binderThreadCpuTimesUs = binderThreadCpuTimesUs;
}
diff --git a/core/tests/coretests/src/com/android/internal/policy/OWNERS b/core/tests/coretests/src/com/android/internal/policy/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/policy/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/core/tests/coretests/src/com/android/internal/power/OWNERS b/core/tests/coretests/src/com/android/internal/power/OWNERS
new file mode 100644
index 0000000..d68066b
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/power/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/power/OWNERS
diff --git a/core/tests/coretests/src/com/android/internal/statusbar/OWNERS b/core/tests/coretests/src/com/android/internal/statusbar/OWNERS
new file mode 100644
index 0000000..2e96c97
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/statusbar/OWNERS
@@ -0,0 +1 @@
+include /packages/SystemUI/OWNERS
diff --git a/core/tests/devicestatetests/src/android/hardware/devicestate/OWNERS b/core/tests/devicestatetests/src/android/hardware/devicestate/OWNERS
new file mode 100644
index 0000000..d9b0e2e
--- /dev/null
+++ b/core/tests/devicestatetests/src/android/hardware/devicestate/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/devicestate/OWNERS
diff --git a/core/tests/hdmitests/OWNERS b/core/tests/hdmitests/OWNERS
new file mode 100644
index 0000000..c3c47ed
--- /dev/null
+++ b/core/tests/hdmitests/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/hdmi/OWNERS
diff --git a/core/tests/hdmitests/src/android/hardware/hdmi/HdmiDeviceInfoTest.java b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiDeviceInfoTest.java
index 4c0de62..4ce072c 100755
--- a/core/tests/hdmitests/src/android/hardware/hdmi/HdmiDeviceInfoTest.java
+++ b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiDeviceInfoTest.java
@@ -37,6 +37,7 @@
int deviceType = 0;
int vendorId = 0x123456;
String displayName = "test device";
+ int cecVersion = HdmiControlManager.HDMI_CEC_VERSION_2_0;
int powerStatus = HdmiControlManager.POWER_STATUS_TRANSIENT_TO_STANDBY;
int deviceId = 3;
int adopterId = 2;
@@ -70,6 +71,16 @@
vendorId,
displayName,
powerStatus))
+ .addEqualityGroup(
+ new HdmiDeviceInfo(
+ logicalAddr,
+ phyAddr,
+ portId,
+ deviceType,
+ vendorId,
+ displayName,
+ powerStatus,
+ cecVersion))
.testEquals();
}
}
diff --git a/core/tests/hdmitests/src/android/hardware/hdmi/HdmiPortInfoTest.java b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiPortInfoTest.java
new file mode 100755
index 0000000..d8dc1ea
--- /dev/null
+++ b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiPortInfoTest.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2020 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.hardware.hdmi;
+
+import androidx.test.filters.SmallTest;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** Tests for {@link HdmiPortInfo} */
+@RunWith(JUnit4.class)
+@SmallTest
+public class HdmiPortInfoTest {
+
+ @Test
+ public void testEquals() {
+ int portId = 1;
+ int portType = 0;
+ int address = 0x123456;
+ boolean isCec = true;
+ boolean isMhl = false;
+ boolean isArcSupported = false;
+
+ new EqualsTester()
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, isCec, isMhl, isArcSupported),
+ new HdmiPortInfo(portId, portType, address, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(
+ portId + 1, portType, address, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(
+ portId, portType + 1, address, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(
+ portId, portType, address + 1, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, !isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, isCec, !isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, isCec, isMhl, !isArcSupported))
+ .testEquals();
+ }
+}
diff --git a/core/tests/hosttests/test-apps/OWNERS b/core/tests/hosttests/test-apps/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/core/tests/hosttests/test-apps/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/core/tests/mockingcoretests/src/android/app/activity/OWNERS b/core/tests/mockingcoretests/src/android/app/activity/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/core/tests/mockingcoretests/src/android/app/activity/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/core/tests/notificationtests/OWNERS b/core/tests/notificationtests/OWNERS
new file mode 100644
index 0000000..396fd12
--- /dev/null
+++ b/core/tests/notificationtests/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/notification/OWNERS
diff --git a/core/tests/overlaytests/OWNERS b/core/tests/overlaytests/OWNERS
new file mode 100644
index 0000000..afb98d4
--- /dev/null
+++ b/core/tests/overlaytests/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/content/om/OWNERS
diff --git a/core/tests/packagemanagertests/OWNERS b/core/tests/packagemanagertests/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/core/tests/packagemanagertests/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/core/tests/powertests/PowerStatsLoadTests/Android.bp b/core/tests/powertests/PowerStatsLoadTests/Android.bp
deleted file mode 100644
index 66c91ad..0000000
--- a/core/tests/powertests/PowerStatsLoadTests/Android.bp
+++ /dev/null
@@ -1,13 +0,0 @@
-android_test {
- name: "PowerStatsLoadTests",
- srcs: ["src/**/*.java"],
- static_libs: [
- "androidx.test.rules",
- "androidx.test.ext.junit",
- "compatibility-device-util-axt",
- "junit",
- ],
- libs: ["android.test.runner"],
- platform_apis: true,
- certificate: "platform",
-}
diff --git a/core/tests/powertests/PowerStatsLoadTests/AndroidManifest.xml b/core/tests/powertests/PowerStatsLoadTests/AndroidManifest.xml
deleted file mode 100644
index 9cecaed..0000000
--- a/core/tests/powertests/PowerStatsLoadTests/AndroidManifest.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2020 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.
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.frameworks.core.powerstatsloadtests">
-
- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
- <uses-permission android:name="android.permission.BATTERY_STATS"/>
- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
- <uses-permission android:name="android.permission.DEVICE_POWER"/>
- <uses-permission android:name="android.permission.INTERNET"/>
-
- <instrumentation
- android:name="androidx.test.runner.AndroidJUnitRunner"
- android:targetPackage="com.android.frameworks.core.powerstatsloadtests"
- android:label="Power Stats Load Tests" />
-
- <queries>
- <!-- The load test resolves http://... intents. Let it do so. -->
- <package android:name="com.android.chrome"/>
- </queries>
-</manifest>
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/ConnectivitySetupRule.java b/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/ConnectivitySetupRule.java
deleted file mode 100644
index ca29426..0000000
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/ConnectivitySetupRule.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsloadtests;
-
-import static org.junit.Assert.assertEquals;
-
-import android.app.Instrumentation;
-import android.content.Context;
-import android.net.ConnectivityManager;
-import android.net.LinkProperties;
-import android.net.Network;
-import android.net.NetworkCapabilities;
-import android.net.NetworkRequest;
-import android.net.wifi.WifiManager;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import com.android.compatibility.common.util.SystemUtil;
-
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-public class ConnectivitySetupRule implements TestRule {
-
- private final boolean mWifiEnabled;
- private final ConnectivityManager mConnectivityManager;
- private final WifiManager mWifiManager;
- private boolean mInitialWifiState;
-
- public ConnectivitySetupRule(boolean wifiEnabled) {
- mWifiEnabled = wifiEnabled;
-
- Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
- Context context = instrumentation.getContext();
- mConnectivityManager = context.getSystemService(ConnectivityManager.class);
- mWifiManager = context.getSystemService(WifiManager.class);
- }
-
- @Override
- public Statement apply(Statement base, Description description) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- try {
- mInitialWifiState = isWiFiConnected();
- setWiFiState(mWifiEnabled);
- base.evaluate();
- } finally {
- setWiFiState(mInitialWifiState);
- }
- }
- };
- }
-
- private void setWiFiState(final boolean enable) throws InterruptedException {
- boolean wiFiConnected = isWiFiConnected();
- if (enable == wiFiConnected) {
- return;
- }
-
- NetworkTracker tracker = new NetworkTracker(!mWifiEnabled);
- mConnectivityManager.registerNetworkCallback(
- new NetworkRequest.Builder()
- .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED).build(),
- tracker);
-
- if (enable) {
- SystemUtil.runShellCommand("svc wifi enable");
- //noinspection deprecation
- SystemUtil.runWithShellPermissionIdentity(mWifiManager::reconnect,
- android.Manifest.permission.NETWORK_SETTINGS);
- } else {
- SystemUtil.runShellCommand("svc wifi disable");
- }
-
- tracker.waitForExpectedState();
-
- assertEquals("Wifi must be " + (enable ? "connected to" : "disconnected from")
- + " an access point for this test.", enable, isWiFiConnected());
-
- mConnectivityManager.unregisterNetworkCallback(tracker);
- }
-
- private boolean isWiFiConnected() {
- return mWifiManager.isWifiEnabled() && mConnectivityManager.getActiveNetwork() != null
- && !mConnectivityManager.isActiveNetworkMetered();
- }
-
- private class NetworkTracker extends ConnectivityManager.NetworkCallback {
- private static final int MSG_CHECK_ACTIVE_NETWORK = 1;
-
- private final CountDownLatch mReceiveLatch = new CountDownLatch(1);
-
- private final boolean mExpectedMetered;
-
- private final Handler mHandler = new Handler(Looper.getMainLooper()) {
- @Override
- public void handleMessage(Message msg) {
- if (msg.what == MSG_CHECK_ACTIVE_NETWORK) {
- checkActiveNetwork();
- }
- }
- };
-
- private NetworkTracker(boolean expectedMetered) {
- mExpectedMetered = expectedMetered;
- }
-
- @Override
- public void onAvailable(Network network, NetworkCapabilities networkCapabilities,
- LinkProperties linkProperties, boolean blocked) {
- checkActiveNetwork();
- }
-
- @Override
- public void onLost(Network network) {
- checkActiveNetwork();
- }
-
- boolean waitForExpectedState() throws InterruptedException {
- checkActiveNetwork();
- return mReceiveLatch.await(60, TimeUnit.SECONDS);
- }
-
- private void checkActiveNetwork() {
- if (mReceiveLatch.getCount() == 0) {
- return;
- }
-
- if (mConnectivityManager.getActiveNetwork() != null
- && mConnectivityManager.isActiveNetworkMetered() == mExpectedMetered) {
- mReceiveLatch.countDown();
- } else {
- mHandler.sendEmptyMessageDelayed(MSG_CHECK_ACTIVE_NETWORK, 5000);
- }
- }
- }
-}
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetrics.java b/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetrics.java
deleted file mode 100644
index 88cb719..0000000
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetrics.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsloadtests;
-
-import android.os.Process;
-
-import com.android.internal.os.BatterySipper;
-import com.android.internal.os.BatteryStatsHelper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PowerMetrics {
- private static final String PACKAGE_CALENDAR_PROVIDER = "com.android.providers.calendar";
- private static final String PACKAGE_MEDIA_PROVIDER = "com.android.providers.media";
- private static final String PACKAGE_SYSTEMUI = "com.android.systemui";
- private static final String[] PACKAGES_SYSTEM = {PACKAGE_MEDIA_PROVIDER,
- PACKAGE_CALENDAR_PROVIDER, PACKAGE_SYSTEMUI};
-
- enum MetricKind {
- POWER,
- DURATION,
- }
-
- public static final String METRIC_APP_POWER = "appPower";
- public static final String METRIC_APP_POWER_EXCLUDE_SYSTEM_FROM_TOTAL = "appPowerExcludeSystem";
- public static final String METRIC_APP_POWER_EXCLUDE_SMEARED = "appPowerExcludeSmeared";
- public static final String METRIC_SCREEN_POWER = "screenPower";
- public static final String METRIC_WIFI_POWER = "wifiPower";
- public static final String METRIC_SYSTEM_SERVICE_CPU_POWER = "systemService";
- public static final String METRIC_OTHER_POWER = "otherPower";
- public static final String METRIC_CPU_POWER = "cpuPower";
- public static final String METRIC_RAM_POWER = "ramPower";
- public static final String METRIC_WAKELOCK_POWER = "wakelockPower";
- public static final String METRIC_MOBILE_RADIO_POWER = "mobileRadioPower";
- public static final String METRIC_BLUETOOTH_POWER = "bluetoothPower";
- public static final String METRIC_GPS_POWER = "gpsPower";
- public static final String METRIC_CAMERA_POWER = "cameraPower";
- public static final String METRIC_FLASHLIGHT_POWER = "flashlightPower";
- public static final String METRIC_SENSORS_POWER = "sensorsPower";
- public static final String METRIC_AUDIO_POWER = "audioPower";
- public static final String METRIC_VIDEO_POWER = "videoPower";
- public static final String METRIC_CPU_TIME = "cpuTime";
- public static final String METRIC_CPU_FOREGROUND_TIME = "cpuForegroundTime";
- public static final String METRIC_WAKELOCK_TIME = "wakelockTime";
- public static final String METRIC_WIFI_RUNNING_TIME = "wifiRunningTime";
- public static final String METRIC_BLUETOOTH_RUNNING_TIME = "bluetoothRunningTime";
- public static final String METRIC_GPS_TIME = "gpsTime";
- public static final String METRIC_CAMERA_TIME = "cameraTime";
- public static final String METRIC_FLASHLIGHT_TIME = "flashlightTime";
- public static final String METRIC_AUDIO_TIME = "audioTime";
- public static final String METRIC_VIDEO_TIME = "videoTime";
-
- public static class Metric {
- public String metricType;
- public MetricKind metricKind;
- public String title;
- public double value;
- public double total;
- }
-
- private final double mMinDrainedPower;
- private final double mMaxDrainedPower;
-
- private List<Metric> mMetrics = new ArrayList<>();
-
- public PowerMetrics(BatteryStatsHelper batteryStatsHelper, int uid) {
- mMinDrainedPower = batteryStatsHelper.getMinDrainedPower();
- mMaxDrainedPower = batteryStatsHelper.getMaxDrainedPower();
-
- List<BatterySipper> usageList = batteryStatsHelper.getUsageList();
-
- double totalPowerMah = 0;
- double totalSmearedPowerMah = 0;
- double totalPowerExcludeSystemMah = 0;
- double totalScreenPower = 0;
- double totalProportionalSmearMah = 0;
- double totalCpuPowerMah = 0;
- double totalSystemServiceCpuPowerMah = 0;
- double totalUsagePowerMah = 0;
- double totalWakeLockPowerMah = 0;
- double totalMobileRadioPowerMah = 0;
- double totalWifiPowerMah = 0;
- double totalBluetoothPowerMah = 0;
- double totalGpsPowerMah = 0;
- double totalCameraPowerMah = 0;
- double totalFlashlightPowerMah = 0;
- double totalSensorPowerMah = 0;
- double totalAudioPowerMah = 0;
- double totalVideoPowerMah = 0;
-
- long totalCpuTimeMs = 0;
- long totalCpuFgTimeMs = 0;
- long totalWakeLockTimeMs = 0;
- long totalWifiRunningTimeMs = 0;
- long totalBluetoothRunningTimeMs = 0;
- long totalGpsTimeMs = 0;
- long totalCameraTimeMs = 0;
- long totalFlashlightTimeMs = 0;
- long totalAudioTimeMs = 0;
- long totalVideoTimeMs = 0;
-
- BatterySipper uidSipper = null;
- for (BatterySipper sipper : usageList) {
- if (sipper.drainType == BatterySipper.DrainType.SCREEN) {
- totalScreenPower = sipper.sumPower();
- }
-
- if (isHiddenDrainType(sipper.drainType)) {
- continue;
- }
-
- if (sipper.drainType == BatterySipper.DrainType.APP && sipper.getUid() == uid) {
- uidSipper = sipper;
- }
-
- totalPowerMah += sipper.sumPower();
- totalSmearedPowerMah += sipper.totalSmearedPowerMah;
- totalProportionalSmearMah += sipper.proportionalSmearMah;
-
- if (!isSystemSipper(sipper)) {
- totalPowerExcludeSystemMah += sipper.totalSmearedPowerMah;
- }
-
- totalCpuPowerMah += sipper.cpuPowerMah;
- totalSystemServiceCpuPowerMah += sipper.systemServiceCpuPowerMah;
- totalUsagePowerMah += sipper.usagePowerMah;
- totalWakeLockPowerMah += sipper.wakeLockPowerMah;
- totalMobileRadioPowerMah += sipper.mobileRadioPowerMah;
- totalWifiPowerMah += sipper.wifiPowerMah;
- totalBluetoothPowerMah += sipper.bluetoothPowerMah;
- totalGpsPowerMah += sipper.gpsPowerMah;
- totalCameraPowerMah += sipper.cameraPowerMah;
- totalFlashlightPowerMah += sipper.flashlightPowerMah;
- totalSensorPowerMah += sipper.sensorPowerMah;
- totalAudioPowerMah += sipper.audioPowerMah;
- totalVideoPowerMah += sipper.videoPowerMah;
-
- totalCpuTimeMs += sipper.cpuTimeMs;
- totalCpuFgTimeMs += sipper.cpuFgTimeMs;
- totalWakeLockTimeMs += sipper.wakeLockTimeMs;
- totalWifiRunningTimeMs += sipper.wifiRunningTimeMs;
- totalBluetoothRunningTimeMs += sipper.bluetoothRunningTimeMs;
- totalGpsTimeMs += sipper.gpsTimeMs;
- totalCameraTimeMs += sipper.cameraTimeMs;
- totalFlashlightTimeMs += sipper.flashlightTimeMs;
- totalAudioTimeMs += sipper.audioTimeMs;
- totalVideoTimeMs += sipper.videoTimeMs;
- }
-
- if (uidSipper == null) {
- return;
- }
-
- addMetric(METRIC_APP_POWER, MetricKind.POWER, "Total power",
- uidSipper.totalSmearedPowerMah, totalSmearedPowerMah);
- addMetric(METRIC_APP_POWER_EXCLUDE_SYSTEM_FROM_TOTAL, MetricKind.POWER,
- "Total power excluding system",
- uidSipper.totalSmearedPowerMah, totalPowerExcludeSystemMah);
- addMetric(METRIC_SCREEN_POWER, MetricKind.POWER, "Screen, smeared",
- uidSipper.screenPowerMah, totalScreenPower);
- addMetric(METRIC_OTHER_POWER, MetricKind.POWER, "Other, smeared",
- uidSipper.proportionalSmearMah, totalProportionalSmearMah);
- addMetric(METRIC_APP_POWER_EXCLUDE_SMEARED, MetricKind.POWER, "Excluding smeared",
- uidSipper.totalPowerMah, totalPowerMah);
- addMetric(METRIC_CPU_POWER, MetricKind.POWER, "CPU",
- uidSipper.cpuPowerMah, totalCpuPowerMah);
- addMetric(METRIC_SYSTEM_SERVICE_CPU_POWER, MetricKind.POWER, "System services",
- uidSipper.systemServiceCpuPowerMah, totalSystemServiceCpuPowerMah);
- addMetric(METRIC_RAM_POWER, MetricKind.POWER, "RAM",
- uidSipper.usagePowerMah, totalUsagePowerMah);
- addMetric(METRIC_WAKELOCK_POWER, MetricKind.POWER, "Wake lock",
- uidSipper.wakeLockPowerMah, totalWakeLockPowerMah);
- addMetric(METRIC_MOBILE_RADIO_POWER, MetricKind.POWER, "Mobile radio",
- uidSipper.mobileRadioPowerMah, totalMobileRadioPowerMah);
- addMetric(METRIC_WIFI_POWER, MetricKind.POWER, "WiFi",
- uidSipper.wifiPowerMah, totalWifiPowerMah);
- addMetric(METRIC_BLUETOOTH_POWER, MetricKind.POWER, "Bluetooth",
- uidSipper.bluetoothPowerMah, totalBluetoothPowerMah);
- addMetric(METRIC_GPS_POWER, MetricKind.POWER, "GPS",
- uidSipper.gpsPowerMah, totalGpsPowerMah);
- addMetric(METRIC_CAMERA_POWER, MetricKind.POWER, "Camera",
- uidSipper.cameraPowerMah, totalCameraPowerMah);
- addMetric(METRIC_FLASHLIGHT_POWER, MetricKind.POWER, "Flashlight",
- uidSipper.flashlightPowerMah, totalFlashlightPowerMah);
- addMetric(METRIC_SENSORS_POWER, MetricKind.POWER, "Sensors",
- uidSipper.sensorPowerMah, totalSensorPowerMah);
- addMetric(METRIC_AUDIO_POWER, MetricKind.POWER, "Audio",
- uidSipper.audioPowerMah, totalAudioPowerMah);
- addMetric(METRIC_VIDEO_POWER, MetricKind.POWER, "Video",
- uidSipper.videoPowerMah, totalVideoPowerMah);
-
- addMetric(METRIC_CPU_TIME, MetricKind.DURATION, "CPU time",
- uidSipper.cpuTimeMs, totalCpuTimeMs);
- addMetric(METRIC_CPU_FOREGROUND_TIME, MetricKind.DURATION, "CPU foreground time",
- uidSipper.cpuFgTimeMs, totalCpuFgTimeMs);
- addMetric(METRIC_WAKELOCK_TIME, MetricKind.DURATION, "Wake lock time",
- uidSipper.wakeLockTimeMs, totalWakeLockTimeMs);
- addMetric(METRIC_WIFI_RUNNING_TIME, MetricKind.DURATION, "WiFi running time",
- uidSipper.wifiRunningTimeMs, totalWifiRunningTimeMs);
- addMetric(METRIC_BLUETOOTH_RUNNING_TIME, MetricKind.DURATION, "Bluetooth time",
- uidSipper.bluetoothRunningTimeMs, totalBluetoothRunningTimeMs);
- addMetric(METRIC_GPS_TIME, MetricKind.DURATION, "GPS time",
- uidSipper.gpsTimeMs, totalGpsTimeMs);
- addMetric(METRIC_CAMERA_TIME, MetricKind.DURATION, "Camera time",
- uidSipper.cameraTimeMs, totalCameraTimeMs);
- addMetric(METRIC_FLASHLIGHT_TIME, MetricKind.DURATION, "Flashlight time",
- uidSipper.flashlightTimeMs, totalFlashlightTimeMs);
- addMetric(METRIC_AUDIO_TIME, MetricKind.DURATION, "Audio time",
- uidSipper.audioTimeMs, totalAudioTimeMs);
- addMetric(METRIC_VIDEO_TIME, MetricKind.DURATION, "Video time",
- uidSipper.videoTimeMs, totalVideoTimeMs);
- }
-
- public List<Metric> getMetrics() {
- return mMetrics;
- }
-
- public double getMinDrainedPower() {
- return mMinDrainedPower;
- }
-
- public double getMaxDrainedPower() {
- return mMaxDrainedPower;
- }
-
- protected boolean isHiddenDrainType(BatterySipper.DrainType drainType) {
- return drainType == BatterySipper.DrainType.IDLE
- || drainType == BatterySipper.DrainType.CELL
- || drainType == BatterySipper.DrainType.SCREEN
- || drainType == BatterySipper.DrainType.UNACCOUNTED
- || drainType == BatterySipper.DrainType.OVERCOUNTED
- || drainType == BatterySipper.DrainType.BLUETOOTH
- || drainType == BatterySipper.DrainType.WIFI;
- }
-
- private boolean isSystemSipper(BatterySipper sipper) {
- final int uid = sipper.uidObj == null ? -1 : sipper.getUid();
- if (uid >= Process.ROOT_UID && uid < Process.FIRST_APPLICATION_UID) {
- return true;
- } else if (sipper.mPackages != null) {
- for (final String packageName : sipper.mPackages) {
- for (final String systemPackage : PACKAGES_SYSTEM) {
- if (systemPackage.equals(packageName)) {
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
- private void addMetric(String metricType, MetricKind metricKind, String title, double amount,
- double totalAmount) {
- Metric metric = new Metric();
- metric.metricType = metricType;
- metric.metricKind = metricKind;
- metric.title = title;
- metric.value = amount;
- metric.total = totalAmount;
- mMetrics.add(metric);
- }
-}
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetricsCollector.java b/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetricsCollector.java
deleted file mode 100644
index a71559b..0000000
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetricsCollector.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsloadtests;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import android.app.Instrumentation;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.os.BatteryManager;
-import android.os.BatteryStats;
-import android.os.Bundle;
-import android.os.Process;
-import android.os.SystemClock;
-import android.os.UserManager;
-import android.util.Log;
-import android.util.TimeUtils;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import com.android.compatibility.common.util.SystemUtil;
-import com.android.internal.os.BatteryStatsHelper;
-import com.android.internal.os.LoggingPrintStream;
-
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-public class PowerMetricsCollector implements TestRule {
- private final String mTag;
- private final float mBatteryDrainThresholdPct;
- private final int mTimeoutMillis;
-
- private final Context mContext;
- private final UserManager mUserManager;
- private final int mUid;
- private final BatteryStatsHelper mStatsHelper;
- private final CountDownLatch mSuspendingBatteryInput = new CountDownLatch(1);
-
- private long mStartTime;
- private volatile float mInitialBatteryLevel;
- private volatile float mCurrentBatteryLevel;
- private int mIterations;
- private PowerMetrics mInitialPowerMetrics;
- private PowerMetrics mFinalPowerMetrics;
- private List<PowerMetrics.Metric> mPowerMetricsDelta;
- private Intent mBatteryStatus;
-
- @Override
- public Statement apply(Statement base, Description description) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- BroadcastReceiver batteryBroadcastReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- handleBatteryStatus(intent);
- }
- };
- mBatteryStatus = mContext.registerReceiver(batteryBroadcastReceiver,
- new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
- disableCharger();
- try {
- prepareBatteryLevelMonitor();
- mStartTime = SystemClock.uptimeMillis();
- base.evaluate();
- captureFinalPowerStatsData();
- } finally {
- mContext.unregisterReceiver(batteryBroadcastReceiver);
- enableCharger();
- }
- }
- };
- }
-
- public PowerMetricsCollector(String tag, float batteryDrainThresholdPct, int timeoutMillis) {
- mTag = tag;
- mBatteryDrainThresholdPct = batteryDrainThresholdPct;
- mTimeoutMillis = timeoutMillis;
-
- Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
- mContext = instrumentation.getContext();
- mUid = Process.myUid();
- mUserManager = mContext.getSystemService(UserManager.class);
- mStatsHelper = new BatteryStatsHelper(mContext, false /* collectBatteryBroadcast */);
- mStatsHelper.create((Bundle) null);
- }
-
- private void disableCharger() throws InterruptedException {
- SystemUtil.runShellCommand("dumpsys battery suspend_input");
- final boolean success = mSuspendingBatteryInput.await(10, TimeUnit.SECONDS);
- assertTrue("Timed out waiting for battery input to be suspended", success);
- }
-
- private void enableCharger() {
- SystemUtil.runShellCommand("dumpsys battery reset");
- }
-
- private PowerMetrics readBatteryStatsData() {
- mStatsHelper.clearStats();
- mStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
- mUserManager.getUserProfiles());
- return new PowerMetrics(mStatsHelper, mUid);
- }
-
- protected void prepareBatteryLevelMonitor() {
- handleBatteryStatus(mBatteryStatus);
- mInitialBatteryLevel = mCurrentBatteryLevel;
- }
-
- protected void handleBatteryStatus(Intent intent) {
- if (mFinalPowerMetrics != null) {
- return;
- }
-
- final boolean isCharging = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) != 0;
-
- if (mSuspendingBatteryInput.getCount() > 0) {
- if (!isCharging) {
- mSuspendingBatteryInput.countDown();
- }
- return;
- }
-
- if (isCharging) {
- fail("Device must remain disconnected from the power source "
- + "for the duration of the test");
- }
-
- int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
- int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
-
- mCurrentBatteryLevel = level * 100 / (float) scale;
- Log.i(mTag, "Battery level = " + mCurrentBatteryLevel);
-
- // We delay tracking until the battery level drops. If the resolution of
- // battery level is 1%, and the initially reported level is 73, we don't know whether
- // it's 73.1 or 73.7. Once it drops to 72, we can be confident that the real battery
- // level it is very close to 72.0 and can start tracking.
- if (mInitialPowerMetrics == null && mCurrentBatteryLevel < mInitialBatteryLevel) {
- mInitialBatteryLevel = mCurrentBatteryLevel;
- mInitialPowerMetrics = readBatteryStatsData();
- }
- }
-
- private void captureFinalPowerStatsData() {
- if (mFinalPowerMetrics != null) {
- return;
- }
-
- mFinalPowerMetrics = readBatteryStatsData();
-
- mPowerMetricsDelta = new ArrayList<>();
- List<PowerMetrics.Metric> initialPowerMetrics = mInitialPowerMetrics.getMetrics();
- List<PowerMetrics.Metric> finalPowerMetrics = mFinalPowerMetrics.getMetrics();
- for (PowerMetrics.Metric initialMetric : initialPowerMetrics) {
- PowerMetrics.Metric finalMetric = null;
- for (PowerMetrics.Metric metric : finalPowerMetrics) {
- if (metric.title.equals(initialMetric.title)) {
- finalMetric = metric;
- break;
- }
- }
-
- if (finalMetric != null) {
- PowerMetrics.Metric delta = new PowerMetrics.Metric();
- delta.metricType = initialMetric.metricType;
- delta.metricKind = initialMetric.metricKind;
- delta.title = initialMetric.title;
- delta.total = finalMetric.total - initialMetric.total;
- delta.value = finalMetric.value - initialMetric.value;
- mPowerMetricsDelta.add(delta);
- }
- }
- }
-
- /**
- * Returns false if sufficient data has been accumulated.
- */
- public boolean checkpoint() {
- long elapsedTime = SystemClock.uptimeMillis() - mStartTime;
- if (elapsedTime >= mTimeoutMillis) {
- Log.i(mTag, "Timeout reached " + TimeUtils.formatDuration(elapsedTime));
- captureFinalPowerStatsData();
- return false;
- }
-
- if (mInitialPowerMetrics == null) {
- return true;
- }
-
- if (mInitialBatteryLevel - mCurrentBatteryLevel >= mBatteryDrainThresholdPct) {
- Log.i(mTag,
- "Battery drain reached " + (mInitialBatteryLevel - mCurrentBatteryLevel) + "%");
- captureFinalPowerStatsData();
- return false;
- }
-
- mIterations++;
- return true;
- }
-
-
- public int getIterationCount() {
- return mIterations;
- }
-
- public void dumpMetrics() {
- dumpMetrics(new LoggingPrintStream() {
- @Override
- protected void log(String line) {
- Log.i(mTag, line);
- }
- });
- }
-
- public void dumpMetrics(PrintStream out) {
- List<PowerMetrics.Metric> initialPowerMetrics = mInitialPowerMetrics.getMetrics();
- List<PowerMetrics.Metric> finalPowerMetrics = mFinalPowerMetrics.getMetrics();
-
- out.println("== Power metrics at test start");
- dumpPowerStatsData(out, initialPowerMetrics);
-
- out.println("== Power metrics at test end");
- dumpPowerStatsData(out, finalPowerMetrics);
-
- out.println("== Power metrics delta");
- dumpPowerStatsData(out, mPowerMetricsDelta);
- }
-
- protected void dumpPowerStatsData(PrintStream out, List<PowerMetrics.Metric> metrics) {
- Locale locale = Locale.getDefault();
- for (PowerMetrics.Metric metric : metrics) {
- double proportion = metric.total != 0 ? metric.value * 100 / metric.total : 0;
- switch (metric.metricKind) {
- case POWER:
- out.println(
- String.format(locale, " %-30s %7.1f mAh %4.1f%%", metric.title,
- metric.value, proportion));
- break;
- case DURATION:
- out.println(
- String.format(locale, " %-30s %,7d ms %4.1f%%", metric.title,
- (long) metric.value, proportion));
- break;
- }
- }
- }
-
- public void dumpMetricAsPercentageOfDrainedPower(String metricType) {
- double minDrainedPower =
- mFinalPowerMetrics.getMinDrainedPower() - mInitialPowerMetrics.getMinDrainedPower();
- double maxDrainedPower =
- mFinalPowerMetrics.getMaxDrainedPower() - mInitialPowerMetrics.getMaxDrainedPower();
-
- PowerMetrics.Metric metric = getMetric(metricType);
- double metricDelta = metric.value;
-
- if (maxDrainedPower - minDrainedPower < 0.1f) {
- Log.i(mTag, String.format(Locale.getDefault(),
- "%s power consumed by the test: %.1f of %.1f mAh (%.1f%%)",
- metric.title, metricDelta, maxDrainedPower,
- metricDelta / maxDrainedPower * 100));
- } else {
- Log.i(mTag, String.format(Locale.getDefault(),
- "%s power consumed by the test: %.1f of %.1f - %.1f mAh (%.1f%% - %.1f%%)",
- metric.title, metricDelta, minDrainedPower, maxDrainedPower,
- metricDelta / minDrainedPower * 100, metricDelta / maxDrainedPower * 100));
- }
- }
-
- public PowerMetrics.Metric getMetric(String metricType) {
- for (PowerMetrics.Metric metric : mPowerMetricsDelta) {
- if (metric.metricType.equals(metricType)) {
- return metric;
- }
- }
- return null;
- }
-}
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/SystemServiceCallLoadTest.java b/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/SystemServiceCallLoadTest.java
deleted file mode 100644
index 911ccba..0000000
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/SystemServiceCallLoadTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsloadtests;
-
-import static org.junit.Assert.assertNotNull;
-
-import android.app.Instrumentation;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.net.Uri;
-import android.util.Log;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-public class SystemServiceCallLoadTest {
- private static final String TAG = "SystemServiceCallLoadTest";
- private static final int TIMEOUT_MILLIS = 60 * 60 * 1000;
- private static final float BATTERY_DRAIN_THRESHOLD_PCT = 2.99f;
-
- @Rule
- public PowerMetricsCollector mPowerMetricsCollector = new PowerMetricsCollector(TAG,
- BATTERY_DRAIN_THRESHOLD_PCT, TIMEOUT_MILLIS);
-
- private PackageManager mPackageManager;
-
- @Before
- public void setup() {
- Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
- mPackageManager = instrumentation.getContext().getPackageManager();
- }
-
- @Test
- public void test() {
- while (mPowerMetricsCollector.checkpoint()) {
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setDataAndType(Uri.parse("http://example.com/"), "text/plain");
- intent.addCategory(Intent.CATEGORY_BROWSABLE);
- ResolveInfo resolveInfo = mPackageManager.resolveActivity(intent, 0);
- assertNotNull(resolveInfo);
- }
-
- mPowerMetricsCollector.dumpMetrics();
-
- Log.i(TAG, "==");
- Log.i(TAG, "Total system server calls made " + mPowerMetricsCollector.getIterationCount());
-
- mPowerMetricsCollector.dumpMetricAsPercentageOfDrainedPower(
- PowerMetrics.METRIC_SYSTEM_SERVICE_CPU_POWER);
- }
-}
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/WiFiLoadTest.java b/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/WiFiLoadTest.java
deleted file mode 100644
index 90627192..0000000
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/WiFiLoadTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsloadtests;
-
-import android.util.Log;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
-public class WiFiLoadTest {
- private static final String TAG = "WiFiLoadTest";
- private static final String DOWNLOAD_TEST_URL =
- "https://i.ytimg.com/vi/l5mE3Tpjejs/maxresdefault.jpg";
-
- private static final int TIMEOUT_MILLIS = 60 * 60 * 1000;
- private static final float BATTERY_DRAIN_THRESHOLD_PCT = 0.99f;
-
- @Rule
- public PowerMetricsCollector mPowerMetricsCollector = new PowerMetricsCollector(TAG,
- BATTERY_DRAIN_THRESHOLD_PCT, TIMEOUT_MILLIS);
-
- @Rule
- public ConnectivitySetupRule mConnectivitySetupRule =
- new ConnectivitySetupRule(/* WiFi enabled */true);
-
- @Test
- public void test() throws IOException {
- long totalBytesRead = 0;
- URL url = new URL(DOWNLOAD_TEST_URL);
- byte[] buffer = new byte[131072]; // Large buffer to minimize CPU usage
-
- while (mPowerMetricsCollector.checkpoint()) {
- try (InputStream inputStream = url.openStream()) {
- while (true) {
- int count = inputStream.read(buffer);
- if (count < 0) {
- break;
- }
- totalBytesRead += count;
- }
- }
- }
-
- mPowerMetricsCollector.dumpMetrics();
-
- Log.i(TAG, "==");
- Log.i(TAG, "WiFi running time: " + (long) mPowerMetricsCollector.getMetric(
- PowerMetrics.METRIC_WIFI_RUNNING_TIME).value);
- Log.i(TAG, "Total bytes read over WiFi: " + totalBytesRead);
-
- mPowerMetricsCollector.dumpMetricAsPercentageOfDrainedPower(
- PowerMetrics.METRIC_WIFI_POWER);
- }
-}
diff --git a/core/tests/powertests/PowerStatsViewer/Android.bp b/core/tests/powertests/PowerStatsViewer/Android.bp
deleted file mode 100644
index a3dc4fb..0000000
--- a/core/tests/powertests/PowerStatsViewer/Android.bp
+++ /dev/null
@@ -1,13 +0,0 @@
-android_test {
- name: "PowerStatsViewer",
- srcs: ["src/**/*.java"],
- defaults: ["SettingsLibDefaults"],
- static_libs: [
- "androidx.appcompat_appcompat",
- "androidx.cardview_cardview",
- "androidx.recyclerview_recyclerview",
- "com.google.android.material_material",
- ],
- platform_apis: true,
- certificate: "platform",
-}
diff --git a/core/tests/powertests/PowerStatsViewer/AndroidManifest.xml b/core/tests/powertests/PowerStatsViewer/AndroidManifest.xml
deleted file mode 100644
index 28ea05f..0000000
--- a/core/tests/powertests/PowerStatsViewer/AndroidManifest.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2020 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.
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.frameworks.core.powerstatsviewer"
- android:sharedUserId="android.uid.system">
-
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
- <uses-permission android:name="android.permission.BATTERY_STATS"/>
-
- <application
- android:theme="@style/Theme"
- android:label="Power Stats Viewer">
- <activity android:name=".PowerStatsViewerActivity"
- android:label="Power Stats Viewer"
- android:launchMode="singleTop"
- android:exported="true">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <activity android:name=".PowerConsumerPickerActivity"
- android:label="Select a power consumer"/>
- </application>
-</manifest>
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_viewer_layout.xml b/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_viewer_layout.xml
deleted file mode 100644
index 238e238..0000000
--- a/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_viewer_layout.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2020 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.
- -->
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <androidx.cardview.widget.CardView
- style="@style/LoadTestCardView"
- android:id="@+id/app_card"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dp"
- android:layout_marginEnd="10dp"
- android:layout_marginBottom="10dp"
- android:layout_marginStart="10dp"
- android:padding="20dp">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:minHeight="80dp"
- android:paddingStart="10dp"
- android:paddingEnd="10dp">
-
- <include layout="@layout/power_consumer_info_layout"/>
-
- </LinearLayout>
- </androidx.cardview.widget.CardView>
-
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/power_stats_data_view"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"/>
-
- <TextView
- android:id="@+id/empty_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center"
- android:visibility="gone"
- android:text="No power stats available"/>
- </LinearLayout>
-
- <FrameLayout
- android:id="@+id/loading_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#AAFFFFFF">
- <ProgressBar
- style="?android:attr/progressBarStyleLarge"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:indeterminate="true"/>
- </FrameLayout>
-</FrameLayout>
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerInfoHelper.java b/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerInfoHelper.java
deleted file mode 100644
index 6fec240..0000000
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerInfoHelper.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsviewer;
-
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.os.Process;
-
-import androidx.annotation.NonNull;
-
-import com.android.internal.os.BatterySipper;
-
-import java.util.Locale;
-
-class PowerConsumerInfoHelper {
-
- private static final String SYSTEM_SERVER_PACKAGE_NAME = "android";
-
- public static class PowerConsumerInfo {
- public String id;
- public CharSequence label;
- public double powerMah;
- public ApplicationInfo iconInfo;
- public CharSequence packages;
- public CharSequence details;
- }
-
- @NonNull
- public static PowerConsumerInfo makePowerConsumerInfo(PackageManager packageManager,
- @NonNull BatterySipper sipper) {
- PowerConsumerInfo info = new PowerConsumerInfo();
- info.id = PowerStatsData.powerConsumerId(sipper);
- sipper.sumPower();
- info.powerMah = sipper.totalSmearedPowerMah;
- switch (sipper.drainType) {
- case APP: {
- int uid = sipper.getUid();
- info.details = String.format("UID: %d", uid);
- String packageWithHighestDrain = sipper.packageWithHighestDrain;
- if (uid == Process.ROOT_UID) {
- info.label = "<root>";
- } else {
- String[] packages = packageManager.getPackagesForUid(uid);
- String primaryPackageName = null;
- if (uid == Process.SYSTEM_UID) {
- primaryPackageName = SYSTEM_SERVER_PACKAGE_NAME;
- } else if (packages != null) {
- for (String name : packages) {
- primaryPackageName = name;
- if (name.equals(packageWithHighestDrain)) {
- break;
- }
- }
- }
-
- if (primaryPackageName != null) {
- try {
- ApplicationInfo applicationInfo =
- packageManager.getApplicationInfo(primaryPackageName, 0);
- info.label = applicationInfo.loadLabel(packageManager);
- info.iconInfo = applicationInfo;
- } catch (PackageManager.NameNotFoundException e) {
- info.label = primaryPackageName;
- }
- } else if (packageWithHighestDrain != null) {
- info.label = packageWithHighestDrain;
- }
-
- if (packages != null && packages.length > 0) {
- StringBuilder sb = new StringBuilder();
- if (primaryPackageName != null) {
- sb.append(primaryPackageName);
- }
- for (String packageName : packages) {
- if (packageName.equals(primaryPackageName)) {
- continue;
- }
-
- if (sb.length() != 0) {
- sb.append(", ");
- }
- sb.append(packageName);
- }
-
- info.packages = sb;
- }
- }
- break;
- }
- case USER:
- info.label = "User";
- info.details = String.format(Locale.getDefault(), "User ID: %d", sipper.userId);
- break;
- case AMBIENT_DISPLAY:
- info.label = "Ambient display";
- break;
- case BLUETOOTH:
- info.label = "Bluetooth";
- break;
- case CAMERA:
- info.label = "Camera";
- break;
- case CELL:
- info.label = "Cell";
- break;
- case FLASHLIGHT:
- info.label = "Flashlight";
- break;
- case IDLE:
- info.label = "Idle";
- break;
- case MEMORY:
- info.label = "Memory";
- break;
- case OVERCOUNTED:
- info.label = "Overcounted";
- break;
- case PHONE:
- info.label = "Phone";
- break;
- case SCREEN:
- info.label = "Screen";
- break;
- case UNACCOUNTED:
- info.label = "Unaccounted";
- break;
- case WIFI:
- info.label = "WiFi";
- break;
- }
- // Default the app icon to System Server. This includes root, dex2oat and other UIDs.
- if (info.iconInfo == null) {
- try {
- info.iconInfo =
- packageManager.getApplicationInfo(SYSTEM_SERVER_PACKAGE_NAME, 0);
- } catch (PackageManager.NameNotFoundException nameNotFoundException) {
- // Won't happen
- }
- }
- return info;
- }
-}
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerActivity.java b/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerActivity.java
deleted file mode 100644
index f56d113..0000000
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerActivity.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsviewer;
-
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-
-import androidx.activity.result.contract.ActivityResultContract;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentActivity;
-import androidx.fragment.app.FragmentStatePagerAdapter;
-import androidx.viewpager.widget.ViewPager;
-
-import com.google.android.material.tabs.TabLayout;
-
-/**
- * Picker, showing a sorted lists of applications and other types of entities consuming power.
- * Returns the selected entity ID or null.
- */
-public class PowerConsumerPickerActivity extends FragmentActivity {
-
- public static final ActivityResultContract<Void, String> CONTRACT =
- new ActivityResultContract<Void, String>() {
- @NonNull
- @Override
- public Intent createIntent(@NonNull Context context, Void aVoid) {
- return new Intent(context, PowerConsumerPickerActivity.class);
- }
-
- @Override
- public String parseResult(int resultCode, @Nullable Intent intent) {
- if (resultCode != RESULT_OK || intent == null) {
- return null;
- }
- return intent.getStringExtra(Intent.EXTRA_RETURN_RESULT);
- }
- };
-
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- getActionBar().setDisplayHomeAsUpEnabled(true);
-
- setContentView(R.layout.power_consumer_picker_activity_layout);
-
- ViewPager viewPager = findViewById(R.id.pager);
-
- FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(
- getSupportFragmentManager()) {
-
- @Override
- public int getCount() {
- return 2;
- }
-
- @NonNull
- @Override
- public Fragment getItem(int position) {
- switch (position) {
- case 0:
- return new PowerConsumerPickerFragment(
- PowerConsumerPickerFragment.PICKER_TYPE_APP);
- case 1:
- default:
- return new PowerConsumerPickerFragment(
- PowerConsumerPickerFragment.PICKER_TYPE_DRAIN);
- }
- }
-
- @Override
- public CharSequence getPageTitle(int position) {
- switch (position) {
- case 0:
- return "Apps";
- case 1:
- return "Drains";
- }
- return null;
- }
- };
-
- viewPager.setAdapter(adapter);
- TabLayout tabLayout = findViewById(R.id.tab_layout);
- tabLayout.setupWithViewPager(viewPager);
- }
-
- public void setSelectedPowerConsumer(String id) {
- Intent intent = new Intent();
- intent.putExtra(Intent.EXTRA_RETURN_RESULT, id);
- setResult(RESULT_OK, intent);
- finish();
- }
-
- @Override
- public boolean onNavigateUp() {
- onBackPressed();
- return true;
- }
-}
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerFragment.java b/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerFragment.java
deleted file mode 100644
index 25225b8..0000000
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerFragment.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2008 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.frameworks.core.powerstatsviewer;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.BatteryStats;
-import android.os.Bundle;
-import android.os.UserHandle;
-import android.os.UserManager;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-import androidx.loader.app.LoaderManager;
-import androidx.loader.content.Loader;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.android.frameworks.core.powerstatsviewer.PowerConsumerInfoHelper.PowerConsumerInfo;
-import com.android.internal.os.BatterySipper;
-import com.android.internal.os.BatteryStatsHelper;
-import com.android.settingslib.utils.AsyncLoaderCompat;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Locale;
-
-/**
- * Picker, showing a sorted lists of applications or other types of entities consuming power.
- * Returns the selected entity ID or null.
- */
-public class PowerConsumerPickerFragment extends Fragment {
- private static final String TAG = "AppPicker";
-
- public static final String PICKER_TYPE = "pickertype";
-
- public static final int PICKER_TYPE_APP = 0;
- public static final int PICKER_TYPE_DRAIN = 1;
-
- private PowerConsumerListAdapter mPowerConsumerListAdapter;
- private RecyclerView mAppList;
- private View mLoadingView;
-
- private interface OnPowerConsumerSelectedListener {
- void onPowerConsumerSelected(String uid);
- }
-
- public PowerConsumerPickerFragment(int pickerType) {
- Bundle args = new Bundle();
- args.putInt(PICKER_TYPE, pickerType);
- setArguments(args);
- }
-
- public PowerConsumerPickerFragment() {
- }
-
- @Nullable
- @Override
- public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.power_consumer_picker_layout, container, false);
- mLoadingView = view.findViewById(R.id.loading_view);
-
- mAppList = view.findViewById(R.id.list_view);
- mAppList.setLayoutManager(new LinearLayoutManager(getContext()));
- mPowerConsumerListAdapter = new PowerConsumerListAdapter(
- PowerConsumerPickerFragment.this::setSelectedPowerConsumer);
- mAppList.setAdapter(mPowerConsumerListAdapter);
-
- LoaderManager.getInstance(this).initLoader(0, getArguments(),
- new PowerConsumerListLoaderCallbacks());
- return view;
- }
-
- public void setSelectedPowerConsumer(String id) {
- ((PowerConsumerPickerActivity) getActivity()).setSelectedPowerConsumer(id);
- }
-
- private static class PowerConsumerListLoader extends
- AsyncLoaderCompat<List<PowerConsumerInfo>> {
- private final BatteryStatsHelper mStatsHelper;
- private final int mPickerType;
- private final UserManager mUserManager;
- private final PackageManager mPackageManager;
-
- PowerConsumerListLoader(Context context, int pickerType) {
- super(context);
- mUserManager = context.getSystemService(UserManager.class);
- mStatsHelper = new BatteryStatsHelper(context, false /* collectBatteryBroadcast */);
- mPickerType = pickerType;
- mStatsHelper.create((Bundle) null);
- mStatsHelper.clearStats();
- mPackageManager = context.getPackageManager();
- }
-
- @Override
- public List<PowerConsumerInfo> loadInBackground() {
- List<PowerConsumerInfoHelper.PowerConsumerInfo> powerConsumerList = new ArrayList<>();
-
- mStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, UserHandle.myUserId());
-
- final List<BatterySipper> usageList = mStatsHelper.getUsageList();
- for (BatterySipper sipper : usageList) {
- switch (mPickerType) {
- case PICKER_TYPE_APP:
- if (sipper.drainType != BatterySipper.DrainType.APP) {
- continue;
- }
- break;
- case PICKER_TYPE_DRAIN:
- default:
- if (sipper.drainType == BatterySipper.DrainType.APP) {
- continue;
- }
- }
-
- powerConsumerList.add(
- PowerConsumerInfoHelper.makePowerConsumerInfo(mPackageManager, sipper));
- }
-
- powerConsumerList.sort(
- Comparator.comparing((PowerConsumerInfo a) -> a.powerMah).reversed());
- return powerConsumerList;
- }
-
- @Override
- protected void onDiscardResult(List<PowerConsumerInfo> result) {
- }
- }
-
- private class PowerConsumerListLoaderCallbacks implements
- LoaderManager.LoaderCallbacks<List<PowerConsumerInfo>> {
-
- @NonNull
- @Override
- public Loader<List<PowerConsumerInfo>> onCreateLoader(int id, Bundle args) {
- return new PowerConsumerListLoader(getContext(), args.getInt(PICKER_TYPE));
- }
-
- @Override
- public void onLoadFinished(@NonNull Loader<List<PowerConsumerInfo>> loader,
- List<PowerConsumerInfoHelper.PowerConsumerInfo> powerConsumerList) {
- mPowerConsumerListAdapter.setPowerConsumerList(powerConsumerList);
- mAppList.setVisibility(View.VISIBLE);
- mLoadingView.setVisibility(View.GONE);
- }
-
- @Override
- public void onLoaderReset(
- @NonNull Loader<List<PowerConsumerInfoHelper.PowerConsumerInfo>> loader) {
- }
- }
-
- public class PowerConsumerListAdapter extends RecyclerView.Adapter<PowerConsumerViewHolder> {
- private final OnPowerConsumerSelectedListener mListener;
- private List<PowerConsumerInfo> mPowerConsumerList;
-
- public PowerConsumerListAdapter(OnPowerConsumerSelectedListener listener) {
- mListener = listener;
- }
-
- void setPowerConsumerList(List<PowerConsumerInfo> powerConsumerList) {
- mPowerConsumerList = powerConsumerList;
- notifyDataSetChanged();
- }
-
- @Override
- public int getItemCount() {
- return mPowerConsumerList.size();
- }
-
- @NonNull
- @Override
- public PowerConsumerViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup,
- int position) {
- LayoutInflater layoutInflater = LayoutInflater.from(viewGroup.getContext());
- View view = layoutInflater.inflate(R.layout.power_consumer_info_layout, viewGroup,
- false);
- return new PowerConsumerViewHolder(view, mListener);
- }
-
- @Override
- public void onBindViewHolder(@NonNull PowerConsumerViewHolder viewHolder, int position) {
- PowerConsumerInfoHelper.PowerConsumerInfo item = mPowerConsumerList.get(position);
- viewHolder.id = item.id;
- viewHolder.titleView.setText(item.label);
- if (item.details != null) {
- viewHolder.detailsView.setText(item.details);
- viewHolder.detailsView.setVisibility(View.VISIBLE);
- } else {
- viewHolder.detailsView.setVisibility(View.GONE);
- }
- viewHolder.powerView.setText(
- String.format(Locale.getDefault(), "%.1f mAh", item.powerMah));
- viewHolder.iconView.setImageDrawable(
- item.iconInfo.loadIcon(getContext().getPackageManager()));
- if (item.packages != null) {
- viewHolder.packagesView.setText(item.packages);
- viewHolder.packagesView.setVisibility(View.VISIBLE);
- } else {
- viewHolder.packagesView.setVisibility(View.GONE);
- }
- }
- }
-
- // View Holder used when displaying apps
- public static class PowerConsumerViewHolder extends RecyclerView.ViewHolder
- implements View.OnClickListener {
- private final OnPowerConsumerSelectedListener mListener;
-
- public String id;
- public TextView titleView;
- public TextView detailsView;
- public ImageView iconView;
- public TextView packagesView;
- public TextView powerView;
-
- PowerConsumerViewHolder(View view, OnPowerConsumerSelectedListener listener) {
- super(view);
- mListener = listener;
- view.setOnClickListener(this);
- titleView = view.findViewById(android.R.id.title);
- detailsView = view.findViewById(R.id.details);
- iconView = view.findViewById(android.R.id.icon);
- packagesView = view.findViewById(R.id.packages);
- powerView = view.findViewById(R.id.power_mah);
- powerView.setVisibility(View.VISIBLE);
- }
-
- @Override
- public void onClick(View v) {
- mListener.onPowerConsumerSelected(id);
- }
- }
-}
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsData.java b/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsData.java
deleted file mode 100644
index 7aeb86a..0000000
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsData.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsviewer;
-
-import android.content.Context;
-import android.os.BatteryStats;
-import android.os.Process;
-
-import com.android.internal.os.BatterySipper;
-import com.android.internal.os.BatteryStatsHelper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PowerStatsData {
- private static final String PACKAGE_CALENDAR_PROVIDER = "com.android.providers.calendar";
- private static final String PACKAGE_MEDIA_PROVIDER = "com.android.providers.media";
- private static final String PACKAGE_SYSTEMUI = "com.android.systemui";
- private static final String[] PACKAGES_SYSTEM = {PACKAGE_MEDIA_PROVIDER,
- PACKAGE_CALENDAR_PROVIDER, PACKAGE_SYSTEMUI};
-
- // Temporary placeholder voltage for converting energy to charge
- // TODO: remove this when b/173765509 is resolved
- private static final double MOCK_NOMINAL_VOLTAGE = 3.7;
-
- // Unit conversion:
- // mAh = uWs * (1/1000)(milli/micro) * (1/Voltage) * (1/3600)(hours/second)
- private static final double UJ_2_MAH =
- (1.0 / 1000) * (1.0 / MOCK_NOMINAL_VOLTAGE) * (1.0 / 3600);
-
- enum EntryType {
- POWER,
- DURATION,
- }
-
- public static class Entry {
- public String title;
- public EntryType entryType;
- public double value;
- public double total;
- }
-
- private final PowerConsumerInfoHelper.PowerConsumerInfo mPowerConsumerInfo;
- private final List<Entry> mEntries = new ArrayList<>();
-
- public PowerStatsData(Context context, BatteryStatsHelper batteryStatsHelper,
- String powerConsumerId) {
- List<BatterySipper> usageList = batteryStatsHelper.getUsageList();
- BatteryStats batteryStats = batteryStatsHelper.getStats();
-
- double totalPowerMah = 0;
- double totalSmearedPowerMah = 0;
- double totalPowerExcludeSystemMah = 0;
- double totalScreenPower = 0;
- double totalProportionalSmearMah = 0;
- double totalCpuPowerMah = 0;
- double totalSystemServiceCpuPowerMah = 0;
- double totalUsagePowerMah = 0;
- double totalWakeLockPowerMah = 0;
- double totalMobileRadioPowerMah = 0;
- double totalWifiPowerMah = 0;
- double totalBluetoothPowerMah = 0;
- double totalGpsPowerMah = 0;
- double totalCameraPowerMah = 0;
- double totalFlashlightPowerMah = 0;
- double totalSensorPowerMah = 0;
- double totalAudioPowerMah = 0;
- double totalVideoPowerMah = 0;
-
- long totalCpuTimeMs = 0;
- long totalCpuFgTimeMs = 0;
- long totalWakeLockTimeMs = 0;
- long totalWifiRunningTimeMs = 0;
- long totalBluetoothRunningTimeMs = 0;
- long totalGpsTimeMs = 0;
- long totalCameraTimeMs = 0;
- long totalFlashlightTimeMs = 0;
- long totalAudioTimeMs = 0;
- long totalVideoTimeMs = 0;
-
- BatterySipper requestedPowerConsumer = null;
- for (BatterySipper sipper : usageList) {
- if (sipper.drainType == BatterySipper.DrainType.SCREEN) {
- totalScreenPower = sipper.sumPower();
- }
-
- if (powerConsumerId(sipper).equals(powerConsumerId)) {
- requestedPowerConsumer = sipper;
- }
-
- totalPowerMah += sipper.sumPower();
- totalSmearedPowerMah += sipper.totalSmearedPowerMah;
- totalProportionalSmearMah += sipper.proportionalSmearMah;
-
- if (!isSystemSipper(sipper)) {
- totalPowerExcludeSystemMah += sipper.totalSmearedPowerMah;
- }
-
- totalCpuPowerMah += sipper.cpuPowerMah;
- totalSystemServiceCpuPowerMah += sipper.systemServiceCpuPowerMah;
- totalUsagePowerMah += sipper.usagePowerMah;
- totalWakeLockPowerMah += sipper.wakeLockPowerMah;
- totalMobileRadioPowerMah += sipper.mobileRadioPowerMah;
- totalWifiPowerMah += sipper.wifiPowerMah;
- totalBluetoothPowerMah += sipper.bluetoothPowerMah;
- totalGpsPowerMah += sipper.gpsPowerMah;
- totalCameraPowerMah += sipper.cameraPowerMah;
- totalFlashlightPowerMah += sipper.flashlightPowerMah;
- totalSensorPowerMah += sipper.sensorPowerMah;
- totalAudioPowerMah += sipper.audioPowerMah;
- totalVideoPowerMah += sipper.videoPowerMah;
-
- totalCpuTimeMs += sipper.cpuTimeMs;
- totalCpuFgTimeMs += sipper.cpuFgTimeMs;
- totalWakeLockTimeMs += sipper.wakeLockTimeMs;
- totalWifiRunningTimeMs += sipper.wifiRunningTimeMs;
- totalBluetoothRunningTimeMs += sipper.bluetoothRunningTimeMs;
- totalGpsTimeMs += sipper.gpsTimeMs;
- totalCameraTimeMs += sipper.cameraTimeMs;
- totalFlashlightTimeMs += sipper.flashlightTimeMs;
- totalAudioTimeMs += sipper.audioTimeMs;
- totalVideoTimeMs += sipper.videoTimeMs;
- }
-
- long totalScreenMeasuredEnergyUJ = batteryStats.getScreenOnEnergy();
-
- if (requestedPowerConsumer == null) {
- mPowerConsumerInfo = null;
- return;
- }
-
- mPowerConsumerInfo = PowerConsumerInfoHelper.makePowerConsumerInfo(
- context.getPackageManager(), requestedPowerConsumer);
-
- addEntry("Total power", EntryType.POWER,
- requestedPowerConsumer.totalSmearedPowerMah, totalSmearedPowerMah);
- maybeAddMeasuredEnergyEntry(requestedPowerConsumer.drainType, batteryStats);
-
- addEntry("... excluding system", EntryType.POWER,
- requestedPowerConsumer.totalSmearedPowerMah, totalPowerExcludeSystemMah);
- addEntry("Screen, smeared", EntryType.POWER,
- requestedPowerConsumer.screenPowerMah, totalScreenPower);
- if (totalScreenMeasuredEnergyUJ != BatteryStats.ENERGY_DATA_UNAVAILABLE) {
- final double measuredCharge = UJ_2_MAH * totalScreenMeasuredEnergyUJ;
- final double ratio = measuredCharge / totalScreenPower;
- addEntry("Screen, smeared (PowerStatsHal adjusted)", EntryType.POWER,
- requestedPowerConsumer.screenPowerMah * ratio, measuredCharge);
- }
- addEntry("Other, smeared", EntryType.POWER,
- requestedPowerConsumer.proportionalSmearMah, totalProportionalSmearMah);
- addEntry("Excluding smeared", EntryType.POWER,
- requestedPowerConsumer.totalPowerMah, totalPowerMah);
- addEntry("CPU", EntryType.POWER,
- requestedPowerConsumer.cpuPowerMah, totalCpuPowerMah);
- addEntry("System services", EntryType.POWER,
- requestedPowerConsumer.systemServiceCpuPowerMah, totalSystemServiceCpuPowerMah);
- addEntry("Usage", EntryType.POWER,
- requestedPowerConsumer.usagePowerMah, totalUsagePowerMah);
- addEntry("Wake lock", EntryType.POWER,
- requestedPowerConsumer.wakeLockPowerMah, totalWakeLockPowerMah);
- addEntry("Mobile radio", EntryType.POWER,
- requestedPowerConsumer.mobileRadioPowerMah, totalMobileRadioPowerMah);
- addEntry("WiFi", EntryType.POWER,
- requestedPowerConsumer.wifiPowerMah, totalWifiPowerMah);
- addEntry("Bluetooth", EntryType.POWER,
- requestedPowerConsumer.bluetoothPowerMah, totalBluetoothPowerMah);
- addEntry("GPS", EntryType.POWER,
- requestedPowerConsumer.gpsPowerMah, totalGpsPowerMah);
- addEntry("Camera", EntryType.POWER,
- requestedPowerConsumer.cameraPowerMah, totalCameraPowerMah);
- addEntry("Flashlight", EntryType.POWER,
- requestedPowerConsumer.flashlightPowerMah, totalFlashlightPowerMah);
- addEntry("Sensors", EntryType.POWER,
- requestedPowerConsumer.sensorPowerMah, totalSensorPowerMah);
- addEntry("Audio", EntryType.POWER,
- requestedPowerConsumer.audioPowerMah, totalAudioPowerMah);
- addEntry("Video", EntryType.POWER,
- requestedPowerConsumer.videoPowerMah, totalVideoPowerMah);
-
- addEntry("CPU time", EntryType.DURATION,
- requestedPowerConsumer.cpuTimeMs, totalCpuTimeMs);
- addEntry("CPU foreground time", EntryType.DURATION,
- requestedPowerConsumer.cpuFgTimeMs, totalCpuFgTimeMs);
- addEntry("Wake lock time", EntryType.DURATION,
- requestedPowerConsumer.wakeLockTimeMs, totalWakeLockTimeMs);
- addEntry("WiFi running time", EntryType.DURATION,
- requestedPowerConsumer.wifiRunningTimeMs, totalWifiRunningTimeMs);
- addEntry("Bluetooth time", EntryType.DURATION,
- requestedPowerConsumer.bluetoothRunningTimeMs, totalBluetoothRunningTimeMs);
- addEntry("GPS time", EntryType.DURATION,
- requestedPowerConsumer.gpsTimeMs, totalGpsTimeMs);
- addEntry("Camera time", EntryType.DURATION,
- requestedPowerConsumer.cameraTimeMs, totalCameraTimeMs);
- addEntry("Flashlight time", EntryType.DURATION,
- requestedPowerConsumer.flashlightTimeMs, totalFlashlightTimeMs);
- addEntry("Audio time", EntryType.DURATION,
- requestedPowerConsumer.audioTimeMs, totalAudioTimeMs);
- addEntry("Video time", EntryType.DURATION,
- requestedPowerConsumer.videoTimeMs, totalVideoTimeMs);
- }
-
- private boolean isSystemSipper(BatterySipper sipper) {
- final int uid = sipper.uidObj == null ? -1 : sipper.getUid();
- if (uid >= Process.ROOT_UID && uid < Process.FIRST_APPLICATION_UID) {
- return true;
- } else if (sipper.mPackages != null) {
- for (final String packageName : sipper.mPackages) {
- for (final String systemPackage : PACKAGES_SYSTEM) {
- if (systemPackage.equals(packageName)) {
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
- private void addEntry(String title, EntryType entryType, double amount, double totalAmount) {
- Entry entry = new Entry();
- entry.title = title;
- entry.entryType = entryType;
- entry.value = amount;
- entry.total = totalAmount;
- mEntries.add(entry);
- }
-
- private void maybeAddMeasuredEnergyEntry(BatterySipper.DrainType drainType,
- BatteryStats batteryStats) {
- switch (drainType) {
- case AMBIENT_DISPLAY:
- final long totalDozeMeasuredEnergyUJ = batteryStats.getScreenDozeEnergy();
- if (totalDozeMeasuredEnergyUJ != BatteryStats.ENERGY_DATA_UNAVAILABLE) {
- final double measuredCharge = UJ_2_MAH * totalDozeMeasuredEnergyUJ;
- addEntry("Measured ambient display power", EntryType.POWER, measuredCharge,
- measuredCharge);
- }
- break;
- case SCREEN:
- final long totalScreenMeasuredEnergyUJ = batteryStats.getScreenOnEnergy();
- if (totalScreenMeasuredEnergyUJ != BatteryStats.ENERGY_DATA_UNAVAILABLE) {
- final double measuredCharge = UJ_2_MAH * totalScreenMeasuredEnergyUJ;
- addEntry("Measured screen power", EntryType.POWER, measuredCharge,
- measuredCharge);
- }
- break;
- }
- }
-
- public PowerConsumerInfoHelper.PowerConsumerInfo getPowerConsumerInfo() {
- return mPowerConsumerInfo;
- }
-
- public List<Entry> getEntries() {
- return mEntries;
- }
-
- public static String powerConsumerId(BatterySipper sipper) {
- return sipper.drainType + "|" + sipper.userId + "|" + sipper.getUid();
- }
-}
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsViewerActivity.java b/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsViewerActivity.java
deleted file mode 100644
index 0567910..0000000
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsViewerActivity.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Copyright (C) 2020 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.frameworks.core.powerstatsviewer;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.BatteryStats;
-import android.os.Bundle;
-import android.os.UserHandle;
-import android.os.UserManager;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.activity.ComponentActivity;
-import androidx.activity.result.ActivityResultLauncher;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.loader.app.LoaderManager;
-import androidx.loader.app.LoaderManager.LoaderCallbacks;
-import androidx.loader.content.Loader;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.android.internal.os.BatteryStatsHelper;
-import com.android.settingslib.utils.AsyncLoaderCompat;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-
-public class PowerStatsViewerActivity extends ComponentActivity {
- private static final int POWER_STATS_REFRESH_RATE_MILLIS = 60 * 1000;
- public static final String PREF_SELECTED_POWER_CONSUMER = "powerConsumerId";
- private static final String LOADER_ARG_POWER_CONSUMER_ID = "powerConsumerId";
-
- private PowerStatsDataAdapter mPowerStatsDataAdapter;
- private Runnable mPowerStatsRefresh = this::periodicPowerStatsRefresh;
- private SharedPreferences mSharedPref;
- private String mPowerConsumerId;
- private TextView mTitleView;
- private TextView mDetailsView;
- private ImageView mIconView;
- private TextView mPackagesView;
- private RecyclerView mPowerStatsDataView;
- private View mLoadingView;
- private View mEmptyView;
- private ActivityResultLauncher<Void> mStartAppPicker = registerForActivityResult(
- PowerConsumerPickerActivity.CONTRACT, this::onApplicationSelected);
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mSharedPref = getPreferences(Context.MODE_PRIVATE);
-
- setContentView(R.layout.power_stats_viewer_layout);
-
- View appCard = findViewById(R.id.app_card);
- appCard.setOnClickListener((e) -> startAppPicker());
-
- mTitleView = findViewById(android.R.id.title);
- mDetailsView = findViewById(R.id.details);
- mIconView = findViewById(android.R.id.icon);
- mPackagesView = findViewById(R.id.packages);
-
- mPowerStatsDataView = findViewById(R.id.power_stats_data_view);
- mPowerStatsDataView.setLayoutManager(new LinearLayoutManager(this));
- mPowerStatsDataAdapter = new PowerStatsDataAdapter();
- mPowerStatsDataView.setAdapter(mPowerStatsDataAdapter);
-
- mLoadingView = findViewById(R.id.loading_view);
- mEmptyView = findViewById(R.id.empty_view);
-
- mPowerConsumerId = mSharedPref.getString(PREF_SELECTED_POWER_CONSUMER, null);
- loadPowerStats();
- if (mPowerConsumerId == null) {
- startAppPicker();
- }
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- periodicPowerStatsRefresh();
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- getMainThreadHandler().removeCallbacks(mPowerStatsRefresh);
- }
-
- private void startAppPicker() {
- mStartAppPicker.launch(null);
- }
-
- private void onApplicationSelected(String powerConsumerId) {
- if (powerConsumerId == null) {
- if (mPowerConsumerId == null) {
- finish();
- }
- } else {
- mPowerConsumerId = powerConsumerId;
- mSharedPref.edit().putString(PREF_SELECTED_POWER_CONSUMER, mPowerConsumerId).apply();
- mLoadingView.setVisibility(View.VISIBLE);
- loadPowerStats();
- }
- }
-
- private void periodicPowerStatsRefresh() {
- loadPowerStats();
- getMainThreadHandler().postDelayed(mPowerStatsRefresh, POWER_STATS_REFRESH_RATE_MILLIS);
- }
-
- private void loadPowerStats() {
- Bundle args = new Bundle();
- args.putString(LOADER_ARG_POWER_CONSUMER_ID, mPowerConsumerId);
- LoaderManager.getInstance(this).restartLoader(0, args, new PowerStatsDataLoaderCallbacks());
- }
-
- private static class PowerStatsDataLoader extends AsyncLoaderCompat<PowerStatsData> {
- private final String mPowerConsumerId;
- private final BatteryStatsHelper mBatteryStatsHelper;
- private final UserManager mUserManager;
-
- PowerStatsDataLoader(Context context, String powerConsumerId) {
- super(context);
- mPowerConsumerId = powerConsumerId;
- mUserManager = context.getSystemService(UserManager.class);
- mBatteryStatsHelper = new BatteryStatsHelper(context,
- false /* collectBatteryBroadcast */);
- mBatteryStatsHelper.create((Bundle) null);
- mBatteryStatsHelper.clearStats();
- }
-
- @Override
- public PowerStatsData loadInBackground() {
- mBatteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
- UserHandle.myUserId());
- return new PowerStatsData(getContext(), mBatteryStatsHelper, mPowerConsumerId);
- }
-
- @Override
- protected void onDiscardResult(PowerStatsData result) {
- }
- }
-
- private class PowerStatsDataLoaderCallbacks implements LoaderCallbacks<PowerStatsData> {
- @NonNull
- @Override
- public Loader<PowerStatsData> onCreateLoader(int id, Bundle args) {
- return new PowerStatsDataLoader(PowerStatsViewerActivity.this,
- args.getString(LOADER_ARG_POWER_CONSUMER_ID));
- }
-
- @Override
- public void onLoadFinished(@NonNull Loader<PowerStatsData> loader,
- PowerStatsData powerStatsData) {
-
- PowerConsumerInfoHelper.PowerConsumerInfo
- powerConsumerInfo = powerStatsData.getPowerConsumerInfo();
- if (powerConsumerInfo == null) {
- mTitleView.setText("Power consumer not found");
- mPackagesView.setVisibility(View.GONE);
- } else {
- mTitleView.setText(powerConsumerInfo.label);
- if (powerConsumerInfo.details != null) {
- mDetailsView.setText(powerConsumerInfo.details);
- mDetailsView.setVisibility(View.VISIBLE);
- } else {
- mDetailsView.setVisibility(View.GONE);
- }
- mIconView.setImageDrawable(
- powerConsumerInfo.iconInfo.loadIcon(getPackageManager()));
-
- if (powerConsumerInfo.packages != null) {
- mPackagesView.setText(powerConsumerInfo.packages);
- mPackagesView.setVisibility(View.VISIBLE);
- } else {
- mPackagesView.setVisibility(View.GONE);
- }
- }
-
- mPowerStatsDataAdapter.setEntries(powerStatsData.getEntries());
- if (powerStatsData.getEntries().isEmpty()) {
- mEmptyView.setVisibility(View.VISIBLE);
- mPowerStatsDataView.setVisibility(View.GONE);
- } else {
- mEmptyView.setVisibility(View.GONE);
- mPowerStatsDataView.setVisibility(View.VISIBLE);
- }
-
- mLoadingView.setVisibility(View.GONE);
- }
-
- @Override
- public void onLoaderReset(@NonNull Loader<PowerStatsData> loader) {
- }
- }
-
- private static class PowerStatsDataAdapter extends
- RecyclerView.Adapter<PowerStatsDataAdapter.ViewHolder> {
- public static class ViewHolder extends RecyclerView.ViewHolder {
- public TextView titleTextView;
- public TextView amountTextView;
- public TextView percentTextView;
-
- ViewHolder(View itemView) {
- super(itemView);
-
- titleTextView = itemView.findViewById(R.id.title);
- amountTextView = itemView.findViewById(R.id.amount);
- percentTextView = itemView.findViewById(R.id.percent);
- }
- }
-
- private List<PowerStatsData.Entry> mEntries = Collections.emptyList();
-
- public void setEntries(List<PowerStatsData.Entry> entries) {
- mEntries = entries;
- notifyDataSetChanged();
- }
-
- @Override
- public int getItemCount() {
- return mEntries.size();
- }
-
- @NonNull
- @Override
- public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int position) {
- LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
- View itemView = layoutInflater.inflate(R.layout.power_stats_entry_layout, parent,
- false);
- return new ViewHolder(itemView);
- }
-
- @Override
- public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) {
- PowerStatsData.Entry entry = mEntries.get(position);
- switch (entry.entryType) {
- case POWER:
- viewHolder.titleTextView.setText(entry.title);
- viewHolder.amountTextView.setText(
- String.format(Locale.getDefault(), "%.1f mAh", entry.value));
- break;
- case DURATION:
- viewHolder.titleTextView.setText(entry.title);
- viewHolder.amountTextView.setText(
- String.format(Locale.getDefault(), "%,d ms", (long) entry.value));
- break;
- }
-
- double proportion = entry.total != 0 ? entry.value * 100 / entry.total : 0;
- viewHolder.percentTextView.setText(String.format(Locale.getDefault(), "%.1f%%",
- proportion));
- }
- }
-}
diff --git a/data/etc/OWNERS b/data/etc/OWNERS
index 70d4678..5efd0bd 100644
--- a/data/etc/OWNERS
+++ b/data/etc/OWNERS
@@ -1 +1,13 @@
-per-file privapp-permissions-platform.xml = hackbod@android.com, jsharkey@android.com, svetoslavganov@google.com, toddke@google.com, yamasani@google.com, cbrubaker@google.com, jeffv@google.com, moltmann@google.com, lorenzo@google.com
+cbrubaker@google.com
+hackbod@android.com
+hackbod@google.com
+jeffv@google.com
+jsharkey@android.com
+jsharkey@google.com
+lorenzo@google.com
+moltmann@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
+toddke@android.com
+toddke@google.com
+yamasani@google.com
diff --git a/data/etc/car/Android.bp b/data/etc/car/Android.bp
index 3e3aefc..7f20b3b 100644
--- a/data/etc/car/Android.bp
+++ b/data/etc/car/Android.bp
@@ -159,6 +159,13 @@
}
prebuilt_etc {
+ name: "privapp_allowlist_com.google.android.car.networking.preferenceupdater",
+ sub_dir: "permissions",
+ src: "com.google.android.car.networking.preferenceupdater.xml",
+ filename_from_src: true,
+}
+
+prebuilt_etc {
name: "allowed_privapp_com.android.carshell",
sub_dir: "permissions",
src: "com.android.car.shell.xml",
diff --git a/data/etc/car/OWNERS b/data/etc/car/OWNERS
new file mode 100644
index 0000000..09e257c
--- /dev/null
+++ b/data/etc/car/OWNERS
@@ -0,0 +1 @@
+include platform/packages/services/Car:/OWNERS
diff --git a/data/etc/car/com.android.car.provision.xml b/data/etc/car/com.android.car.provision.xml
index 474cd54..4fd9cae 100644
--- a/data/etc/car/com.android.car.provision.xml
+++ b/data/etc/car/com.android.car.provision.xml
@@ -18,6 +18,8 @@
<privapp-permissions package="com.android.car.provision">
<permission name="android.car.permission.CAR_POWERTRAIN"/>
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
+ <permission name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
+ <permission name="android.permission.MANAGE_USERS"/>
<permission name="android.permission.MASTER_CLEAR"/>
<permission name="android.permission.QUERY_ALL_PACKAGES"/>
<permission name="android.permission.SEND_CATEGORY_CAR_NOTIFICATIONS"/>
diff --git a/data/etc/car/com.google.android.car.networking.preferenceupdater.xml b/data/etc/car/com.google.android.car.networking.preferenceupdater.xml
new file mode 100644
index 0000000..489ce1b
--- /dev/null
+++ b/data/etc/car/com.google.android.car.networking.preferenceupdater.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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
+ -->
+<permissions>
+ <privapp-permissions package="com.google.android.car.networking.preferenceupdater">
+ <permission name="android.permission.ACCESS_NETWORK_STATE"/>
+ <permission name="android.permission.ACCESS_WIFI_STATE"/>
+ <permission name="android.permission.ACTIVITY_EMBEDDING"/>
+ <permission name="android.permission.INTERACT_ACROSS_USERS"/>
+ <permission name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
+ <permission name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/>
+ <permission name="android.permission.LOCATION_HARDWARE"/>
+ </privapp-permissions>
+</permissions>
diff --git a/data/etc/com.android.documentsui.xml b/data/etc/com.android.documentsui.xml
index 1e570ba..d32cbec 100644
--- a/data/etc/com.android.documentsui.xml
+++ b/data/etc/com.android.documentsui.xml
@@ -22,5 +22,6 @@
<permission name="android.permission.LOG_COMPAT_CHANGE"/>
<permission name="android.permission.MODIFY_QUIET_MODE"/>
<permission name="android.permission.READ_COMPAT_CHANGE_CONFIG"/>
+ <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/>
</privapp-permissions>
</permissions>
diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml
index 5f129fe..0a77be9 100644
--- a/data/etc/privapp-permissions-platform.xml
+++ b/data/etc/privapp-permissions-platform.xml
@@ -210,6 +210,7 @@
<privapp-permissions package="com.android.providers.contacts">
<permission name="android.permission.BIND_DIRECTORY_SEARCH"/>
+ <permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>
<permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/>
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
<permission name="android.permission.MANAGE_USERS"/>
@@ -245,6 +246,7 @@
<permission name="android.permission.REGISTER_STATS_PULL_ATOM" />
<!-- Permissions required for reading DeviceConfig -->
<permission name="android.permission.READ_DEVICE_CONFIG" />
+ <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/>
</privapp-permissions>
<privapp-permissions package="com.android.providers.telephony">
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index a5667b2..d8a735c 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -1021,12 +1021,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "-903853754": {
- "message": "pauseBackStacks: stack=%s mResumedActivity=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_STATES",
- "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
- },
"-883738232": {
"message": "Adding more than one toast window for UID at a time.",
"level": "WARN",
@@ -1069,6 +1063,12 @@
"group": "WM_DEBUG_TASKS",
"at": "com\/android\/server\/wm\/ActivityTaskSupervisor.java"
},
+ "-856590985": {
+ "message": "dcTarget: %s mImeRequester: %s",
+ "level": "DEBUG",
+ "group": "WM_DEBUG_IME",
+ "at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
+ },
"-856025122": {
"message": "SURFACE transparentRegionHint=%s: %s",
"level": "INFO",
@@ -1717,12 +1717,6 @@
"group": "WM_SHOW_TRANSACTIONS",
"at": "com\/android\/server\/wm\/Session.java"
},
- "-49129622": {
- "message": "performLayout: Activity exiting now removed %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
- },
"-33096143": {
"message": "applyAnimation: transition animation is disabled or skipped. container=%s",
"level": "VERBOSE",
@@ -1777,6 +1771,12 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
+ "44438983": {
+ "message": "performLayout: Activity exiting now removed %s",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_ADD_REMOVE",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"45285419": {
"message": "startingWindow was set but startingSurface==null, couldn't remove",
"level": "VERBOSE",
@@ -1837,12 +1837,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowContextListenerController.java"
},
- "91350919": {
- "message": "Attempted to set IME flag to a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
"94402792": {
"message": "Moving to RESUMED: %s (in existing)",
"level": "VERBOSE",
@@ -2125,6 +2119,12 @@
"group": "WM_DEBUG_APP_TRANSITIONS",
"at": "com\/android\/server\/wm\/AppTransition.java"
},
+ "349443311": {
+ "message": "pauseBackStacks: task=%s mResumedActivity=%s",
+ "level": "DEBUG",
+ "group": "WM_DEBUG_STATES",
+ "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
+ },
"355720268": {
"message": "stopFreezingDisplayLocked: Unfreezing now",
"level": "DEBUG",
@@ -2383,12 +2383,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "632168013": {
- "message": "dcTarget: %s mImeTargetFromIme: %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_IME",
- "at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
- },
"633654009": {
"message": "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s",
"level": "INFO",
diff --git a/data/fonts/OWNERS b/data/fonts/OWNERS
new file mode 100644
index 0000000..a538331
--- /dev/null
+++ b/data/fonts/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/graphics/fonts/OWNERS
diff --git a/drm/java/android/drm/OWNERS b/drm/java/android/drm/OWNERS
new file mode 100644
index 0000000..4387100
--- /dev/null
+++ b/drm/java/android/drm/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 49079
+
+jtinker@google.com
+robertshih@google.com
diff --git a/errorprone/OWNERS b/errorprone/OWNERS
new file mode 100644
index 0000000..bddbdb3
--- /dev/null
+++ b/errorprone/OWNERS
@@ -0,0 +1,2 @@
+jsharkey@android.com
+jsharkey@google.com
diff --git a/graphics/OWNERS b/graphics/OWNERS
new file mode 100644
index 0000000..a6d1bc3
--- /dev/null
+++ b/graphics/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/graphics/OWNERS
diff --git a/graphics/java/android/graphics/OWNERS b/graphics/java/android/graphics/OWNERS
new file mode 100644
index 0000000..c3fb6f8
--- /dev/null
+++ b/graphics/java/android/graphics/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 24939
+
+romainguy@google.com
+jreck@google.com
+njawad@google.com
+sumir@google.com
+
+per-file BLASTBufferQueue.java = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/graphics/java/android/graphics/ParcelableColorSpace.java b/graphics/java/android/graphics/ParcelableColorSpace.java
index 3260849..748d66c 100644
--- a/graphics/java/android/graphics/ParcelableColorSpace.java
+++ b/graphics/java/android/graphics/ParcelableColorSpace.java
@@ -22,18 +22,19 @@
import android.os.Parcelable;
/**
- * A {@link Parcelable} {@link ColorSpace}. In order to enable parceling, the ColorSpace
- * must be either a {@link ColorSpace.Named Named} ColorSpace or a {@link ColorSpace.Rgb} instance
- * that has an ICC parametric transfer function as returned by {@link Rgb#getTransferParameters()}.
+ * A {@link Parcelable} wrapper for a {@link ColorSpace}. In order to enable parceling, the
+ * ColorSpace must be either a {@link ColorSpace.Named Named} ColorSpace or a
+ * {@link ColorSpace.Rgb} instance that has an ICC parametric transfer function as returned by
+ * {@link ColorSpace.Rgb#getTransferParameters()}.
*/
-public final class ParcelableColorSpace extends ColorSpace implements Parcelable {
+public final class ParcelableColorSpace implements Parcelable {
private final ColorSpace mColorSpace;
/**
* Checks if the given ColorSpace is able to be parceled. A ColorSpace can only be
* parceled if it is a {@link ColorSpace.Named Named} ColorSpace or a {@link ColorSpace.Rgb}
* instance that has an ICC parametric transfer function as returned by
- * {@link Rgb#getTransferParameters()}
+ * {@link ColorSpace.Rgb#getTransferParameters()}
*/
public static boolean isParcelable(@NonNull ColorSpace colorSpace) {
if (colorSpace.getId() == ColorSpace.MIN_ID) {
@@ -57,7 +58,6 @@
* to be parceled. See {@link #isParcelable(ColorSpace)}.
*/
public ParcelableColorSpace(@NonNull ColorSpace colorSpace) {
- super(colorSpace.getName(), colorSpace.getModel(), colorSpace.getId());
mColorSpace = colorSpace;
if (mColorSpace.getId() == ColorSpace.MIN_ID) {
@@ -139,31 +139,6 @@
};
@Override
- public boolean isWideGamut() {
- return mColorSpace.isWideGamut();
- }
-
- @Override
- public float getMinValue(int component) {
- return mColorSpace.getMinValue(component);
- }
-
- @Override
- public float getMaxValue(int component) {
- return mColorSpace.getMaxValue(component);
- }
-
- @Override
- public @NonNull float[] toXyz(@NonNull float[] v) {
- return mColorSpace.toXyz(v);
- }
-
- @Override
- public @NonNull float[] fromXyz(@NonNull float[] v) {
- return mColorSpace.fromXyz(v);
- }
-
- @Override
public boolean equals(@Nullable Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@@ -175,10 +150,4 @@
public int hashCode() {
return mColorSpace.hashCode();
}
-
- /** @hide */
- @Override
- long getNativeInstance() {
- return mColorSpace.getNativeInstance();
- }
}
diff --git a/graphics/java/android/graphics/drawable/OWNERS b/graphics/java/android/graphics/drawable/OWNERS
new file mode 100644
index 0000000..6196889
--- /dev/null
+++ b/graphics/java/android/graphics/drawable/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 24939
+
+romainguy@google.com
+jreck@google.com
+njawad@google.com
+sumir@google.com
diff --git a/graphics/java/android/graphics/drawable/shapes/OWNERS b/graphics/java/android/graphics/drawable/shapes/OWNERS
new file mode 100644
index 0000000..6196889
--- /dev/null
+++ b/graphics/java/android/graphics/drawable/shapes/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 24939
+
+romainguy@google.com
+jreck@google.com
+njawad@google.com
+sumir@google.com
diff --git a/graphics/java/android/graphics/fonts/OWNERS b/graphics/java/android/graphics/fonts/OWNERS
new file mode 100644
index 0000000..e0a354e
--- /dev/null
+++ b/graphics/java/android/graphics/fonts/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 24939
+
+romainguy@google.com
+nona@google.com
+siyamed@google.com
diff --git a/graphics/java/android/graphics/pdf/OWNERS b/graphics/java/android/graphics/pdf/OWNERS
new file mode 100644
index 0000000..f04e200
--- /dev/null
+++ b/graphics/java/android/graphics/pdf/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 24939
+
+romainguy@google.com
+djsollen@google.com
+sumir@google.com
+svetoslavganov@android.com
+svetoslavganov@google.com
+moltmann@google.com
diff --git a/graphics/java/android/graphics/text/OWNERS b/graphics/java/android/graphics/text/OWNERS
new file mode 100644
index 0000000..e0a354e
--- /dev/null
+++ b/graphics/java/android/graphics/text/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 24939
+
+romainguy@google.com
+nona@google.com
+siyamed@google.com
diff --git a/keystore/java/android/security/IKeyChainService.aidl b/keystore/java/android/security/IKeyChainService.aidl
index add52fa..a9d4094 100644
--- a/keystore/java/android/security/IKeyChainService.aidl
+++ b/keystore/java/android/security/IKeyChainService.aidl
@@ -49,6 +49,7 @@
in byte[] privateKey, in byte[] userCert, in byte[] certChain, String alias, int uid);
boolean removeKeyPair(String alias);
boolean containsKeyPair(String alias);
+ int[] getGrants(String alias);
// APIs used by Settings
boolean deleteCaCertificate(String alias);
diff --git a/keystore/java/android/security/KeyStoreOperation.java b/keystore/java/android/security/KeyStoreOperation.java
index 49a4887..7ea9e14 100644
--- a/keystore/java/android/security/KeyStoreOperation.java
+++ b/keystore/java/android/security/KeyStoreOperation.java
@@ -17,7 +17,7 @@
package android.security;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/KeyStoreSecurityLevel.java b/keystore/java/android/security/KeyStoreSecurityLevel.java
index 7c3de8b..3ef4aa5 100644
--- a/keystore/java/android/security/KeyStoreSecurityLevel.java
+++ b/keystore/java/android/security/KeyStoreSecurityLevel.java
@@ -18,7 +18,7 @@
import android.annotation.NonNull;
import android.app.compat.CompatChanges;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.security.keystore.BackendBusyException;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
index 69c7a25..0775a1a 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
@@ -17,7 +17,7 @@
package android.security.keystore2;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.ArrayUtils;
import android.security.keystore.KeyProperties;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
index 2b5f6c3..bc56f01 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
@@ -18,7 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
index 18d2692..a3b04ab 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
@@ -19,7 +19,7 @@
import android.annotation.CallSuper;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
index 2250c89..d1ef1df 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
@@ -17,7 +17,7 @@
package android.security.keystore2;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java
index eea45c2..8475ad9 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java
@@ -16,7 +16,7 @@
package android.security.keystore2;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
index 479fd8a..233f352 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
@@ -16,8 +16,8 @@
package android.security.keystore2;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.security.KeyStore2;
import android.security.KeyStoreSecurityLevel;
import android.security.keymaster.KeymasterArguments;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
index 61725e3..df0e146 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
@@ -18,8 +18,8 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.os.Build;
import android.security.KeyPairGeneratorSpec;
import android.security.KeyStore2;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
index 2686ddc..951f918 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
@@ -18,7 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyProperties;
import android.security.keystore.KeymasterUtils;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
index 444dad4..ab75591 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
@@ -17,7 +17,7 @@
package android.security.keystore2;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyProperties;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
index a168f8f..9b4f01e 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
@@ -18,7 +18,7 @@
import android.annotation.CallSuper;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
index 9790a4a..aca5314 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
@@ -18,9 +18,9 @@
import android.annotation.NonNull;
import android.hardware.biometrics.BiometricManager;
-import android.hardware.keymint.HardwareAuthenticatorType;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.HardwareAuthenticatorType;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.security.GateKeeper;
import android.security.KeyStore2;
import android.security.KeyStoreParameter;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
index a2d4528..4d4b0d8 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
@@ -18,7 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.ArrayUtils;
import android.security.keystore.KeyProperties;
diff --git a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
index 8fa532b..18c786a 100644
--- a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
+++ b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
@@ -18,8 +18,8 @@
import android.annotation.NonNull;
import android.hardware.biometrics.BiometricManager;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.security.GateKeeper;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyProperties;
diff --git a/libs/WindowManager/OWNERS b/libs/WindowManager/OWNERS
index 063d459..2c61df9 100644
--- a/libs/WindowManager/OWNERS
+++ b/libs/WindowManager/OWNERS
@@ -1,3 +1,3 @@
set noparent
-include ../../services/core/java/com/android/server/wm/OWNERS
\ No newline at end of file
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/libs/WindowManager/Shell/res/values/config.xml b/libs/WindowManager/Shell/res/values/config.xml
index f0eae97..807e5af 100644
--- a/libs/WindowManager/Shell/res/values/config.xml
+++ b/libs/WindowManager/Shell/res/values/config.xml
@@ -42,16 +42,4 @@
<!-- Bounds [left top right bottom] on screen for picture-in-picture (PIP) windows,
when the PIP menu is shown in center. -->
<string translatable="false" name="pip_menu_bounds">"596 280 1324 690"</string>
-
- <!-- Gravity of letterboxed apps in portrait screen orientation.
- Can be Gravity.TOP, Gravity.CENTER or Gravity.BOTTOM.
- Any other value will result in runtime exception for a letterboxed activity.
- Default is Gravity.TOP. -->
- <integer name="config_letterboxPortraitGravity">0x00000030</integer>
-
- <!-- Gravity of letterboxed apps in landscape screen orientation.
- Can be Gravity.LEFT, Gravity.CENTER or Gravity.RIGHT.
- Any other value will result in runtime exception for a letterboxed activity.
- Default is Gravity.CENTER. -->
- <integer name="config_letterboxLandscapeGravity">0x00000011</integer>
</resources>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java
index 4f13b83..63d3118 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java
@@ -20,8 +20,9 @@
import static com.android.wm.shell.ShellTaskOrganizer.taskListenerTypeToString;
import android.app.ActivityManager;
-import android.util.ArraySet;
+import android.graphics.Point;
import android.util.Slog;
+import android.util.SparseArray;
import android.view.SurfaceControl;
import androidx.annotation.NonNull;
@@ -40,7 +41,7 @@
private final SyncTransactionQueue mSyncQueue;
- private final ArraySet<Integer> mTasks = new ArraySet<>();
+ private final SparseArray<SurfaceControl> mLeashByTaskId = new SparseArray<>();
public FullscreenTaskListener(SyncTransactionQueue syncQueue) {
mSyncQueue = syncQueue;
@@ -48,39 +49,44 @@
@Override
public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
- synchronized (mTasks) {
- if (mTasks.contains(taskInfo.taskId)) {
- throw new RuntimeException("Task appeared more than once: #" + taskInfo.taskId);
- }
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Appeared: #%d",
- taskInfo.taskId);
- mTasks.add(taskInfo.taskId);
- mSyncQueue.runInSync(t -> {
- // Reset several properties back to fullscreen (PiP, for example, leaves all these
- // properties in a bad state).
- t.setWindowCrop(leash, null);
- t.setPosition(leash, 0, 0);
- // TODO(shell-transitions): Eventually set everything in transition so there's no
- // SF Transaction here.
- if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
- t.setAlpha(leash, 1f);
- t.setMatrix(leash, 1, 0, 0, 1);
- t.show(leash);
- }
- });
+ if (mLeashByTaskId.get(taskInfo.taskId) != null) {
+ throw new IllegalStateException("Task appeared more than once: #" + taskInfo.taskId);
}
+ ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Appeared: #%d",
+ taskInfo.taskId);
+ mLeashByTaskId.put(taskInfo.taskId, leash);
+ final Point positionInParent = taskInfo.positionInParent;
+ mSyncQueue.runInSync(t -> {
+ // Reset several properties back to fullscreen (PiP, for example, leaves all these
+ // properties in a bad state).
+ t.setWindowCrop(leash, null);
+ t.setPosition(leash, positionInParent.x, positionInParent.y);
+ // TODO(shell-transitions): Eventually set everything in transition so there's no
+ // SF Transaction here.
+ if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
+ t.setAlpha(leash, 1f);
+ t.setMatrix(leash, 1, 0, 0, 1);
+ t.show(leash);
+ }
+ });
+ }
+
+ @Override
+ public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) {
+ final SurfaceControl leash = mLeashByTaskId.get(taskInfo.taskId);
+ final Point positionInParent = taskInfo.positionInParent;
+ mSyncQueue.runInSync(t -> t.setPosition(leash, positionInParent.x, positionInParent.y));
}
@Override
public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
- synchronized (mTasks) {
- if (!mTasks.remove(taskInfo.taskId)) {
- Slog.e(TAG, "Task already vanished: #" + taskInfo.taskId);
- return;
- }
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Vanished: #%d",
- taskInfo.taskId);
+ if (mLeashByTaskId.get(taskInfo.taskId) == null) {
+ Slog.e(TAG, "Task already vanished: #" + taskInfo.taskId);
+ return;
}
+ mLeashByTaskId.remove(taskInfo.taskId);
+ ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Vanished: #%d",
+ taskInfo.taskId);
}
@Override
@@ -88,7 +94,7 @@
final String innerPrefix = prefix + " ";
final String childPrefix = innerPrefix + " ";
pw.println(prefix + this);
- pw.println(innerPrefix + mTasks.size() + " Tasks");
+ pw.println(innerPrefix + mLeashByTaskId.size() + " Tasks");
}
@Override
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java
index 45948dd..2085042 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java
@@ -16,12 +16,9 @@
package com.android.wm.shell;
-import android.view.Gravity;
-
import com.android.wm.shell.apppairs.AppPairs;
import com.android.wm.shell.common.annotations.ExternalThread;
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
-import com.android.wm.shell.letterbox.LetterboxConfigController;
import com.android.wm.shell.onehanded.OneHanded;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.splitscreen.SplitScreen;
@@ -42,7 +39,6 @@
private final Optional<HideDisplayCutout> mHideDisplayCutout;
private final ShellTaskOrganizer mShellTaskOrganizer;
private final Optional<AppPairs> mAppPairsOptional;
- private final LetterboxConfigController mLetterboxConfigController;
public ShellCommandHandler(
ShellTaskOrganizer shellTaskOrganizer,
@@ -50,15 +46,13 @@
Optional<Pip> pipOptional,
Optional<OneHanded> oneHandedOptional,
Optional<HideDisplayCutout> hideDisplayCutout,
- Optional<AppPairs> appPairsOptional,
- LetterboxConfigController letterboxConfigController) {
+ Optional<AppPairs> appPairsOptional) {
mShellTaskOrganizer = shellTaskOrganizer;
mSplitScreenOptional = splitScreenOptional;
mPipOptional = pipOptional;
mOneHandedOptional = oneHandedOptional;
mHideDisplayCutout = hideDisplayCutout;
mAppPairsOptional = appPairsOptional;
- mLetterboxConfigController = letterboxConfigController;
}
/** Dumps WM Shell internal state. */
@@ -85,14 +79,6 @@
return false;
}
switch (args[1]) {
- case "set-letterbox-portrait-gravity":
- return runSetLetterboxPortraitGravity(args, pw);
- case "get-letterbox-portrait-gravity":
- return runGetLetterboxPortraitGravity(pw);
- case "set-letterbox-landscape-gravity":
- return runSetLetterboxLandscapeGravity(args, pw);
- case "get-letterbox-landscape-gravity":
- return runGetLetterboxLandscapeGravity(pw);
case "pair":
return runPair(args, pw);
case "unpair":
@@ -104,92 +90,6 @@
}
}
- private boolean runSetLetterboxPortraitGravity(String[] args, PrintWriter pw) {
- if (args.length < 3) {
- // First two arguments are "WMShell" and command name.
- pw.println("Error: reset, TOP, CENTER or BOTTOM should be provided as an argument");
- return true;
- }
- switch (args[2]) {
- case "reset":
- mLetterboxConfigController.resetPortraitGravity();
- break;
- case "TOP":
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- break;
- case "CENTER":
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- break;
- case "BOTTOM":
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- break;
- default:
- pw.println("Error: expected reset, TOP, CENTER or BOTTOM but got " + args[2]);
- }
- return true;
- }
-
- private boolean runGetLetterboxPortraitGravity(PrintWriter pw) {
- final int gravity = mLetterboxConfigController.getPortraitGravity();
- switch (gravity) {
- case Gravity.TOP:
- pw.println("TOP");
- break;
- case Gravity.CENTER:
- pw.println("CENTER");
- break;
- case Gravity.BOTTOM:
- pw.println("BOTTOM");
- break;
- default:
- throw new AssertionError("Unexpected gravity: " + gravity);
- }
- return true;
- }
-
- private boolean runSetLetterboxLandscapeGravity(String[] args, PrintWriter pw) {
- if (args.length < 3) {
- // First two arguments are "WMShell" and command name.
- pw.println("Error: reset, LEFT, CENTER or RIGHT should be provided as an argument");
- return false;
- }
- switch (args[2]) {
- case "reset":
- mLetterboxConfigController.resetLandscapeGravity();
- break;
- case "LEFT":
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- break;
- case "CENTER":
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- break;
- case "RIGHT":
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- break;
- default:
- pw.println(
- "Error: expected reset, LEFT, CENTER or RIGHT but got " + args[2]);
- }
- return true;
- }
-
- private boolean runGetLetterboxLandscapeGravity(PrintWriter pw) {
- final int gravity = mLetterboxConfigController.getLandscapeGravity();
- switch (gravity) {
- case Gravity.LEFT:
- pw.println("LEFT");
- break;
- case Gravity.CENTER:
- pw.println("CENTER");
- break;
- case Gravity.RIGHT:
- pw.println("RIGHT");
- break;
- default:
- throw new AssertionError("Unexpected gravity: " + gravity);
- }
- return true;
- }
private boolean runPair(String[] args, PrintWriter pw) {
if (args.length < 4) {
@@ -220,12 +120,6 @@
pw.println(" Print this help text.");
pw.println(" <no arguments provided>");
pw.println(" Dump Window Manager Shell internal state");
- pw.println(" set-letterbox-portrait-gravity [reset|TOP|CENTER|BOTTOM]");
- pw.println(" get-letterbox-portrait-gravity");
- pw.println(" Set, reset or print letterbox gravity for portrait screen mode.");
- pw.println(" set-letterbox-landscape-gravity [reset|LEFT|CENTER|RIGHT]");
- pw.println(" get-letterbox-landscape-gravity");
- pw.println(" Set, reset or print letterbox gravity for landscape screen mode.");
pw.println(" pair <taskId1> <taskId2>");
pw.println(" unpair <taskId>");
pw.println(" Pairs/unpairs tasks with given ids.");
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java
index 94555de..f895603 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java
@@ -17,13 +17,11 @@
package com.android.wm.shell;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCREEN;
-import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_LETTERBOX;
import com.android.wm.shell.apppairs.AppPairs;
import com.android.wm.shell.common.DisplayImeController;
import com.android.wm.shell.common.annotations.ExternalThread;
import com.android.wm.shell.draganddrop.DragAndDropController;
-import com.android.wm.shell.letterbox.LetterboxTaskListener;
import com.android.wm.shell.splitscreen.SplitScreen;
import java.util.Optional;
@@ -38,23 +36,23 @@
private final ShellTaskOrganizer mShellTaskOrganizer;
private final Optional<SplitScreen> mSplitScreenOptional;
private final Optional<AppPairs> mAppPairsOptional;
- private final LetterboxTaskListener mLetterboxTaskListener;
private final FullscreenTaskListener mFullscreenTaskListener;
+ private final Transitions mTransitions;
public ShellInit(DisplayImeController displayImeController,
DragAndDropController dragAndDropController,
ShellTaskOrganizer shellTaskOrganizer,
Optional<SplitScreen> splitScreenOptional,
Optional<AppPairs> appPairsOptional,
- LetterboxTaskListener letterboxTaskListener,
- FullscreenTaskListener fullscreenTaskListener) {
+ FullscreenTaskListener fullscreenTaskListener,
+ Transitions transitions) {
mDisplayImeController = displayImeController;
mDragAndDropController = dragAndDropController;
mShellTaskOrganizer = shellTaskOrganizer;
mSplitScreenOptional = splitScreenOptional;
mAppPairsOptional = appPairsOptional;
- mLetterboxTaskListener = letterboxTaskListener;
mFullscreenTaskListener = fullscreenTaskListener;
+ mTransitions = transitions;
}
@ExternalThread
@@ -63,8 +61,6 @@
mDisplayImeController.startMonitorDisplays();
mShellTaskOrganizer.addListenerForType(
- mLetterboxTaskListener, TASK_LISTENER_TYPE_LETTERBOX);
- mShellTaskOrganizer.addListenerForType(
mFullscreenTaskListener, TASK_LISTENER_TYPE_FULLSCREEN);
// Register the shell organizer
mShellTaskOrganizer.registerOrganizer();
@@ -72,5 +68,9 @@
mAppPairsOptional.ifPresent(AppPairs::onOrganizerRegistered);
// Bind the splitscreen impl to the drag drop controller
mDragAndDropController.setSplitScreenController(mSplitScreenOptional);
+
+ if (Transitions.ENABLE_SHELL_TRANSITIONS) {
+ mTransitions.register(mShellTaskOrganizer);
+ }
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
index 174c16a..10cec6d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
@@ -31,23 +31,18 @@
import android.os.IBinder;
import android.util.ArrayMap;
import android.util.Log;
-import android.util.Slog;
import android.util.SparseArray;
import android.view.SurfaceControl;
import android.window.ITaskOrganizerController;
import android.window.TaskAppearedInfo;
import android.window.TaskOrganizer;
-import androidx.annotation.BinderThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.common.ShellExecutor;
-import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.common.TransactionPool;
-import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.startingsurface.StartingSurfaceDrawer;
import java.io.PrintWriter;
@@ -67,14 +62,12 @@
public static final int TASK_LISTENER_TYPE_FULLSCREEN = -2;
public static final int TASK_LISTENER_TYPE_MULTI_WINDOW = -3;
public static final int TASK_LISTENER_TYPE_PIP = -4;
- public static final int TASK_LISTENER_TYPE_LETTERBOX = -5;
@IntDef(prefix = {"TASK_LISTENER_TYPE_"}, value = {
TASK_LISTENER_TYPE_UNDEFINED,
TASK_LISTENER_TYPE_FULLSCREEN,
TASK_LISTENER_TYPE_MULTI_WINDOW,
TASK_LISTENER_TYPE_PIP,
- TASK_LISTENER_TYPE_LETTERBOX,
})
public @interface TaskListenerType {}
@@ -105,24 +98,17 @@
/** @see #setPendingLaunchCookieListener */
private final ArrayMap<IBinder, TaskListener> mLaunchCookieToListener = new ArrayMap<>();
- // TODO(shell-transitions): move to a more "global" Shell location as this isn't only for Tasks
- private final Transitions mTransitions;
-
private final Object mLock = new Object();
private final StartingSurfaceDrawer mStartingSurfaceDrawer;
- public ShellTaskOrganizer(SyncTransactionQueue syncQueue, TransactionPool transactionPool,
- ShellExecutor mainExecutor, ShellExecutor animExecutor, Context context) {
- this(null, syncQueue, transactionPool, mainExecutor, animExecutor, context);
+ public ShellTaskOrganizer(ShellExecutor mainExecutor, Context context) {
+ this(null, mainExecutor, context);
}
@VisibleForTesting
- ShellTaskOrganizer(ITaskOrganizerController taskOrganizerController,
- SyncTransactionQueue syncQueue, TransactionPool transactionPool,
- ShellExecutor mainExecutor, ShellExecutor animExecutor, Context context) {
+ ShellTaskOrganizer(ITaskOrganizerController taskOrganizerController, ShellExecutor mainExecutor,
+ Context context) {
super(taskOrganizerController, mainExecutor);
- mTransitions = new Transitions(this, transactionPool, mainExecutor, animExecutor);
- if (Transitions.ENABLE_SHELL_TRANSITIONS) mTransitions.register(this);
// TODO(b/131727939) temporarily live here, the starting surface drawer should be controlled
// by a controller, that class should be create while porting
// ActivityRecord#addStartingWindow to WMShell.
@@ -275,6 +261,12 @@
synchronized (mLock) {
ProtoLog.v(WM_SHELL_TASK_ORG, "Task info changed taskId=%d", taskInfo.taskId);
final TaskAppearedInfo data = mTasks.get(taskInfo.taskId);
+ if (data == null) {
+ // TODO(b/171749427): It means onTaskInfoChanged send before onTaskAppeared or
+ // after onTaskVanished, it should be fixed in controller side.
+ return;
+ }
+
final TaskListener oldListener = getTaskListener(data.getTaskInfo());
final TaskListener newListener = getTaskListener(taskInfo);
mTasks.put(taskInfo.taskId, new TaskAppearedInfo(taskInfo, data.getLeash()));
@@ -377,9 +369,7 @@
static @TaskListenerType int taskInfoToTaskListenerType(RunningTaskInfo runningTaskInfo) {
switch (runningTaskInfo.getWindowingMode()) {
case WINDOWING_MODE_FULLSCREEN:
- return runningTaskInfo.letterboxActivityBounds != null
- ? TASK_LISTENER_TYPE_LETTERBOX
- : TASK_LISTENER_TYPE_FULLSCREEN;
+ return TASK_LISTENER_TYPE_FULLSCREEN;
case WINDOWING_MODE_MULTI_WINDOW:
return TASK_LISTENER_TYPE_MULTI_WINDOW;
case WINDOWING_MODE_PINNED:
@@ -395,8 +385,6 @@
switch (type) {
case TASK_LISTENER_TYPE_FULLSCREEN:
return "TASK_LISTENER_TYPE_FULLSCREEN";
- case TASK_LISTENER_TYPE_LETTERBOX:
- return "TASK_LISTENER_TYPE_LETTERBOX";
case TASK_LISTENER_TYPE_MULTI_WINDOW:
return "TASK_LISTENER_TYPE_MULTI_WINDOW";
case TASK_LISTENER_TYPE_PIP:
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java
index 59a765d..7440f19 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java
@@ -87,16 +87,12 @@
super(context, null, 0, 0, true /* disableBackgroundLayer */);
mTaskOrganizer = organizer;
+ mExecutor = organizer.getExecutor();
setUseAlpha();
getHolder().addCallback(this);
mGuard.open("release");
}
- // TODO: Use TaskOrganizer executor when part of wmshell proper
- public void setExecutor(Executor executor) {
- mExecutor = executor;
- }
-
/**
* Only one listener may be set on the view, throws an exception otherwise.
*/
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java
index 10195b6..a779531 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java
@@ -16,10 +16,10 @@
package com.android.wm.shell;
-import static android.window.TransitionInfo.TRANSIT_CLOSE;
-import static android.window.TransitionInfo.TRANSIT_HIDE;
-import static android.window.TransitionInfo.TRANSIT_OPEN;
-import static android.window.TransitionInfo.TRANSIT_SHOW;
+import static android.view.WindowManager.TRANSIT_CLOSE;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
import android.animation.Animator;
import android.animation.ValueAnimator;
@@ -40,7 +40,6 @@
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.TransactionPool;
-import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import java.util.ArrayList;
@@ -62,7 +61,7 @@
/** Keeps track of currently tracked transitions and all the animations associated with each */
private final ArrayMap<IBinder, ArrayList<Animator>> mActiveTransitions = new ArrayMap<>();
- Transitions(@NonNull WindowOrganizer organizer, @NonNull TransactionPool pool,
+ public Transitions(@NonNull WindowOrganizer organizer, @NonNull TransactionPool pool,
@NonNull ShellExecutor mainExecutor, @NonNull ShellExecutor animExecutor) {
mOrganizer = organizer;
mTransactionPool = pool;
@@ -119,8 +118,8 @@
}
private static boolean isOpeningType(@WindowManager.TransitionType int type) {
- return type == WindowManager.TRANSIT_OPEN
- || type == WindowManager.TRANSIT_TO_FRONT
+ return type == TRANSIT_OPEN
+ || type == TRANSIT_TO_FRONT
|| type == WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
}
@@ -150,7 +149,7 @@
// Don't animate anything with an animating parent
if (change.getParent() != null) {
- if (mode == TRANSIT_OPEN || mode == TRANSIT_SHOW) {
+ if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
t.show(leash);
t.setMatrix(leash, 1, 0, 0, 1);
}
@@ -161,7 +160,7 @@
t.setPosition(leash, change.getEndAbsBounds().left - info.getRootOffset().x,
change.getEndAbsBounds().top - info.getRootOffset().y);
// Put all the OPEN/SHOW on top
- if (mode == TRANSIT_OPEN || mode == TRANSIT_SHOW) {
+ if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
t.show(leash);
t.setMatrix(leash, 1, 0, 0, 1);
if (isOpening) {
@@ -174,7 +173,7 @@
t.setLayer(leash, -i);
t.setAlpha(leash, 1.f);
}
- } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_HIDE) {
+ } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) {
if (isOpening) {
// put on bottom and leave visible without fade
t.setLayer(leash, -i);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
index 318a0bd..4bf01f7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
@@ -59,7 +59,6 @@
import com.android.wm.shell.R;
import com.android.wm.shell.TaskView;
import com.android.wm.shell.common.AlphaOptimizedButton;
-import com.android.wm.shell.common.HandlerExecutor;
import com.android.wm.shell.common.TriangleShape;
import java.io.FileDescriptor;
@@ -304,11 +303,6 @@
setLayoutDirection(LAYOUT_DIRECTION_LOCALE);
}
- @Override
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
- mTaskView.setExecutor(new HandlerExecutor(getHandler()));
- }
/**
* Initialize {@link BubbleController} and {@link BubbleStackView} here, this method must need
* to be called after view inflate.
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
index 50d9fe8..e97fe0a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
@@ -112,7 +112,7 @@
}
if (mMoving) {
final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos;
- mSplitLayout.updateDividePosition(position);
+ mSplitLayout.updateDivideBounds(position);
}
break;
case MotionEvent.ACTION_UP:
@@ -131,7 +131,7 @@
final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos;
final DividerSnapAlgorithm.SnapTarget snapTarget =
mSplitLayout.findSnapTarget(position, velocity);
- mSplitLayout.setSnapTarget(snapTarget);
+ mSplitLayout.snapToTarget(position, snapTarget);
break;
}
return true;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
index e11037f..e1a94b0 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
@@ -22,6 +22,9 @@
import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END;
import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -31,6 +34,7 @@
import androidx.annotation.Nullable;
import com.android.internal.policy.DividerSnapAlgorithm;
+import com.android.wm.shell.animation.Interpolators;
/**
* Records and handles layout of splits. Helps to calculate proper bounds when configuration or
@@ -119,14 +123,16 @@
mBounds1.set(mRootBounds);
mBounds2.set(mRootBounds);
if (isLandscape(mRootBounds)) {
+ position += mRootBounds.left;
mDividerBounds.left = position - mDividerInsets;
mDividerBounds.right = mDividerBounds.left + mDividerWindowWidth;
- mBounds1.right = mBounds1.left + position;
+ mBounds1.right = position;
mBounds2.left = mBounds1.right + mDividerSize;
} else {
+ position += mRootBounds.top;
mDividerBounds.top = position - mDividerInsets;
mDividerBounds.bottom = mDividerBounds.top + mDividerWindowWidth;
- mBounds1.bottom = mBounds1.top + position;
+ mBounds1.bottom = position;
mBounds2.top = mBounds1.bottom + mDividerSize;
}
}
@@ -145,17 +151,23 @@
* Updates bounds with the passing position. Usually used to update recording bounds while
* performing animation or dragging divider bar to resize the splits.
*/
- public void updateDividePosition(int position) {
+ void updateDivideBounds(int position) {
updateBounds(position);
mLayoutChangeListener.onBoundsChanging(this);
}
+ void setDividePosition(int position) {
+ mDividePosition = position;
+ updateBounds(mDividePosition);
+ mLayoutChangeListener.onBoundsChanged(this);
+ }
+
/**
* Sets new divide position and updates bounds correspondingly. Notifies listener if the new
* target indicates dismissing split.
*/
- public void setSnapTarget(DividerSnapAlgorithm.SnapTarget snapTarget) {
- switch(snapTarget.flag) {
+ public void snapToTarget(int currentPosition, DividerSnapAlgorithm.SnapTarget snapTarget) {
+ switch (snapTarget.flag) {
case FLAG_DISMISS_START:
mLayoutChangeListener.onSnappedToDismiss(false /* snappedToEnd */);
break;
@@ -163,9 +175,7 @@
mLayoutChangeListener.onSnappedToDismiss(true /* snappedToEnd */);
break;
default:
- mDividePosition = snapTarget.position;
- updateBounds(mDividePosition);
- mLayoutChangeListener.onBoundsChanged(this);
+ flingDividePosition(currentPosition, snapTarget.position);
break;
}
}
@@ -189,6 +199,27 @@
isLandscape ? DOCKED_LEFT : DOCKED_TOP /* dockSide */);
}
+ private void flingDividePosition(int from, int to) {
+ ValueAnimator animator = ValueAnimator
+ .ofInt(from, to)
+ .setDuration(250);
+ animator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
+ animator.addUpdateListener(
+ animation -> updateDivideBounds((int) animation.getAnimatedValue()));
+ animator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ setDividePosition(to);
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ setDividePosition(to);
+ }
+ });
+ animator.start();
+ }
+
private static boolean isLandscape(Rect bounds) {
return bounds.width() > bounds.height();
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java
index 625c0a7..a89c8bb 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropController.java
@@ -54,7 +54,6 @@
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.splitscreen.SplitScreen;
-import java.util.Objects;
import java.util.Optional;
/**
@@ -108,16 +107,22 @@
DragLayout dragLayout = new DragLayout(context, mSplitScreen);
rootView.addView(dragLayout,
new FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
- wm.addView(rootView, layoutParams);
-
- mDisplayDropTargets.put(displayId,
- new PerDisplay(displayId, context, wm, rootView, dragLayout));
+ try {
+ wm.addView(rootView, layoutParams);
+ mDisplayDropTargets.put(displayId,
+ new PerDisplay(displayId, context, wm, rootView, dragLayout));
+ } catch (WindowManager.InvalidDisplayException e) {
+ Slog.w(TAG, "Unable to add view for display id: " + displayId);
+ }
}
@Override
public void onDisplayConfigurationChanged(int displayId, Configuration newConfig) {
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_DRAG_AND_DROP, "Display changed: %d", displayId);
final PerDisplay pd = mDisplayDropTargets.get(displayId);
+ if (pd == null) {
+ return;
+ }
pd.rootView.requestApplyInsets();
}
@@ -125,6 +130,9 @@
public void onDisplayRemoved(int displayId) {
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_DRAG_AND_DROP, "Display removed: %d", displayId);
final PerDisplay pd = mDisplayDropTargets.get(displayId);
+ if (pd == null) {
+ return;
+ }
pd.wm.removeViewImmediate(pd.rootView);
mDisplayDropTargets.remove(displayId);
}
@@ -139,6 +147,10 @@
final PerDisplay pd = mDisplayDropTargets.get(displayId);
final ClipDescription description = event.getClipDescription();
+ if (pd == null) {
+ return false;
+ }
+
if (event.getAction() == ACTION_DRAG_STARTED) {
final boolean hasValidClipData = event.getClipData().getItemCount() > 0
&& (description.hasMimeType(MIMETYPE_APPLICATION_ACTIVITY)
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxConfigController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxConfigController.java
deleted file mode 100644
index 0a549c6..0000000
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxConfigController.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2020 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.wm.shell.letterbox;
-
-import android.content.Context;
-import android.view.Gravity;
-
-import com.android.wm.shell.R;
-
-/**
- * Controls access to and overrides of resource config values used by {@link
- * LetterboxTaskOrganizer}.
- */
-public final class LetterboxConfigController {
-
- private final Context mContext;
-
- /** {@link Gravity} of letterboxed apps in portrait screen orientation. */
- private int mLetterboxPortraitGravity;
-
- /** {@link Gravity} of letterboxed apps in landscape screen orientation. */
- private int mLetterboxLandscapeGravity;
-
- public LetterboxConfigController(Context context) {
- mContext = context;
- mLetterboxPortraitGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxPortraitGravity);
- mLetterboxLandscapeGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxLandscapeGravity);
- }
-
- /**
- * Overrides {@link Gravity} of letterboxed apps in portrait screen orientation.
- *
- * @throws IllegalArgumentException if gravity isn't equal to {@link Gravity#TOP}, {@link
- * Gravity#CENTER} or {@link Gravity#BOTTOM}.
- */
- public void setPortraitGravity(int gravity) {
- if (gravity != Gravity.TOP && gravity != Gravity.CENTER && gravity != Gravity.BOTTOM) {
- throw new IllegalArgumentException(
- "Expected Gravity#TOP, Gravity#CENTER or Gravity#BOTTOM but got"
- + gravity);
- }
- mLetterboxPortraitGravity = gravity;
- }
-
- /**
- * Resets {@link Gravity} of letterboxed apps in portrait screen orientation to {@link
- * R.integer.config_letterboxPortraitGravity}.
- */
- public void resetPortraitGravity() {
- mLetterboxPortraitGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxPortraitGravity);
- }
-
- /**
- * Gets {@link Gravity} of letterboxed apps in portrait screen orientation.
- */
- public int getPortraitGravity() {
- return mLetterboxPortraitGravity;
- }
-
- /**
- * Overrides {@link Gravity} of letterboxed apps in landscape screen orientation.
- *
- * @throws IllegalArgumentException if gravity isn't equal to {@link Gravity#RIGHT}, {@link
- * Gravity#CENTER} or {@link Gravity#LEFT}.
- */
- public void setLandscapeGravity(int gravity) {
- if (gravity != Gravity.LEFT && gravity != Gravity.CENTER && gravity != Gravity.RIGHT) {
- throw new IllegalArgumentException(
- "Expected Gravity#LEFT, Gravity#CENTER or Gravity#RIGHT but got"
- + gravity);
- }
- mLetterboxLandscapeGravity = gravity;
- }
-
- /**
- * Resets {@link Gravity} of letterboxed apps in landscape screen orientation to {@link
- * R.integer.config_letterboxLandscapeGravity}.
- */
- public void resetLandscapeGravity() {
- mLetterboxLandscapeGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxLandscapeGravity);
- }
-
- /**
- * Gets {@link Gravity} of letterboxed apps in landscape screen orientation.
- */
- public int getLandscapeGravity() {
- return mLetterboxLandscapeGravity;
- }
-
-}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxTaskListener.java
deleted file mode 100644
index 6e87f13..0000000
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxTaskListener.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (C) 2020 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.wm.shell.letterbox;
-
-import android.app.ActivityManager;
-import android.graphics.Insets;
-import android.graphics.Point;
-import android.graphics.Rect;
-import android.util.Slog;
-import android.util.SparseArray;
-import android.view.Gravity;
-import android.view.SurfaceControl;
-import android.view.WindowInsets;
-import android.view.WindowManager;
-
-import com.android.internal.protolog.common.ProtoLog;
-import com.android.wm.shell.ShellTaskOrganizer;
-import com.android.wm.shell.Transitions;
-import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.protolog.ShellProtoLogGroup;
-
-/**
- * Organizes a task in {@link android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN} when
- * it's presented in the letterbox mode either because orientations of a top activity and a device
- * don't match or because a top activity is in a size compat mode.
- */
-public class LetterboxTaskListener implements ShellTaskOrganizer.TaskListener {
- private static final String TAG = "LetterboxTaskListener";
-
- private final SyncTransactionQueue mSyncQueue;
- private final LetterboxConfigController mLetterboxConfigController;
- private final WindowManager mWindowManager;
- private final SparseArray<SurfaceControl> mLeashByTaskId = new SparseArray<>();
-
- public LetterboxTaskListener(
- SyncTransactionQueue syncQueue,
- LetterboxConfigController letterboxConfigController,
- WindowManager windowManager) {
- mSyncQueue = syncQueue;
- mLetterboxConfigController = letterboxConfigController;
- mWindowManager = windowManager;
- }
-
- @Override
- public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
- if (mLeashByTaskId.get(taskInfo.taskId) != null) {
- throw new IllegalStateException("Task appeared more than once: #" + taskInfo.taskId);
- }
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Letterbox Task Appeared: #%d",
- taskInfo.taskId);
- mLeashByTaskId.put(taskInfo.taskId, leash);
- Point positionInParent = new Point();
- Rect crop = new Rect();
- resolveTaskPositionAndCrop(taskInfo, positionInParent, crop);
- mSyncQueue.runInSync(t -> {
- setPositionAndWindowCrop(t, leash, positionInParent, crop);
- if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
- t.setAlpha(leash, 1f);
- t.setMatrix(leash, 1, 0, 0, 1);
- t.show(leash);
- }
- });
- }
-
- @Override
- public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
- if (mLeashByTaskId.get(taskInfo.taskId) == null) {
- Slog.e(TAG, "Task already vanished: #" + taskInfo.taskId);
- return;
- }
- mLeashByTaskId.remove(taskInfo.taskId);
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Letterbox Task Vanished: #%d",
- taskInfo.taskId);
- }
-
- @Override
- public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) {
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Letterbox Task Changed: #%d",
- taskInfo.taskId);
- final SurfaceControl leash = mLeashByTaskId.get(taskInfo.taskId);
- Point positionInParent = new Point();
- Rect crop = new Rect();
- resolveTaskPositionAndCrop(taskInfo, positionInParent, crop);
- mSyncQueue.runInSync(t -> setPositionAndWindowCrop(t, leash, positionInParent, crop));
- }
-
- private static void setPositionAndWindowCrop(
- SurfaceControl.Transaction transaction,
- SurfaceControl leash,
- final Point positionInParent,
- final Rect crop) {
- transaction.setPosition(leash, positionInParent.x, positionInParent.y);
- transaction.setWindowCrop(leash, crop);
- }
-
- // TODO(b/173440321): Correct presentation of letterboxed activities in One-handed mode.
- private void resolveTaskPositionAndCrop(
- ActivityManager.RunningTaskInfo taskInfo,
- Point positionInParent,
- Rect crop) {
- // In screen coordinates
- Rect parentBounds = new Rect(taskInfo.parentBounds);
- // Intersect parent and max bounds. This is required for situations when parent bounds
- // go beyond display bounds, for example, in One-handed mode.
- final Rect maxBounds = taskInfo.getConfiguration().windowConfiguration.getMaxBounds();
- if (!parentBounds.intersect(maxBounds)) {
- Slog.w(TAG, "Task parent and max bounds don't intersect: #" + taskInfo.taskId);
- }
-
- // In screen coordinates
- final Rect taskBounds = taskInfo.getConfiguration().windowConfiguration.getBounds();
- final Rect activityBounds = taskInfo.letterboxActivityBounds;
-
- Insets insets = getInsets();
- Rect displayBoundsWithInsets =
- new Rect(mWindowManager.getMaximumWindowMetrics().getBounds());
- displayBoundsWithInsets.inset(insets);
-
- Rect taskBoundsWithInsets = new Rect(taskBounds);
- taskBoundsWithInsets.intersect(displayBoundsWithInsets);
-
- Rect activityBoundsWithInsets = new Rect(activityBounds);
- activityBoundsWithInsets.intersect(displayBoundsWithInsets);
-
- Rect parentBoundsWithInsets = new Rect(parentBounds);
- parentBoundsWithInsets.intersect(displayBoundsWithInsets);
-
- // Crop need to be in the task coordinates.
- crop.set(activityBoundsWithInsets);
- crop.offset(-taskBounds.left, -taskBounds.top);
-
- // Account for insets since coordinates calculations below are done with them.
- positionInParent.x = parentBoundsWithInsets.left - parentBounds.left
- - (taskBoundsWithInsets.left - taskBounds.left);
- positionInParent.y = parentBoundsWithInsets.top - parentBounds.top
- - (taskBoundsWithInsets.top - taskBounds.top);
-
- // Calculating a position of task bounds (without insets) in parent coordinates (without
- // insets) to align activity bounds (without insets) as requested in config. Activity
- // accounts for insets that overlap with its bounds (this overlap can be partial) so
- // ignoring overlap with insets when computing the position. Also, cropping unwanted insets
- // while keeping the top one if the activity is aligned at the top of the window to show
- // status bar decor view.
- if (parentBounds.height() >= parentBounds.width()) {
- final int gravity = mLetterboxConfigController.getPortraitGravity();
- // Center activity horizontally.
- positionInParent.x +=
- (parentBoundsWithInsets.width() - activityBoundsWithInsets.width()) / 2
- + taskBoundsWithInsets.left - activityBoundsWithInsets.left;
- switch (gravity) {
- case Gravity.TOP:
- positionInParent.y += taskBoundsWithInsets.top - activityBoundsWithInsets.top;
- // Showing status bar decor view.
- crop.top -= activityBoundsWithInsets.top - activityBounds.top;
- break;
- case Gravity.CENTER:
- positionInParent.y +=
- taskBoundsWithInsets.top - activityBoundsWithInsets.top
- + (parentBoundsWithInsets.height()
- - activityBoundsWithInsets.height()) / 2;
- break;
- case Gravity.BOTTOM:
- positionInParent.y +=
- parentBoundsWithInsets.height() - activityBoundsWithInsets.bottom
- + taskBoundsWithInsets.top;
- break;
- default:
- throw new AssertionError(
- "Unexpected portrait gravity " + gravity
- + " for task: #" + taskInfo.taskId);
- }
- } else {
- final int gravity = mLetterboxConfigController.getLandscapeGravity();
- // Align activity to the top.
- positionInParent.y += taskBoundsWithInsets.top - activityBoundsWithInsets.top;
- // Showing status bar decor view.
- crop.top -= activityBoundsWithInsets.top - activityBounds.top;
- switch (gravity) {
- case Gravity.LEFT:
- positionInParent.x += taskBoundsWithInsets.left - activityBoundsWithInsets.left;
- break;
- case Gravity.CENTER:
- positionInParent.x +=
- (parentBoundsWithInsets.width() - activityBoundsWithInsets.width()) / 2
- + taskBoundsWithInsets.left - activityBoundsWithInsets.left;
- break;
- case Gravity.RIGHT:
- positionInParent.x +=
- parentBoundsWithInsets.width()
- - activityBoundsWithInsets.right + taskBoundsWithInsets.left;
- break;
- default:
- throw new AssertionError(
- "Unexpected landscape gravity " + gravity
- + " for task: #" + taskInfo.taskId);
- }
- }
- }
-
- private Insets getInsets() {
- return mWindowManager
- .getMaximumWindowMetrics()
- .getWindowInsets()
- .getInsets(
- WindowInsets.Type.navigationBars()
- | WindowInsets.Type.statusBars()
- | WindowInsets.Type.displayCutout());
- }
-
-}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java
index 3b1e6cb..951a688 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java
@@ -75,6 +75,7 @@
@Nullable
OneHandedGestureEventCallback mGestureEventCallback;
private Rect mGestureRegion = new Rect();
+ private boolean mIsStopGesture;
/**
* Constructor of OneHandedGestureHandler, we only handle the gesture of
@@ -153,20 +154,20 @@
float distance = (float) Math.hypot(mLastPos.x - mDownPos.x,
mLastPos.y - mDownPos.y);
if (distance > mDragDistThreshold) {
- mGestureEventCallback.onStop();
+ mIsStopGesture = true;
}
}
break;
case MotionEvent.ACTION_UP:
if (mLastPos.y >= mDownPos.y && mPassedSlop) {
mGestureEventCallback.onStart();
+ } else if (mIsStopGesture) {
+ mGestureEventCallback.onStop();
}
- mPassedSlop = false;
- mAllowGesture = false;
+ clearState();
break;
case MotionEvent.ACTION_CANCEL:
- mPassedSlop = false;
- mAllowGesture = false;
+ clearState();
break;
default:
break;
@@ -174,6 +175,11 @@
}
}
+ private void clearState() {
+ mPassedSlop = false;
+ mIsStopGesture = false;
+ }
+
private void disposeInputChannel() {
if (mInputEventReceiver != null) {
mInputEventReceiver.dispose();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
index d65ad62..a944e3b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
@@ -63,6 +63,16 @@
private String mStartOneHandedDescription;
private String mStopOneHandedDescription;
+ private enum ONE_HANDED_TRIGGER_STATE {
+ UNSET, ENTERING, EXITING
+ }
+ /**
+ * Current One-Handed trigger state.
+ * Note: This is a dynamic state, whenever last state has been confirmed
+ * (i.e. onStartFinished() or onStopFinished()), the state should be set "UNSET" at final.
+ */
+ private ONE_HANDED_TRIGGER_STATE mTriggerState = ONE_HANDED_TRIGGER_STATE.UNSET;
+
/**
* Container of the tutorial panel showing at outside region when one handed starting
*/
@@ -74,6 +84,21 @@
public void onTutorialAnimationUpdate(int offset) {
mUpdateHandler.post(() -> onAnimationUpdate(offset));
}
+
+ @Override
+ public void onOneHandedAnimationStart(
+ OneHandedAnimationController.OneHandedTransitionAnimator animator) {
+ mUpdateHandler.post(() -> {
+ final Rect startValue = (Rect) animator.getStartValue();
+ if (mTriggerState == ONE_HANDED_TRIGGER_STATE.UNSET) {
+ mTriggerState = (startValue.top == 0)
+ ? ONE_HANDED_TRIGGER_STATE.ENTERING : ONE_HANDED_TRIGGER_STATE.EXITING;
+ if (mCanShowTutorial && mTriggerState == ONE_HANDED_TRIGGER_STATE.ENTERING) {
+ createTutorialTarget();
+ }
+ }
+ });
+ }
};
public OneHandedTutorialHandler(Context context) {
@@ -100,9 +125,6 @@
R.string.accessibility_action_start_one_handed);
mStopOneHandedDescription = context.getResources().getString(
R.string.accessibility_action_stop_one_handed);
- if (mCanShowTutorial) {
- createOrUpdateTutorialTarget();
- }
}
@Override
@@ -111,6 +133,7 @@
updateFinished(View.VISIBLE, 0f);
updateTutorialCount();
announcementForScreenReader(true);
+ mTriggerState = ONE_HANDED_TRIGGER_STATE.UNSET;
});
}
@@ -119,6 +142,8 @@
mUpdateHandler.post(() -> {
updateFinished(View.INVISIBLE, -mTargetViewContainer.getHeight());
announcementForScreenReader(false);
+ removeTutorialFromWindowManager();
+ mTriggerState = ONE_HANDED_TRIGGER_STATE.UNSET;
});
}
@@ -126,7 +151,6 @@
if (!canShowTutorial()) {
return;
}
-
mTargetViewContainer.setVisibility(visible);
mTargetViewContainer.setTranslationY(finalPosition);
}
@@ -155,24 +179,23 @@
* Adds the tutorial target view to the WindowManager and update its layout, so it's ready
* to be animated in.
*/
- private void createOrUpdateTutorialTarget() {
- mUpdateHandler.post(() -> {
- if (!mTargetViewContainer.isAttachedToWindow()) {
- mTargetViewContainer.setVisibility(View.INVISIBLE);
-
- try {
- mWindowManager.addView(mTargetViewContainer, getTutorialTargetLayoutParams());
- } catch (IllegalStateException e) {
- // This shouldn't happen, but if the target is already added, just update its
- // layout params.
- mWindowManager.updateViewLayout(
- mTargetViewContainer, getTutorialTargetLayoutParams());
- }
- } else {
- mWindowManager.updateViewLayout(mTargetViewContainer,
- getTutorialTargetLayoutParams());
+ private void createTutorialTarget() {
+ if (!mTargetViewContainer.isAttachedToWindow()) {
+ try {
+ mWindowManager.addView(mTargetViewContainer, getTutorialTargetLayoutParams());
+ } catch (IllegalStateException e) {
+ // This shouldn't happen, but if the target is already added, just update its
+ // layout params.
+ mWindowManager.updateViewLayout(
+ mTargetViewContainer, getTutorialTargetLayoutParams());
}
- });
+ }
+ }
+
+ private void removeTutorialFromWindowManager() {
+ if (mTargetViewContainer.isAttachedToWindow()) {
+ mWindowManager.removeViewImmediate(mTargetViewContainer);
+ }
}
OneHandedAnimationCallback getAnimationCallback() {
@@ -193,7 +216,6 @@
lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
lp.setFitInsetsTypes(0 /* types */);
lp.setTitle("one-handed-tutorial-overlay");
-
return lp;
}
@@ -206,10 +228,12 @@
private boolean canShowTutorial() {
if (!mCanShowTutorial) {
+ // Since canSHowTutorial() will be called in onAnimationUpdate() and we still need to
+ // hide Tutorial text in the period of continuously onAnimationUpdate() API call,
+ // so we have to hide mTargetViewContainer here.
mTargetViewContainer.setVisibility(View.GONE);
return false;
}
-
return true;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java
index 5593268..d59aec2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PinnedStackListenerForwarder.java
@@ -20,7 +20,6 @@
import android.content.ComponentName;
import android.content.pm.ParceledListSlice;
import android.os.RemoteException;
-import android.view.DisplayInfo;
import android.view.IPinnedStackListener;
import android.view.WindowManagerGlobal;
@@ -85,18 +84,6 @@
}
}
- private void onDisplayInfoChanged(DisplayInfo displayInfo) {
- for (PinnedStackListener listener : mListeners) {
- listener.onDisplayInfoChanged(displayInfo);
- }
- }
-
- private void onConfigurationChanged() {
- for (PinnedStackListener listener : mListeners) {
- listener.onConfigurationChanged();
- }
- }
-
private void onAspectRatioChanged(float aspectRatio) {
for (PinnedStackListener listener : mListeners) {
listener.onAspectRatioChanged(aspectRatio);
@@ -134,20 +121,6 @@
}
@Override
- public void onDisplayInfoChanged(DisplayInfo displayInfo) {
- mShellMainExecutor.execute(() -> {
- PinnedStackListenerForwarder.this.onDisplayInfoChanged(displayInfo);
- });
- }
-
- @Override
- public void onConfigurationChanged() {
- mShellMainExecutor.execute(() -> {
- PinnedStackListenerForwarder.this.onConfigurationChanged();
- });
- }
-
- @Override
public void onAspectRatioChanged(float aspectRatio) {
mShellMainExecutor.execute(() -> {
PinnedStackListenerForwarder.this.onAspectRatioChanged(aspectRatio);
@@ -168,10 +141,6 @@
public void onActivityHidden(ComponentName componentName) {}
- public void onDisplayInfoChanged(DisplayInfo displayInfo) {}
-
- public void onConfigurationChanged() {}
-
public void onAspectRatioChanged(float aspectRatio) {}
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/Pip.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/Pip.java
index da9ce0a..1f07542 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/Pip.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/Pip.java
@@ -20,6 +20,7 @@
import android.app.PictureInPictureParams;
import android.content.ComponentName;
import android.content.pm.ActivityInfo;
+import android.content.res.Configuration;
import android.graphics.Rect;
import com.android.wm.shell.common.annotations.ExternalThread;
@@ -82,6 +83,12 @@
}
/**
+ * Called when configuration is changed.
+ */
+ default void onConfigurationChanged(Configuration newConfig) {
+ }
+
+ /**
* Called when display size or font size of settings changed
*/
default void onDensityOrFontScaleChanged() {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
index 1bb5eda..484592e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
@@ -102,9 +102,7 @@
return mSnapAlgorithm;
}
- /**
- * Responds to IPinnedStackListener on configuration change.
- */
+ /** Responds to configuration change. */
public void onConfigurationChanged(Context context) {
reloadResources(context);
}
@@ -125,15 +123,16 @@
/** Returns the destination bounds to place the PIP window on entry. */
public Rect getEntryDestinationBounds() {
final PipBoundsState.PipReentryState reentryState = mPipBoundsState.getReentryState();
- final boolean shouldRestoreReentryBounds = reentryState != null;
- final Rect destinationBounds = shouldRestoreReentryBounds
+ final Rect destinationBounds = reentryState != null
? getDefaultBounds(reentryState.getSnapFraction(), reentryState.getSize())
: getDefaultBounds();
- return transformBoundsToAspectRatioIfValid(destinationBounds,
+ final boolean useCurrentSize = reentryState != null && reentryState.getSize() != null;
+ final Rect r = transformBoundsToAspectRatioIfValid(destinationBounds,
mPipBoundsState.getAspectRatio(), false /* useCurrentMinEdgeSize */,
- shouldRestoreReentryBounds);
+ useCurrentSize);
+ return r;
}
/** Returns the current bounds adjusted to the new aspect ratio, if valid. */
@@ -223,24 +222,36 @@
private Rect getDefaultBounds(float snapFraction, Size size) {
final Rect defaultBounds = new Rect();
if (snapFraction != INVALID_SNAP_FRACTION && size != null) {
+ // The default bounds are the given size positioned at the given snap fraction.
defaultBounds.set(0, 0, size.getWidth(), size.getHeight());
final Rect movementBounds = getMovementBounds(defaultBounds);
mSnapAlgorithm.applySnapFraction(defaultBounds, movementBounds, snapFraction);
+ return defaultBounds;
+ }
+
+ // Calculate the default size.
+ final Size defaultSize;
+ final Rect insetBounds = new Rect();
+ getInsetBounds(insetBounds);
+ final DisplayInfo displayInfo = mPipBoundsState.getDisplayInfo();
+ final Size overrideMinSize = mPipBoundsState.getOverrideMinSize();
+ if (overrideMinSize != null) {
+ // The override minimal size is set, use that as the default size making sure it's
+ // adjusted to the aspect ratio.
+ defaultSize = adjustSizeToAspectRatio(overrideMinSize, mDefaultAspectRatio);
} else {
- final Rect insetBounds = new Rect();
- getInsetBounds(insetBounds);
- final DisplayInfo displayInfo = mPipBoundsState.getDisplayInfo();
- final Size defaultSize;
- final Size overrideMinSize = mPipBoundsState.getOverrideMinSize();
- if (overrideMinSize != null) {
- // The override minimal size is set, use that as the default size making sure it's
- // adjusted to the aspect ratio.
- defaultSize = adjustSizeToAspectRatio(overrideMinSize, mDefaultAspectRatio);
- } else {
- // Calculate the default size using the display size and default min edge size.
- defaultSize = getSizeForAspectRatio(mDefaultAspectRatio,
- mDefaultMinSize, displayInfo.logicalWidth, displayInfo.logicalHeight);
- }
+ // Calculate the default size using the display size and default min edge size.
+ defaultSize = getSizeForAspectRatio(mDefaultAspectRatio,
+ mDefaultMinSize, displayInfo.logicalWidth, displayInfo.logicalHeight);
+ }
+
+ // Now that we have the default size, apply the snap fraction if valid or position the
+ // bounds using the default gravity.
+ if (snapFraction != INVALID_SNAP_FRACTION) {
+ defaultBounds.set(0, 0, defaultSize.getWidth(), defaultSize.getHeight());
+ final Rect movementBounds = getMovementBounds(defaultBounds);
+ mSnapAlgorithm.applySnapFraction(defaultBounds, movementBounds, snapFraction);
+ } else {
Gravity.apply(mDefaultStackGravity, defaultSize.getWidth(), defaultSize.getHeight(),
insetBounds, 0, Math.max(
mPipBoundsState.isImeShowing() ? mPipBoundsState.getImeHeight() : 0,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
index 53aa614..4493d38 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
@@ -76,6 +76,8 @@
private int mImeHeight;
private boolean mIsShelfShowing;
private int mShelfHeight;
+ /** Whether the user has resized the PIP manually. */
+ private boolean mHasUserResizedPip;
private @Nullable Runnable mOnMinimalSizeChangeCallback;
private @Nullable BiConsumer<Boolean, Integer> mOnShelfVisibilityChangeCallback;
@@ -189,8 +191,8 @@
}
/** Save the reentry state to restore to when re-entering PIP mode. */
- public void saveReentryState(@NonNull Rect bounds, float fraction) {
- mPipReentryState = new PipReentryState(new Size(bounds.width(), bounds.height()), fraction);
+ public void saveReentryState(Size size, float fraction) {
+ mPipReentryState = new PipReentryState(size, fraction);
}
/** Returns the saved reentry state. */
@@ -205,6 +207,7 @@
mLastPipComponentName = lastPipComponentName;
if (changed) {
clearReentryState();
+ setHasUserResizedPip(false);
}
}
@@ -329,6 +332,16 @@
return mShelfHeight;
}
+ /** Returns whether the user has resized the PIP. */
+ public boolean hasUserResizedPip() {
+ return mHasUserResizedPip;
+ }
+
+ /** Set whether the user has resized the PIP. */
+ public void setHasUserResizedPip(boolean hasUserResizedPip) {
+ mHasUserResizedPip = hasUserResizedPip;
+ }
+
/**
* Registers a callback when the minimal size of PIP that is set by the app changes.
*/
@@ -397,15 +410,15 @@
static final class PipReentryState {
private static final String TAG = PipReentryState.class.getSimpleName();
- private final @NonNull Size mSize;
+ private final @Nullable Size mSize;
private final float mSnapFraction;
- PipReentryState(@NonNull Size size, float snapFraction) {
+ PipReentryState(@Nullable Size size, float snapFraction) {
mSize = size;
mSnapFraction = snapFraction;
}
- @NonNull
+ @Nullable
Size getSize() {
return mSize;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
index 167b9f9..9081783 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
@@ -502,7 +502,6 @@
mPipMenuController.attach(leash);
-
if (mShouldIgnoreEnteringPipTransition) {
final Rect destinationBounds = mPipBoundsState.getBounds();
// animation is finished in the Launcher and here we directly apply the final touch.
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
index 3234ef6..4d27602 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
@@ -33,12 +33,14 @@
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.ParceledListSlice;
+import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Log;
import android.util.Pair;
+import android.util.Size;
import android.util.Slog;
import android.view.DisplayInfo;
import android.view.WindowManagerGlobal;
@@ -85,7 +87,6 @@
private final DisplayInfo mTmpDisplayInfo = new DisplayInfo();
private final Rect mTmpInsetBounds = new Rect();
- protected final Rect mReentryBounds = new Rect();
private boolean mIsInFixedRotation;
private Consumer<Boolean> mPinnedStackAnimationRecentsCallback;
@@ -104,6 +105,9 @@
// Skip if we aren't in PIP or haven't actually entered PIP yet. We still need to update
// the display layout in the bounds handler in this case.
onDisplayRotationChangedNotInPip(mContext, toRotation);
+ // do not forget to update the movement bounds as well.
+ updateMovementBounds(mPipBoundsState.getNormalBounds(), true /* fromRotation */,
+ false /* fromImeAdjustment */, false /* fromShelfAdjustment */, t);
return;
}
// If there is an animation running (ie. from a shelf offset), then ensure that we calculate
@@ -136,7 +140,7 @@
}
};
- private DisplayController.OnDisplaysChangedListener mFixedRotationListener =
+ private final DisplayController.OnDisplaysChangedListener mFixedRotationListener =
new DisplayController.OnDisplaysChangedListener() {
@Override
public void onFixedRotationStarted(int displayId, int newRotation) {
@@ -188,18 +192,6 @@
}
@Override
- public void onDisplayInfoChanged(DisplayInfo displayInfo) {
- mPipBoundsState.setDisplayInfo(displayInfo);
- }
-
- @Override
- public void onConfigurationChanged() {
- mPipBoundsAlgorithm.onConfigurationChanged(mContext);
- mTouchHandler.onConfigurationChanged();
- mPipBoundsState.onConfigurationChanged();
- }
-
- @Override
public void onAspectRatioChanged(float aspectRatio) {
// TODO(b/169373982): Remove this callback as it is redundant with PipTaskOrg params
// change.
@@ -334,6 +326,15 @@
}
@Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ mMainExecutor.execute(() -> {
+ mPipBoundsAlgorithm.onConfigurationChanged(mContext);
+ mTouchHandler.onConfigurationChanged();
+ mPipBoundsState.onConfigurationChanged();
+ });
+ }
+
+ @Override
public void onDensityOrFontScaleChanged() {
mMainExecutor.execute(() -> {
mPipTaskOrganizer.onDensityOrFontScaleChanged(mContext);
@@ -437,10 +438,8 @@
@Override
public void onPipTransitionStarted(ComponentName activity, int direction, Rect pipBounds) {
if (isOutPipDirection(direction)) {
- // Exiting PIP, save the reentry bounds to restore to when re-entering.
- updateReentryBounds(pipBounds);
- final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mReentryBounds);
- mPipBoundsState.saveReentryState(mReentryBounds, snapFraction);
+ // Exiting PIP, save the reentry state to restore to when re-entering.
+ saveReentryState(pipBounds);
}
// Disable touches while the animation is running
mTouchHandler.setTouchEnabled(false);
@@ -449,14 +448,16 @@
}
}
- /**
- * Update the bounds used to save the re-entry size and snap fraction when exiting PIP.
- */
- public void updateReentryBounds(Rect bounds) {
- final Rect reentryBounds = mTouchHandler.getUserResizeBounds();
- float snapFraction = mPipBoundsAlgorithm.getSnapFraction(bounds);
- mPipBoundsAlgorithm.applySnapFraction(reentryBounds, snapFraction);
- mReentryBounds.set(reentryBounds);
+ /** Save the state to restore to on re-entry. */
+ public void saveReentryState(Rect pipBounds) {
+ float snapFraction = mPipBoundsAlgorithm.getSnapFraction(pipBounds);
+ if (mPipBoundsState.hasUserResizedPip()) {
+ final Rect reentryBounds = mTouchHandler.getUserResizeBounds();
+ final Size reentrySize = new Size(reentryBounds.width(), reentryBounds.height());
+ mPipBoundsState.saveReentryState(reentrySize, snapFraction);
+ } else {
+ mPipBoundsState.saveReentryState(null /* bounds */, snapFraction);
+ }
}
/**
@@ -532,7 +533,7 @@
*
* @return {@code true} if internal {@link DisplayInfo} is rotated, {@code false} otherwise.
*/
- public boolean onDisplayRotationChanged(Context context, Rect outBounds, Rect oldBounds,
+ private boolean onDisplayRotationChanged(Context context, Rect outBounds, Rect oldBounds,
Rect outInsetBounds,
int displayId, int fromRotation, int toRotation, WindowContainerTransaction t) {
// Bail early if the event is not sent to current {@link #mDisplayInfo}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
index 88a1168..02f6231c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
@@ -93,6 +93,7 @@
private int mDelta;
private float mTouchSlop;
+
private boolean mAllowGesture;
private boolean mIsAttached;
private boolean mIsEnabled;
@@ -409,6 +410,7 @@
mPipTaskOrganizer.scheduleUserResizePip(mLastDownBounds, mLastResizeBounds,
null);
+ mPipBoundsState.setHasUserResizedPip(true);
}
}
}
@@ -461,6 +463,7 @@
true /* useCurrentSize */);
mPipTaskOrganizer.scheduleUserResizePip(mLastDownBounds, mLastResizeBounds,
null);
+ mPipBoundsState.setHasUserResizedPip(true);
}
break;
case MotionEvent.ACTION_UP:
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
index 9281f58..33439a4 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
@@ -86,7 +86,7 @@
private boolean mEnableStash = true;
// The reference inset bounds, used to determine the dismiss fraction
- private Rect mInsetBounds = new Rect();
+ private final Rect mInsetBounds = new Rect();
private int mExpandedShortestEdgeSize;
// Used to workaround an issue where the WM rotation happens before we are notified, allowing
@@ -94,7 +94,8 @@
private int mDeferResizeToNormalBoundsUntilRotation = -1;
private int mDisplayRotation;
- private Handler mHandler = new Handler();
+ private final Handler mHandler = new Handler();
+ private final PipAccessibilityInteractionConnection mConnection;
// Behaviour states
private int mMenuState = MENU_STATE_NONE;
@@ -108,7 +109,6 @@
private float mSavedSnapFraction = -1f;
private boolean mSendingHoverAccessibilityEvents;
private boolean mMovementWithinDismiss;
- private PipAccessibilityInteractionConnection mConnection;
// Touch state
private final PipTouchState mTouchState;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java
index 763370b..0955056 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipController.java
@@ -37,7 +37,6 @@
import android.content.pm.ParceledListSlice;
import android.content.res.Configuration;
import android.graphics.Rect;
-import android.os.Debug;
import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -56,8 +55,6 @@
import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipTaskOrganizer;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Objects;
/**
@@ -87,42 +84,21 @@
private static final int TASK_ID_NO_PIP = -1;
private static final int INVALID_RESOURCE_TYPE = -1;
- public static final int SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_MENU_ACTIVITY_FINISH = 0x1;
-
- /**
- * PIPed activity is playing a media and it can be paused.
- */
- static final int PLAYBACK_STATE_PLAYING = 0;
- /**
- * PIPed activity has a paused media and it can be played.
- */
- static final int PLAYBACK_STATE_PAUSED = 1;
- /**
- * Users are unable to control PIPed activity's media playback.
- */
- static final int PLAYBACK_STATE_UNAVAILABLE = 2;
-
- private static final int CLOSE_PIP_WHEN_MEDIA_SESSION_GONE_TIMEOUT_MS = 3000;
-
- private int mSuspendPipResizingReason;
-
private final Context mContext;
private final PipBoundsState mPipBoundsState;
private final PipBoundsAlgorithm mPipBoundsAlgorithm;
private final PipTaskOrganizer mPipTaskOrganizer;
private final PipMediaController mPipMediaController;
private final TvPipMenuController mTvPipMenuController;
+ private final PipNotification mPipNotification;
private IActivityTaskManager mActivityTaskManager;
private int mState = STATE_NO_PIP;
- private int mResumeResizePinnedStackRunnableState = STATE_NO_PIP;
private final Handler mHandler = new Handler();
- private List<Listener> mListeners = new ArrayList<>();
private int mLastOrientation = Configuration.ORIENTATION_UNDEFINED;
private int mPipTaskId = TASK_ID_NO_PIP;
private int mPinnedStackId = INVALID_STACK_ID;
private String[] mLastPackagesResourceGranted;
- private PipNotification mPipNotification;
private ParceledListSlice<RemoteAction> mCustomActions;
private WindowManagerShellWrapper mWindowManagerShellWrapper;
private int mResizeAnimationDuration;
@@ -135,9 +111,7 @@
private boolean mImeVisible;
private int mImeHeightAdjustment;
- private final Runnable mResizePinnedStackRunnable =
- () -> resizePinnedStack(mResumeResizePinnedStackRunnableState);
- private final Runnable mClosePipRunnable = () -> closePip();
+ private final Runnable mClosePipRunnable = this::closePip;
private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -237,8 +211,6 @@
mPipTaskOrganizer.registerPipTransitionCallback(this);
mActivityTaskManager = ActivityTaskManager.getService();
- addListener(mPipNotification);
-
final IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(ACTION_CLOSE);
intentFilter.addAction(ACTION_MENU);
@@ -297,6 +269,7 @@
/**
* Updates the PIP per configuration changed.
*/
+ @Override
public void onConfigurationChanged(Configuration newConfig) {
loadConfigurationsAndApply(newConfig);
mPipNotification.onConfigurationChanged(mContext);
@@ -340,9 +313,8 @@
mPinnedStackId = INVALID_STACK_ID;
}
}
- for (int i = mListeners.size() - 1; i >= 0; --i) {
- mListeners.get(i).onPipActivityClosed();
- }
+ mPipNotification.dismiss();
+ mTvPipMenuController.hideMenu();
mHandler.removeCallbacks(mClosePipRunnable);
}
@@ -353,9 +325,9 @@
if (DEBUG) Log.d(TAG, "movePipToFullscreen(), current state=" + getStateDescription());
mPipTaskId = TASK_ID_NO_PIP;
- for (int i = mListeners.size() - 1; i >= 0; --i) {
- mListeners.get(i).onMoveToFullscreen();
- }
+ mTvPipMenuController.hideMenu();
+ mPipNotification.dismiss();
+
resizePinnedStack(STATE_NO_PIP);
}
@@ -379,9 +351,7 @@
// Set state to STATE_PIP so we show it when the pinned stack animation ends.
mState = STATE_PIP;
mPipMediaController.onActivityPinned();
- for (int i = mListeners.size() - 1; i >= 0; i--) {
- mListeners.get(i).onPipEntered(packageName);
- }
+ mPipNotification.show(packageName);
}
private void onActivityRestartAttempt(ActivityManager.RunningTaskInfo task,
@@ -428,61 +398,17 @@
}
/**
- * Suspends resizing operation on the Pip until {@link #resumePipResizing} is called
- *
- * @param reason The reason for suspending resizing operations on the Pip.
- */
- public void suspendPipResizing(int reason) {
- if (DEBUG) {
- Log.d(TAG,
- "suspendPipResizing() reason=" + reason + " callers=" + Debug.getCallers(2));
- }
- mSuspendPipResizingReason |= reason;
- }
-
- /**
- * Resumes resizing operation on the Pip that was previously suspended.
- *
- * @param reason The reason resizing operations on the Pip was suspended.
- */
- public void resumePipResizing(int reason) {
- if ((mSuspendPipResizingReason & reason) == 0) {
- return;
- }
- if (DEBUG) {
- Log.d(TAG,
- "resumePipResizing() reason=" + reason + " callers=" + Debug.getCallers(2));
- }
- mSuspendPipResizingReason &= ~reason;
- mHandler.post(mResizePinnedStackRunnable);
- }
-
- /**
* Resize the Pip to the appropriate size for the input state.
*
* @param state In Pip state also used to determine the new size for the Pip.
*/
public void resizePinnedStack(int state) {
-
if (DEBUG) {
Log.d(TAG, "resizePinnedStack() state=" + stateToName(state) + ", current state="
+ getStateDescription(), new Exception());
}
-
- boolean wasStateNoPip = (mState == STATE_NO_PIP);
- for (int i = mListeners.size() - 1; i >= 0; --i) {
- mListeners.get(i).onPipResizeAboutToStart();
- }
- if (mSuspendPipResizingReason != 0) {
- mResumeResizePinnedStackRunnableState = state;
- if (DEBUG) {
- Log.d(TAG, "resizePinnedStack() deferring"
- + " mSuspendPipResizingReason=" + mSuspendPipResizingReason
- + " mResumeResizePinnedStackRunnableState="
- + stateToName(mResumeResizePinnedStackRunnableState));
- }
- return;
- }
+ final boolean wasStateNoPip = (mState == STATE_NO_PIP);
+ mTvPipMenuController.hideMenu();
mState = state;
final Rect newBounds;
switch (mState) {
@@ -510,45 +436,20 @@
}
/**
- * @return the current state, or the pending state if the state change was previously suspended.
+ * @return the current state.
*/
private int getState() {
- if (mSuspendPipResizingReason != 0) {
- return mResumeResizePinnedStackRunnableState;
- }
return mState;
}
- /**
- * Shows PIP menu UI by launching {@link PipMenuActivity}. It also locates the pinned
- * stack to the centered PIP bound {@link R.config_centeredPictureInPictureBounds}.
- */
private void showPipMenu() {
if (DEBUG) Log.d(TAG, "showPipMenu(), current state=" + getStateDescription());
mState = STATE_PIP_MENU;
- for (int i = mListeners.size() - 1; i >= 0; --i) {
- mListeners.get(i).onShowPipMenu();
- }
-
mTvPipMenuController.showMenu();
}
/**
- * Adds a {@link Listener} to PipController.
- */
- void addListener(Listener listener) {
- mListeners.add(listener);
- }
-
- /**
- * Removes a {@link Listener} from PipController.
- */
- void removeListener(Listener listener) {
- mListeners.remove(listener);
- }
-
- /**
* Returns {@code true} if PIP is shown.
*/
public boolean isPipShown() {
@@ -619,33 +520,8 @@
}
}
- /**
- * A listener interface to receive notification on changes in PIP.
- */
- public interface Listener {
- /**
- * Invoked when an activity is pinned and PIP manager is set corresponding information.
- * Classes must use this instead of {@link android.app.ITaskStackListener.onActivityPinned}
- * because there's no guarantee for the PIP manager be return relavent information
- * correctly. (e.g. {@link Pip.isPipShown}).
- */
- void onPipEntered(String packageName);
- /** Invoked when a PIPed activity is closed. */
- void onPipActivityClosed();
- /** Invoked when the PIP menu gets shown. */
- void onShowPipMenu();
- /** Invoked when the PIPed activity is about to return back to the fullscreen. */
- void onMoveToFullscreen();
- /** Invoked when we are above to start resizing the Pip. */
- void onPipResizeAboutToStart();
- }
-
private String getStateDescription() {
- if (mSuspendPipResizingReason == 0) {
- return stateToName(mState);
- }
- return stateToName(mResumeResizePinnedStackRunnableState) + " (while " + stateToName(mState)
- + " is suspended)";
+ return stateToName(mState);
}
private static String stateToName(int state) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipMenuView.java
index 689c3ed..83cb7ce 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipMenuView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipMenuView.java
@@ -16,6 +16,9 @@
package com.android.wm.shell.pip.tv;
+import static android.view.KeyEvent.ACTION_UP;
+import static android.view.KeyEvent.KEYCODE_BACK;
+
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.annotation.Nullable;
@@ -36,25 +39,22 @@
/**
* The Menu View that shows controls of the PiP. Always fullscreen.
*/
-public class PipMenuView extends FrameLayout implements PipController.Listener {
+public class PipMenuView extends FrameLayout {
private static final String TAG = "PipMenuView";
private static final boolean DEBUG = PipController.DEBUG;
- private final PipController mPipController;
private final Animator mFadeInAnimation;
private final Animator mFadeOutAnimation;
private final PipControlsViewController mPipControlsViewController;
- private boolean mRestorePipSizeWhenClose;
+ @Nullable
+ private OnBackPressListener mOnBackPressListener;
public PipMenuView(Context context, PipController pipController) {
super(context, null, 0);
- mPipController = pipController;
-
inflate(context, R.layout.tv_pip_menu, this);
mPipControlsViewController = new PipControlsViewController(
- findViewById(R.id.pip_controls), mPipController);
- mRestorePipSizeWhenClose = true;
+ findViewById(R.id.pip_controls), pipController);
mFadeInAnimation = AnimatorInflater.loadAnimator(
mContext, R.anim.tv_pip_menu_fade_in_animation);
mFadeInAnimation.setTarget(mPipControlsViewController.getView());
@@ -63,16 +63,6 @@
mFadeOutAnimation.setTarget(mPipControlsViewController.getView());
}
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- if (event.getKeyCode() == KeyEvent.KEYCODE_BACK
- && event.getAction() == KeyEvent.ACTION_UP) {
- restorePipAndFinish();
- return true;
- }
- return super.dispatchKeyEvent(event);
- }
-
@Nullable
SurfaceControl getWindowSurfaceControl() {
final ViewRootImpl root = getViewRootImpl();
@@ -87,53 +77,39 @@
}
void showMenu() {
- mPipController.addListener(this);
mFadeInAnimation.start();
setAlpha(1.0f);
- try {
- WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */,
- getViewRootImpl().getInputToken(), true /* grantFocus */);
- } catch (Exception e) {
- Log.e(TAG, "Unable to update focus as menu appears", e);
- }
+ grantWindowFocus(true);
}
void hideMenu() {
- mPipController.removeListener(this);
- mPipController.resumePipResizing(
- PipController.SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_MENU_ACTIVITY_FINISH);
mFadeOutAnimation.start();
setAlpha(0.0f);
+ grantWindowFocus(false);
+ }
+
+ private void grantWindowFocus(boolean grantFocus) {
try {
WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */,
- getViewRootImpl().getInputToken(), false /* grantFocus */);
+ getViewRootImpl().getInputToken(), grantFocus);
} catch (Exception e) {
Log.e(TAG, "Unable to update focus as menu disappears", e);
}
}
- private void restorePipAndFinish() {
- if (DEBUG) Log.d(TAG, "restorePipAndFinish()");
+ void setOnBackPressListener(OnBackPressListener onBackPressListener) {
+ mOnBackPressListener = onBackPressListener;
+ }
- if (mRestorePipSizeWhenClose) {
- if (DEBUG) Log.d(TAG, " > restoring to the default position");
-
- // When PIP menu activity is closed, restore to the default position.
- mPipController.resizePinnedStack(PipController.STATE_PIP);
+ @Override
+ public boolean dispatchKeyEvent(KeyEvent event) {
+ if (event.getKeyCode() == KEYCODE_BACK && event.getAction() == ACTION_UP
+ && mOnBackPressListener != null) {
+ mOnBackPressListener.onBackPress();
+ return true;
+ } else {
+ return super.dispatchKeyEvent(event);
}
- hideMenu();
- }
-
- @Override
- public void onPipEntered(String packageName) {
- if (DEBUG) Log.d(TAG, "onPipEntered(), packageName=" + packageName);
- }
-
- @Override
- public void onPipActivityClosed() {
- if (DEBUG) Log.d(TAG, "onPipActivityClosed()");
-
- hideMenu();
}
void setAppActions(ParceledListSlice<RemoteAction> actions) {
@@ -144,27 +120,7 @@
hasCustomActions ? actions.getList() : Collections.emptyList());
}
- @Override
- public void onShowPipMenu() {
- if (DEBUG) Log.d(TAG, "onShowPipMenu()");
- }
-
- @Override
- public void onMoveToFullscreen() {
- if (DEBUG) Log.d(TAG, "onMoveToFullscreen()");
-
- // Moving PIP to fullscreen is implemented by resizing PINNED_STACK with null bounds.
- // This conflicts with restoring PIP position, so disable it.
- mRestorePipSizeWhenClose = false;
- hideMenu();
- }
-
- @Override
- public void onPipResizeAboutToStart() {
- if (DEBUG) Log.d(TAG, "onPipResizeAboutToStart()");
-
- hideMenu();
- mPipController.suspendPipResizing(
- PipController.SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_MENU_ACTIVITY_FINISH);
+ interface OnBackPressListener {
+ void onBackPress();
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipNotification.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipNotification.java
index d56a888..4e0ab66 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipNotification.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/PipNotification.java
@@ -39,7 +39,7 @@
* <p>Once it's created, it will manage the PIP notification UI by itself except for handling
* configuration changes.
*/
-public class PipNotification implements PipController.Listener {
+public class PipNotification {
private static final boolean DEBUG = PipController.DEBUG;
private static final String TAG = "PipNotification";
@@ -79,38 +79,21 @@
onConfigurationChanged(context);
}
- @Override
- public void onPipEntered(String packageName) {
+ void show(String packageName) {
mPackageName = packageName;
- notifyPipNotification();
+ update();
}
- @Override
- public void onPipActivityClosed() {
- dismissPipNotification();
+ void dismiss() {
+ mNotificationManager.cancel(NOTIFICATION_TAG, SystemMessage.NOTE_TV_PIP);
+ mNotified = false;
mPackageName = null;
}
- @Override
- public void onShowPipMenu() {
- // no-op.
- }
-
- @Override
- public void onMoveToFullscreen() {
- dismissPipNotification();
- mPackageName = null;
- }
-
- @Override
- public void onPipResizeAboutToStart() {
- // no-op.
- }
-
private void onMediaMetadataChanged(MediaMetadata metadata) {
if (updateMediaControllerMetadata(metadata) && mNotified) {
// update notification
- notifyPipNotification();
+ update();
}
}
@@ -123,11 +106,11 @@
mDefaultIconResId = R.drawable.pip_icon;
if (mNotified) {
// update notification
- notifyPipNotification();
+ update();
}
}
- private void notifyPipNotification() {
+ private void update() {
mNotified = true;
mNotificationBuilder
.setShowWhen(true)
@@ -144,11 +127,6 @@
mNotificationBuilder.build());
}
- private void dismissPipNotification() {
- mNotified = false;
- mNotificationManager.cancel(NOTIFICATION_TAG, SystemMessage.NOTE_TV_PIP);
- }
-
private boolean updateMediaControllerMetadata(MediaMetadata metadata) {
String title = null;
Bitmap art = null;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuController.java
index 91aef67..5d0d761 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuController.java
@@ -21,6 +21,7 @@
import android.app.RemoteAction;
import android.content.Context;
import android.content.pm.ParceledListSlice;
+import android.util.Log;
import android.view.SurfaceControl;
import com.android.wm.shell.common.SystemWindows;
@@ -31,6 +32,8 @@
* Manages the visibility of the PiP Menu as user interacts with PiP.
*/
public class TvPipMenuController implements PipMenuController {
+ private static final String TAG = "TvPipMenuController";
+ private static final boolean DEBUG = PipController.DEBUG;
private final Context mContext;
private final SystemWindows mSystemWindows;
@@ -52,6 +55,8 @@
@Override
public void showMenu() {
+ if (DEBUG) Log.d(TAG, "showMenu()");
+
if (mMenuView != null) {
mSystemWindows.updateViewLayout(mMenuView, getPipMenuLayoutParams(MENU_WINDOW_TITLE,
mPipBoundsState.getDisplayBounds().width(),
@@ -68,27 +73,62 @@
}
}
- @Override
- public void attach(SurfaceControl leash) {
- if (mMenuView == null) {
- mMenuView = new PipMenuView(mContext, mPipController);
- mSystemWindows.addView(mMenuView,
- getPipMenuLayoutParams(MENU_WINDOW_TITLE, 0 /* width */, 0 /* height */),
- 0, SHELL_ROOT_LAYER_PIP);
- mLeash = leash;
+ void hideMenu() {
+ if (DEBUG) Log.d(TAG, "hideMenu()");
+
+ if (isMenuVisible()) {
+ mMenuView.hideMenu();
+ mPipController.resizePinnedStack(PipController.STATE_PIP);
}
}
@Override
+ public void attach(SurfaceControl leash) {
+ mLeash = leash;
+ attachPipMenuView();
+ }
+
+ @Override
public void detach() {
+ hideMenu();
+ detachPipMenuView();
+ mLeash = null;
+ }
+
+ private void attachPipMenuView() {
+ if (DEBUG) Log.d(TAG, "attachPipMenuView()");
+
+ if (mMenuView != null) {
+ detachPipMenuView();
+ }
+
+ mMenuView = new PipMenuView(mContext, mPipController);
+ mMenuView.setOnBackPressListener(this::hideMenu);
+ mSystemWindows.addView(mMenuView,
+ getPipMenuLayoutParams(MENU_WINDOW_TITLE, 0 /* width */, 0 /* height */),
+ 0, SHELL_ROOT_LAYER_PIP);
+ }
+
+ private void detachPipMenuView() {
+ if (DEBUG) Log.d(TAG, "detachPipMenuView()");
+
+ if (mMenuView == null) {
+ return;
+ }
+
mSystemWindows.removeView(mMenuView);
mMenuView = null;
- mLeash = null;
}
@Override
public void setAppActions(ParceledListSlice<RemoteAction> appActions) {
- mMenuView.setAppActions(appActions);
+ if (DEBUG) Log.d(TAG, "setAppActions(), actions=" + appActions);
+
+ if (mMenuView != null) {
+ mMenuView.setAppActions(appActions);
+ } else {
+ Log.w(TAG, "Cannot set remote actions, there is no View");
+ }
}
@Override
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java
index eb82357..71710af 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java
@@ -26,6 +26,7 @@
import android.graphics.Rect;
import android.os.Handler;
import android.util.Slog;
+import android.view.Choreographer;
import android.view.SurfaceControl;
import android.window.TaskOrganizer;
import android.window.WindowContainerToken;
@@ -338,6 +339,7 @@
SurfaceControl.Transaction t = mTransactionPool.acquire();
float value = (float) animation.getAnimatedValue();
onProgress(value, t);
+ t.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
t.apply();
mTransactionPool.release(t);
});
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java
index c6496ad..ba07166 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java
@@ -37,6 +37,7 @@
import android.os.RemoteException;
import android.util.AttributeSet;
import android.util.Slog;
+import android.view.Choreographer;
import android.view.Display;
import android.view.MotionEvent;
import android.view.PointerIcon;
@@ -1108,6 +1109,7 @@
}
resizeSplitSurfaces(t, mDockedRect, mDockedTaskRect, mOtherRect, mOtherTaskRect);
if (ownTransaction) {
+ t.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
t.apply();
mTiles.releaseTransaction(t);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTaskListener.java
index 5b2b38b..af451ae 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTaskListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTaskListener.java
@@ -205,12 +205,9 @@
private void updateChildTaskSurface(
RunningTaskInfo taskInfo, SurfaceControl leash, boolean firstAppeared) {
- final Rect taskBounds = taskInfo.getConfiguration().windowConfiguration.getBounds();
final Point taskPositionInParent = taskInfo.positionInParent;
- final Rect corp = new Rect(taskBounds);
- corp.offset(-taskBounds.left, -taskBounds.top);
mSyncQueue.runInSync(t -> {
- t.setWindowCrop(leash, corp);
+ t.setWindowCrop(leash, null);
t.setPosition(leash, taskPositionInParent.x, taskPositionInParent.y);
if (firstAppeared && !Transitions.ENABLE_SHELL_TRANSITIONS) {
t.setAlpha(leash, 1f);
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt
index 3ed53fb..c5b54bc 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt
@@ -16,8 +16,10 @@
package com.android.wm.shell.flicker
+import android.graphics.Region
import com.android.server.wm.flicker.dsl.EventLogAssertion
import com.android.server.wm.flicker.dsl.LayersAssertion
+import com.android.server.wm.flicker.helpers.WindowUtils
@JvmOverloads
fun LayersAssertion.appPairsDividerIsVisible(
@@ -25,7 +27,7 @@
enabled: Boolean = bugId == 0
) {
end("appPairsDividerIsVisible", bugId, enabled) {
- this.showsLayer(FlickerTestBase.APP_PAIRS_DIVIDER)
+ this.showsLayer(FlickerTestBase.SPLIT_DIVIDER)
}
}
@@ -35,7 +37,7 @@
enabled: Boolean = bugId == 0
) {
end("appPairsDividerIsInVisible", bugId, enabled) {
- this.hasNotLayer(FlickerTestBase.APP_PAIRS_DIVIDER)
+ this.hasNotLayer(FlickerTestBase.SPLIT_DIVIDER)
}
}
@@ -59,6 +61,50 @@
}
}
+@JvmOverloads
+fun LayersAssertion.dockedStackPrimaryBoundsIsVisible(
+ rotation: Int,
+ primaryLayerName: String,
+ bugId: Int = 0,
+ enabled: Boolean = bugId == 0
+) {
+ end("PrimaryAppBounds", bugId, enabled) {
+ val entry = this.trace.entries.firstOrNull()
+ ?: throw IllegalStateException("Trace is empty")
+ val dividerRegion = entry.getVisibleBounds(FlickerTestBase.DOCKED_STACK_DIVIDER)
+ this.hasVisibleRegion(primaryLayerName, getPrimaryRegion(dividerRegion, rotation))
+ }
+}
+
+@JvmOverloads
+fun LayersAssertion.dockedStackSecondaryBoundsIsVisible(
+ rotation: Int,
+ secondaryLayerName: String,
+ bugId: Int = 0,
+ enabled: Boolean = bugId == 0
+) {
+ end("SecondaryAppBounds", bugId, enabled) {
+ val entry = this.trace.entries.firstOrNull()
+ ?: throw IllegalStateException("Trace is empty")
+ val dividerRegion = entry.getVisibleBounds(FlickerTestBase.DOCKED_STACK_DIVIDER)
+ this.hasVisibleRegion(secondaryLayerName, getSecondaryRegion(dividerRegion, rotation))
+ }
+}
+
+fun getPrimaryRegion(dividerRegion: Region, rotation: Int): Region {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ return Region(0, 0, displayBounds.getBounds().right,
+ dividerRegion.getBounds().bottom - WindowUtils.dockedStackDividerInset)
+}
+
+fun getSecondaryRegion(dividerRegion: Region, rotation: Int): Region {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ return Region(0,
+ dividerRegion.getBounds().bottom - WindowUtils.dockedStackDividerInset,
+ displayBounds.getBounds().right,
+ displayBounds.getBounds().bottom - WindowUtils.navigationBarHeight)
+}
+
fun EventLogAssertion.focusChanges(
vararg windows: String,
bugId: Int = 0,
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt
index 96234fc..5125a39 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt
@@ -37,3 +37,4 @@
// Test App > SplitScreen Activity
const val TEST_APP_SPLITSCREEN_PRIMARY_LABEL = "SplitScreenPrimaryApp"
const val TEST_APP_SPLITSCREEN_SECONDARY_LABEL = "SplitScreenSecondaryApp"
+const val TEST_APP_NONRESIZEABLE_LABEL = "NonResizeableApp"
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/FlickerTestBase.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/FlickerTestBase.kt
index 54b8fdc..7809be0 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/FlickerTestBase.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/FlickerTestBase.kt
@@ -130,7 +130,7 @@
const val NAVIGATION_BAR_WINDOW_TITLE = "NavigationBar"
const val STATUS_BAR_WINDOW_TITLE = "StatusBar"
const val DOCKED_STACK_DIVIDER = "DockedStackDivider"
- const val APP_PAIRS_DIVIDER = "AppPairDivider"
+ const val SPLIT_DIVIDER = "SplitDivider"
const val IMAGE_WALLPAPER = "ImageWallpaper"
}
}
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt
index 7ac91b0..379ec95 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt
@@ -61,10 +61,9 @@
setup {
eachRun {
uiDevice.wakeUpAndGoToHomeScreen()
- primaryApp.open()
- uiDevice.pressHome()
- secondaryApp.open()
- uiDevice.pressHome()
+ primaryApp.launchViaIntent()
+ secondaryApp.launchViaIntent()
+ nonResizeableApp.launchViaIntent()
updateTaskId()
}
}
@@ -90,7 +89,7 @@
@Test
fun testAppPairs_pairPrimaryAndSecondaryApps() {
- val testTag = "testAppPaired_pairPrimaryAndSecondary"
+ val testTag = "testAppPairs_pairPrimaryAndSecondaryApps"
runWithFlicker(appPairsSetup) {
withTestName { testTag }
repeat {
@@ -108,7 +107,7 @@
end("appsEndingBounds", enabled = false) {
val entry = this.trace.entries.firstOrNull()
?: throw IllegalStateException("Trace is empty")
- val dividerRegion = entry.getVisibleBounds(APP_PAIRS_DIVIDER)
+ val dividerRegion = entry.getVisibleBounds(SPLIT_DIVIDER)
this.hasVisibleRegion(primaryApp.defaultWindowName,
appPairsHelper.getPrimaryBounds(dividerRegion))
.and()
@@ -152,7 +151,7 @@
start("appsStartingBounds", enabled = false) {
val entry = this.trace.entries.firstOrNull()
?: throw IllegalStateException("Trace is empty")
- val dividerRegion = entry.getVisibleBounds(APP_PAIRS_DIVIDER)
+ val dividerRegion = entry.getVisibleBounds(SPLIT_DIVIDER)
this.hasVisibleRegion(primaryApp.defaultWindowName,
appPairsHelper.getPrimaryBounds(dividerRegion))
.and()
@@ -176,6 +175,36 @@
}
}
+ @Test
+ fun testAppPairs_canNotPairNonResizeableApps() {
+ val testTag = "testAppPairs_canNotPairNonResizeableApps"
+ runWithFlicker(appPairsSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ nonResizeableApp.launchViaIntent()
+ // TODO pair apps through normal UX flow
+ executeShellCommand(composePairsCommand(
+ primaryTaskId, nonResizeableTaskId, true /* pair */))
+ SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
+ }
+ assertions {
+ layersTrace {
+ appPairsDividerIsInvisible()
+ }
+ windowManagerTrace {
+ end {
+ showsAppWindow(nonResizeableApp.defaultWindowName)
+ .and()
+ .hidesAppWindow(primaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
private fun composePairsCommand(
primaryApp: String,
secondaryApp: String,
@@ -202,6 +231,7 @@
private fun updateTaskId() {
val primaryAppComponent = primaryApp.openAppIntent.component
val secondaryAppComponent = secondaryApp.openAppIntent.component
+ val nonResizeableAppComponent = nonResizeableApp.openAppIntent.component
if (primaryAppComponent != null) {
primaryTaskId = appPairsHelper.getTaskIdForActivity(
primaryAppComponent.packageName, primaryAppComponent.className).toString()
@@ -210,11 +240,17 @@
secondaryTaskId = appPairsHelper.getTaskIdForActivity(
secondaryAppComponent.packageName, secondaryAppComponent.className).toString()
}
+ if (nonResizeableAppComponent != null) {
+ nonResizeableTaskId = appPairsHelper.getTaskIdForActivity(
+ nonResizeableAppComponent.packageName,
+ nonResizeableAppComponent.className).toString()
+ }
}
companion object {
var primaryTaskId = ""
var secondaryTaskId = ""
+ var nonResizeableTaskId = ""
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getParams(): Collection<Array<Any>> {
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt
index f32cd88..4d46f28 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt
@@ -17,6 +17,7 @@
package com.android.wm.shell.flicker.apppairs
import com.android.wm.shell.flicker.NonRotationTestBase
+import com.android.wm.shell.flicker.TEST_APP_NONRESIZEABLE_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_PRIMARY_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_SECONDARY_LABEL
import com.android.wm.shell.flicker.helpers.AppPairsHelper
@@ -36,4 +37,7 @@
protected val secondaryApp = SplitScreenHelper(instrumentation,
TEST_APP_SPLITSCREEN_SECONDARY_LABEL,
Components.SplitScreenSecondaryActivity())
+ protected val nonResizeableApp = SplitScreenHelper(instrumentation,
+ TEST_APP_NONRESIZEABLE_LABEL,
+ Components.NonResizeableActivity())
}
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt
index e67fc97..fb795c7 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt
@@ -17,9 +17,7 @@
package com.android.wm.shell.flicker.helpers
import android.app.Instrumentation
-import android.graphics.Region
import android.os.SystemClock
-import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.wm.shell.flicker.testapp.Components
class SplitScreenHelper(
@@ -43,20 +41,6 @@
SystemClock.sleep(TIMEOUT_MS)
}
- fun getPrimaryBounds(dividerBounds: Region): android.graphics.Region {
- val primaryAppBounds = Region(0, 0, dividerBounds.bounds.right,
- dividerBounds.bounds.bottom + WindowUtils.dockedStackDividerInset)
- return primaryAppBounds
- }
-
- fun getSecondaryBounds(dividerBounds: Region): android.graphics.Region {
- val displayBounds = WindowUtils.displayBounds
- val secondaryAppBounds = Region(0,
- dividerBounds.bounds.bottom - WindowUtils.dockedStackDividerInset,
- displayBounds.right, displayBounds.bottom - WindowUtils.navigationBarHeight)
- return secondaryAppBounds
- }
-
companion object {
const val TEST_REPETITIONS = 1
const val TIMEOUT_MS = 3_000L
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt
index 5570a56..3486761 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt
@@ -21,14 +21,23 @@
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.dsl.runWithFlicker
+import com.android.server.wm.flicker.helpers.WindowUtils
+import com.android.server.wm.flicker.helpers.canSplitScreen
+import com.android.server.wm.flicker.helpers.exitSplitScreen
+import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
+import com.android.server.wm.flicker.helpers.openQuickstep
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
import com.android.wm.shell.flicker.helpers.SplitScreenHelper.Companion.TEST_REPETITIONS
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
+import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
+import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
+import org.junit.Assert
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -56,14 +65,16 @@
setup {
eachRun {
uiDevice.wakeUpAndGoToHomeScreen()
- splitScreenApp.open()
- uiDevice.pressHome()
}
}
teardown {
eachRun {
+ if (uiDevice.isInSplitScreen()) {
+ uiDevice.exitSplitScreen()
+ }
splitScreenApp.exit()
secondaryApp.exit()
+ nonResizeableApp.exit()
}
}
assertions {
@@ -87,18 +98,14 @@
TEST_REPETITIONS
}
transitions {
+ splitScreenApp.launchViaIntent()
uiDevice.launchSplitScreen()
}
assertions {
layersTrace {
dockedStackDividerIsVisible()
- end("appsEndingBounds", enabled = false) {
- val entry = this.trace.entries.firstOrNull()
- ?: throw IllegalStateException("Trace is empty")
- this.hasVisibleRegion(splitScreenApp.defaultWindowName,
- splitScreenApp.getPrimaryBounds(
- entry.getVisibleBounds(DOCKED_STACK_DIVIDER)))
- }
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
}
windowManagerTrace {
end {
@@ -118,27 +125,18 @@
TEST_REPETITIONS
}
transitions {
- secondaryApp.open()
- uiDevice.pressHome()
- splitScreenApp.open()
- uiDevice.pressHome()
+ secondaryApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
uiDevice.launchSplitScreen()
splitScreenApp.reopenAppFromOverview()
}
assertions {
layersTrace {
dockedStackDividerIsVisible()
- end("appsEndingBounds", enabled = false) {
- val entry = this.trace.entries.firstOrNull()
- ?: throw IllegalStateException("Trace is empty")
- this.hasVisibleRegion(splitScreenApp.defaultWindowName,
- splitScreenApp.getPrimaryBounds(
- entry.getVisibleBounds(DOCKED_STACK_DIVIDER)))
- .and()
- .hasVisibleRegion(secondaryApp.defaultWindowName,
- splitScreenApp.getSecondaryBounds(
- entry.getVisibleBounds(DOCKED_STACK_DIVIDER)))
- }
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ dockedStackSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 169271943)
}
windowManagerTrace {
end {
@@ -150,6 +148,98 @@
}
}
+ @Test
+ fun testNonResizeableNotDocked() {
+ val testTag = "testNonResizeableNotDocked"
+ runWithFlicker(splitScreenSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ nonResizeableApp.launchViaIntent()
+ uiDevice.openQuickstep()
+ if (uiDevice.canSplitScreen()) {
+ Assert.fail("Non-resizeable app should not enter split screen")
+ }
+ }
+ assertions {
+ layersTrace {
+ dockedStackDividerIsInvisible()
+ }
+ windowManagerTrace {
+ end {
+ hidesAppWindow(nonResizeableApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testNonResizeableWhenAlreadyInSplitScreenPrimary() {
+ val testTag = "testNonResizeableWhenAlreadyInSplitScreenPrimary"
+ runWithFlicker(splitScreenSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ nonResizeableApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
+ uiDevice.launchSplitScreen()
+ nonResizeableApp.reopenAppFromOverview()
+ }
+ assertions {
+ layersTrace {
+ dockedStackDividerIsInvisible()
+ end("appsEndingBounds", enabled = false) {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ this.hasVisibleRegion(nonResizeableApp.defaultWindowName, displayBounds)
+ }
+ }
+ windowManagerTrace {
+ end {
+ showsAppWindow(nonResizeableApp.defaultWindowName)
+ hidesAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testNonResizeableWhenAlreadyInSplitScreenSecondary() {
+ val testTag = "testNonResizeableWhenAlreadyInSplitScreenSecondary"
+ runWithFlicker(splitScreenSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ splitScreenApp.launchViaIntent()
+ uiDevice.launchSplitScreen()
+ uiDevice.pressBack()
+ nonResizeableApp.launchViaIntent()
+ }
+ assertions {
+ layersTrace {
+ dockedStackDividerIsInvisible()
+ end("appsEndingBounds", enabled = false) {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ this.hasVisibleRegion(nonResizeableApp.defaultWindowName, displayBounds)
+ }
+ }
+ windowManagerTrace {
+ end {
+ showsAppWindow(nonResizeableApp.defaultWindowName)
+ hidesAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateOneLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateOneLaunchedAppTest.kt
new file mode 100644
index 0000000..be8f9bc
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateOneLaunchedAppTest.kt
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2020 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.wm.shell.flicker.splitscreen
+
+import android.view.Surface
+import androidx.test.filters.RequiresDevice
+import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.dsl.runWithFlicker
+import com.android.server.wm.flicker.helpers.exitSplitScreen
+import com.android.server.wm.flicker.helpers.isInSplitScreen
+import com.android.server.wm.flicker.helpers.launchSplitScreen
+import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.navBarLayerRotatesAndScales
+import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
+import com.android.server.wm.flicker.statusBarLayerRotatesScales
+import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
+import com.android.wm.shell.flicker.dockedStackDividerIsVisible
+import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
+import com.android.wm.shell.flicker.helpers.SplitScreenHelper
+import org.junit.FixMethodOrder
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.MethodSorters
+import org.junit.runners.Parameterized
+
+/**
+ * Test open app to split screen.
+ * To run this test: `atest WMShellFlickerTests:RotateOneLaunchedAppTest`
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+class RotateOneLaunchedAppTest(
+ rotationName: String,
+ rotation: Int
+) : SplitScreenTestBase(rotationName, rotation) {
+ private val splitScreenRotationSetup: FlickerBuilder
+ get() = FlickerBuilder(instrumentation).apply {
+ val testSetupRotation = "testSetupRotation"
+ withTestName {
+ testSetupRotation
+ }
+ setup {
+ test {
+ device.wakeUpAndGoToHomeScreen()
+ }
+ }
+ teardown {
+ eachRun {
+ if (uiDevice.isInSplitScreen()) {
+ uiDevice.exitSplitScreen()
+ }
+ setRotation(Surface.ROTATION_0)
+ splitScreenApp.exit()
+ secondaryApp.exit()
+ }
+ }
+ }
+
+ @Test
+ fun testRotateInSplitScreenMode() {
+ val testTag = "testEnterSplitScreen_launchToSide"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ splitScreenApp.launchViaIntent()
+ device.launchSplitScreen()
+ setRotation(rotation)
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testRotateAndEnterSplitScreenMode() {
+ val testTag = "testRotateAndEnterSplitScreenMode"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ splitScreenApp.launchViaIntent()
+ setRotation(rotation)
+ device.launchSplitScreen()
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun getParams(): Collection<Array<Any>> {
+ val supportedRotations = intArrayOf(Surface.ROTATION_90, Surface.ROTATION_270)
+ return supportedRotations.map { arrayOf(Surface.rotationToString(it), it) }
+ }
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateTwoLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateTwoLaunchedAppTest.kt
new file mode 100644
index 0000000..2e05c2a
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateTwoLaunchedAppTest.kt
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2020 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.wm.shell.flicker.splitscreen
+
+import android.view.Surface
+import androidx.test.filters.RequiresDevice
+import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.dsl.runWithFlicker
+import com.android.server.wm.flicker.helpers.exitSplitScreen
+import com.android.server.wm.flicker.helpers.isInSplitScreen
+import com.android.server.wm.flicker.helpers.launchSplitScreen
+import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.navBarLayerRotatesAndScales
+import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
+import com.android.server.wm.flicker.statusBarLayerRotatesScales
+import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
+import com.android.wm.shell.flicker.dockedStackDividerIsVisible
+import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
+import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
+import com.android.wm.shell.flicker.helpers.SplitScreenHelper
+import org.junit.FixMethodOrder
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.MethodSorters
+import org.junit.runners.Parameterized
+
+/**
+ * Test open app to split screen.
+ * To run this test: `atest WMShellFlickerTests:RotateTwoLaunchedAppTest`
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+class RotateTwoLaunchedAppTest(
+ rotationName: String,
+ rotation: Int
+) : SplitScreenTestBase(rotationName, rotation) {
+ private val splitScreenRotationSetup: FlickerBuilder
+ get() = FlickerBuilder(instrumentation).apply {
+ val testSetupRotation = "testSetupRotation"
+ withTestName {
+ testSetupRotation
+ }
+ setup {
+ test {
+ device.wakeUpAndGoToHomeScreen()
+ }
+ }
+ teardown {
+ eachRun {
+ if (uiDevice.isInSplitScreen()) {
+ uiDevice.exitSplitScreen()
+ }
+ setRotation(Surface.ROTATION_0)
+ splitScreenApp.exit()
+ secondaryApp.exit()
+ }
+ }
+ }
+
+ @Test
+ fun testRotateInSplitScreenMode() {
+ val testTag = "testRotateInSplitScreenMode"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ secondaryApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
+ device.launchSplitScreen()
+ splitScreenApp.reopenAppFromOverview()
+ setRotation(rotation)
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ dockedStackSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ .and().showsAppWindow(secondaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testRotateAndEnterSplitScreenMode() {
+ val testTag = "testRotateAndEnterSplitScreenMode"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ secondaryApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
+ setRotation(rotation)
+ device.launchSplitScreen()
+ splitScreenApp.reopenAppFromOverview()
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ dockedStackSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ .and().showsAppWindow(secondaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun getParams(): Collection<Array<Any>> {
+ val supportedRotations = intArrayOf(Surface.ROTATION_90, Surface.ROTATION_270)
+ return supportedRotations.map { arrayOf(Surface.rotationToString(it), it) }
+ }
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateOneLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateOneLaunchedAppTest.kt
deleted file mode 100644
index d2371bd..0000000
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateOneLaunchedAppTest.kt
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2020 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.wm.shell.flicker.splitscreen
-
-import androidx.test.filters.FlakyTest
-import android.view.Surface
-import androidx.test.filters.RequiresDevice
-import androidx.test.platform.app.InstrumentationRegistry
-import com.android.server.wm.flicker.Flicker
-import com.android.server.wm.flicker.FlickerTestRunner
-import com.android.server.wm.flicker.FlickerTestRunnerFactory
-import com.android.server.wm.flicker.helpers.StandardAppHelper
-import com.android.server.wm.flicker.startRotation
-import com.android.server.wm.flicker.endRotation
-import com.android.server.wm.flicker.helpers.buildTestTag
-import com.android.server.wm.flicker.helpers.exitSplitScreen
-import com.android.server.wm.flicker.helpers.isInSplitScreen
-import com.android.server.wm.flicker.helpers.launchSplitScreen
-import com.android.server.wm.flicker.helpers.setRotation
-import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
-import com.android.server.wm.flicker.repetitions
-import org.junit.FixMethodOrder
-import org.junit.runner.RunWith
-import org.junit.runners.MethodSorters
-import org.junit.runners.Parameterized
-
-/**
- * Test open app to split screen.
- * To run this test: `atest WMShellFlickerTests:SplitScreenRotateOneLaunchedAppTest`
- */
-@RequiresDevice
-@RunWith(Parameterized::class)
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-@FlakyTest
-class SplitScreenRotateOneLaunchedAppTest(
- testName: String,
- flickerSpec: Flicker
-) : FlickerTestRunner(testName, flickerSpec) {
- companion object {
- @Parameterized.Parameters(name = "{0}")
- @JvmStatic
- fun getParams(): Collection<Array<Any>> {
- val instrumentation = InstrumentationRegistry.getInstrumentation()
- val testApp = StandardAppHelper(instrumentation,
- "com.android.wm.shell.flicker.testapp", "SimpleApp")
-
- return FlickerTestRunnerFactory(instrumentation, repetitions = 3)
- .buildTest { configuration ->
- withTestName {
- buildTestTag("splitScreenRotateOneApp", testApp, configuration)
- }
- repeat { configuration.repetitions }
- setup {
- test {
- device.wakeUpAndGoToHomeScreen()
- testApp.open()
- device.launchSplitScreen()
- device.waitForIdle()
- }
- eachRun {
- this.setRotation(configuration.startRotation)
- }
- }
- teardown {
- eachRun {
- setRotation(Surface.ROTATION_0)
- }
- test {
- testApp.exit()
- if (device.isInSplitScreen()) {
- device.exitSplitScreen()
- }
- }
- }
- transitions {
- this.setRotation(configuration.endRotation)
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateTwoLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateTwoLaunchedAppTest.kt
deleted file mode 100644
index 6734642..0000000
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateTwoLaunchedAppTest.kt
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2020 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.wm.shell.flicker.splitscreen
-
-import androidx.test.filters.FlakyTest
-import android.view.Surface
-import androidx.test.filters.RequiresDevice
-import androidx.test.platform.app.InstrumentationRegistry
-import com.android.server.wm.flicker.Flicker
-import com.android.server.wm.flicker.FlickerTestRunner
-import com.android.server.wm.flicker.FlickerTestRunnerFactory
-import com.android.server.wm.flicker.helpers.StandardAppHelper
-import com.android.server.wm.flicker.startRotation
-import com.android.server.wm.flicker.endRotation
-import com.android.server.wm.flicker.helpers.buildTestTag
-import com.android.server.wm.flicker.helpers.exitSplitScreen
-import com.android.server.wm.flicker.helpers.reopenAppFromOverview
-import com.android.server.wm.flicker.helpers.isInSplitScreen
-import com.android.server.wm.flicker.helpers.launchSplitScreen
-import com.android.server.wm.flicker.helpers.setRotation
-import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
-import com.android.server.wm.flicker.repetitions
-import org.junit.FixMethodOrder
-import org.junit.runner.RunWith
-import org.junit.runners.MethodSorters
-import org.junit.runners.Parameterized
-
-/**
- * Test open app to split screen.
- * To run this test: `atest WMShellFlickerTests:SplitScreenRotateTwoLaunchedAppTest`
- */
-@RequiresDevice
-@RunWith(Parameterized::class)
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-@FlakyTest
-class SplitScreenRotateTwoLaunchedAppTest(
- testName: String,
- flickerSpec: Flicker
-) : FlickerTestRunner(testName, flickerSpec) {
- companion object {
- @Parameterized.Parameters(name = "{0}")
- @JvmStatic
- fun getParams(): Collection<Array<Any>> {
- val instrumentation = InstrumentationRegistry.getInstrumentation()
- val testApp = StandardAppHelper(instrumentation,
- "com.android.wm.shell.flicker.testapp", "SimpleApp")
- val secondaryApp = StandardAppHelper(instrumentation,
- "com.android.wm.shell.flicker.testapp",
- "SplitScreenSecondaryApp")
-
- return FlickerTestRunnerFactory(instrumentation, repetitions = 3)
- .buildTest { configuration ->
- withTestName {
- buildTestTag("splitScreenRotateTwoApps", testApp, configuration)
- }
- repeat { configuration.repetitions }
- setup {
- test {
- device.wakeUpAndGoToHomeScreen()
- testApp.open()
- device.pressHome()
- secondaryApp.open()
- device.pressHome()
- device.launchSplitScreen()
- device.reopenAppFromOverview()
- device.waitForIdle()
- }
- eachRun {
- this.setRotation(configuration.startRotation)
- }
- }
- teardown {
- eachRun {
- setRotation(Surface.ROTATION_0)
- }
- test {
- testApp.exit()
- secondaryApp.exit()
- if (device.isInSplitScreen()) {
- device.exitSplitScreen()
- }
- }
- }
- transitions {
- this.setRotation(configuration.endRotation)
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt
index a3440df..42c509d 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt
@@ -17,6 +17,7 @@
package com.android.wm.shell.flicker.splitscreen
import com.android.wm.shell.flicker.NonRotationTestBase
+import com.android.wm.shell.flicker.TEST_APP_NONRESIZEABLE_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_PRIMARY_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_SECONDARY_LABEL
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
@@ -32,4 +33,7 @@
protected val secondaryApp = SplitScreenHelper(instrumentation,
TEST_APP_SPLITSCREEN_SECONDARY_LABEL,
Components.SplitScreenSecondaryActivity())
+ protected val nonResizeableApp = SplitScreenHelper(instrumentation,
+ TEST_APP_NONRESIZEABLE_LABEL,
+ Components.NonResizeableActivity())
}
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml
index a583b72..28ed343 100644
--- a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml
@@ -86,6 +86,17 @@
</intent-filter>
</activity>
+ <activity android:name=".NonResizeableActivity"
+ android:resizeableActivity="false"
+ android:taskAffinity="com.android.wm.shell.flicker.testapp.NonResizeableActivity"
+ android:label="NonResizeableApp"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+
<activity android:name=".SimpleActivity"
android:taskAffinity="com.android.wm.shell.flicker.testapp.SimpleActivity"
android:label="SimpleApp"
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/res/layout/activity_non_resizeable.xml b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/res/layout/activity_non_resizeable.xml
new file mode 100644
index 0000000..45d5917
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/res/layout/activity_non_resizeable.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2020 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.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:background="@android:color/holo_orange_light">
+
+ <TextView
+ android:id="@+id/NonResizeableTest"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:gravity="center_vertical|center_horizontal"
+ android:text="NonResizeableActivity"
+ android:textAppearance="?android:attr/textAppearanceLarge"/>
+
+</LinearLayout>
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java
index 8e9b4cb..f729ea5 100644
--- a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java
@@ -38,6 +38,13 @@
}
}
+ public static class NonResizeableActivity extends ComponentsInfo {
+ @Override
+ public String getActivityName() {
+ return NonResizeableActivity.class.getSimpleName();
+ }
+ }
+
public static class PipActivity extends ComponentsInfo {
// Intent action that this activity dynamically registers to enter picture-in-picture
public static final String ACTION_ENTER_PIP = PACKAGE_NAME + ".PipActivity.ENTER_PIP";
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/NonResizeableActivity.java b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/NonResizeableActivity.java
new file mode 100644
index 0000000..24275e0
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/NonResizeableActivity.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2020 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.wm.shell.flicker.testapp;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class NonResizeableActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.activity_non_resizeable);
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
index fdf4d31..862776e 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
@@ -16,18 +16,14 @@
package com.android.wm.shell;
-import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spy;
-import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCREEN;
-import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_LETTERBOX;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_MULTI_WINDOW;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_PIP;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -38,7 +34,6 @@
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.content.pm.ParceledListSlice;
-import android.graphics.Rect;
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;
@@ -47,7 +42,6 @@
import android.window.ITaskOrganizerController;
import android.window.TaskAppearedInfo;
-import androidx.annotation.Nullable;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -108,8 +102,7 @@
doReturn(ParceledListSlice.<TaskAppearedInfo>emptyList())
.when(mTaskOrganizerController).registerTaskOrganizer(any());
} catch (RemoteException e) {}
- mOrganizer = spy(new ShellTaskOrganizer(mTaskOrganizerController, mSyncTransactionQueue,
- mTransactionPool, mTestExecutor, mTestExecutor, mContext));
+ mOrganizer = spy(new ShellTaskOrganizer(mTaskOrganizerController, mTestExecutor, mContext));
}
@Test
@@ -264,28 +257,6 @@
assertTrue(mwListener.appeared.contains(task2));
}
- @Test
- public void testTaskInfoToTaskListenerType_whenLetterboxBoundsPassed_returnsLetterboxType() {
- RunningTaskInfo taskInfo = createTaskInfo(
- /* taskId */ 1,
- WINDOWING_MODE_FULLSCREEN,
- /* letterboxActivityBounds */ new Rect(1, 1, 1, 1));
-
- assertEquals(
- ShellTaskOrganizer.taskInfoToTaskListenerType(taskInfo),
- TASK_LISTENER_TYPE_LETTERBOX);
- }
-
- @Test
- public void testTaskInfoToTaskListenerType_whenLetterboxBoundsIsNull_returnsFullscreenType() {
- RunningTaskInfo taskInfo = createTaskInfo(
- /* taskId */ 1, WINDOWING_MODE_FULLSCREEN, /* letterboxActivityBounds */ null);
-
- assertEquals(
- ShellTaskOrganizer.taskInfoToTaskListenerType(taskInfo),
- TASK_LISTENER_TYPE_FULLSCREEN);
- }
-
private static RunningTaskInfo createTaskInfo(int taskId, int windowingMode) {
RunningTaskInfo taskInfo = new RunningTaskInfo();
taskInfo.taskId = taskId;
@@ -293,12 +264,4 @@
return taskInfo;
}
- private static RunningTaskInfo createTaskInfo(
- int taskId, int windowingMode, @Nullable Rect letterboxActivityBounds) {
- RunningTaskInfo taskInfo = new RunningTaskInfo();
- taskInfo.taskId = taskId;
- taskInfo.configuration.windowConfiguration.setWindowingMode(windowingMode);
- taskInfo.letterboxActivityBounds = Rect.copyOrNull(letterboxActivityBounds);
- return taskInfo;
- }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java
index 34f772f..11bf4ff 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java
@@ -30,6 +30,7 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import android.app.ActivityManager;
import android.app.ActivityOptions;
@@ -96,8 +97,8 @@
return null;
}).when(mExecutor).execute(any());
+ when(mOrganizer.getExecutor()).thenReturn(mExecutor);
mTaskView = new TaskView(mContext, mOrganizer);
- mTaskView.setExecutor(mExecutor);
mTaskView.setListener(mViewListener);
}
@@ -111,7 +112,6 @@
@Test
public void testSetPendingListener_throwsException() {
TaskView taskView = new TaskView(mContext, mOrganizer);
- mTaskView.setExecutor(mExecutor);
taskView.setListener(mViewListener);
try {
taskView.setListener(mViewListener);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
index d87f4c6..9fdd59b 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
@@ -69,24 +69,27 @@
}
@Test
- public void testUpdateDividePosition() {
- mSplitLayout.updateDividePosition(anyInt());
+ public void testUpdateDivideBounds() {
+ mSplitLayout.updateDivideBounds(anyInt());
verify(mLayoutChangeListener).onBoundsChanging(any(SplitLayout.class));
}
@Test
- public void testSetSnapTarget() {
- DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0,
+ @UiThreadTest
+ public void testSnapToTarget() {
+ DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0 /* position */,
DividerSnapAlgorithm.SnapTarget.FLAG_NONE);
- mSplitLayout.setSnapTarget(snapTarget);
- verify(mLayoutChangeListener).onBoundsChanged(any(SplitLayout.class));
+ mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
+ verify(mLayoutChangeListener).onBoundsChanging(any(SplitLayout.class));
// verify it callbacks properly when the snap target indicates dismissing split.
- snapTarget = getSnapTarget(0, DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START);
- mSplitLayout.setSnapTarget(snapTarget);
+ snapTarget = getSnapTarget(0 /* position */,
+ DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START);
+ mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
verify(mLayoutChangeListener).onSnappedToDismiss(eq(false));
- snapTarget = getSnapTarget(0, DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END);
- mSplitLayout.setSnapTarget(snapTarget);
+ snapTarget = getSnapTarget(0 /* position */,
+ DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END);
+ mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
verify(mLayoutChangeListener).onSnappedToDismiss(eq(true));
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxConfigControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxConfigControllerTest.java
deleted file mode 100644
index 2923336..0000000
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxConfigControllerTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2020 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.wm.shell.letterbox;
-
-import static org.junit.Assert.assertEquals;
-
-import android.view.Gravity;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.wm.shell.R;
-import com.android.wm.shell.ShellTestCase;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * Tests for {@link LetterboxConfigController}.
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public final class LetterboxConfigControllerTest extends ShellTestCase {
-
- private LetterboxConfigController mLetterboxConfigController;
-
- @Before
- public void setUp() {
- mLetterboxConfigController = new LetterboxConfigController(getContext());
- }
-
- @Test
- public void testGetPortraitGravity_noOverrides_returnConfigValue() {
- assertEquals(
- mLetterboxConfigController.getPortraitGravity(),
- getContext().getResources().getInteger(R.integer.config_letterboxPortraitGravity));
- }
-
- @Test
- public void testGetLandscapeGravity_noOverrides_returnConfigValue() {
- assertEquals(
- mLetterboxConfigController.getLandscapeGravity(),
- getContext().getResources().getInteger(R.integer.config_letterboxLandscapeGravity));
- }
-
- @Test
- public void testSetPortraitGravity_validValue_savesValue() {
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- assertEquals(mLetterboxConfigController.getPortraitGravity(), Gravity.BOTTOM);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- assertEquals(mLetterboxConfigController.getPortraitGravity(), Gravity.CENTER);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- assertEquals(mLetterboxConfigController.getPortraitGravity(), Gravity.TOP);
- }
-
- @Test
- public void testSetLandscapeGravity_validValue_savesValue() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), Gravity.LEFT);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), Gravity.CENTER);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), Gravity.RIGHT);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSetPortraitGravity_invalidValue_throwsException() {
- mLetterboxConfigController.setPortraitGravity(Gravity.RIGHT);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSetLandscapeGravity_invalidValue_throwsException() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.TOP);
- }
-
- @Test
- public void testResetPortraitGravity() {
- int defaultGravity =
- getContext().getResources().getInteger(R.integer.config_letterboxPortraitGravity);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- mLetterboxConfigController.resetPortraitGravity();
- assertEquals(mLetterboxConfigController.getPortraitGravity(), defaultGravity);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- mLetterboxConfigController.resetPortraitGravity();
- assertEquals(mLetterboxConfigController.getPortraitGravity(), defaultGravity);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- mLetterboxConfigController.resetPortraitGravity();
- assertEquals(mLetterboxConfigController.getPortraitGravity(), defaultGravity);
- }
-
- @Test
- public void testResetLandscapeGravity() {
- int defaultGravity =
- getContext().getResources().getInteger(R.integer.config_letterboxLandscapeGravity);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- mLetterboxConfigController.resetLandscapeGravity();
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), defaultGravity);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- mLetterboxConfigController.resetLandscapeGravity();
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), defaultGravity);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- mLetterboxConfigController.resetLandscapeGravity();
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), defaultGravity);
- }
-
-}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxTaskListenerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxTaskListenerTest.java
deleted file mode 100644
index fc0e20b..0000000
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxTaskListenerTest.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Copyright (C) 2020 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.wm.shell.letterbox;
-
-import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
-
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
-
-import android.app.ActivityManager.RunningTaskInfo;
-import android.graphics.Insets;
-import android.graphics.Rect;
-import android.os.Handler;
-import android.os.Looper;
-import android.view.Gravity;
-import android.view.SurfaceControl;
-import android.view.WindowInsets;
-import android.view.WindowManager;
-import android.view.WindowMetrics;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.wm.shell.ShellTestCase;
-import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.common.TransactionPool;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-/**
- * Tests for {@link LetterboxTaskListener}.
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public final class LetterboxTaskListenerTest extends ShellTestCase {
-
- @Mock private SurfaceControl mLeash;
- @Mock private SurfaceControl.Transaction mTransaction;
- @Mock private WindowManager mWindowManager;
- @Mock private WindowMetrics mWindowMetrics;
- @Mock private WindowInsets mWindowInsets;
- private LetterboxTaskListener mLetterboxTaskListener;
- private LetterboxConfigController mLetterboxConfigController;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
-
- mLetterboxConfigController = new LetterboxConfigController(getContext());
- mLetterboxTaskListener = new LetterboxTaskListener(
- new SyncTransactionQueue(
- new TransactionPool() {
- @Override
- public SurfaceControl.Transaction acquire() {
- return mTransaction;
- }
-
- @Override
- public void release(SurfaceControl.Transaction t) {
- }
- },
- new Handler(Looper.getMainLooper())),
- mLetterboxConfigController,
- mWindowManager);
-
- when(mWindowManager.getMaximumWindowMetrics()).thenReturn(mWindowMetrics);
- when(mWindowMetrics.getWindowInsets()).thenReturn(mWindowInsets);
- }
-
- @Test
- public void testOnTaskInfoChanged_updatesPositionAndCrop() {
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.NONE);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(75, 0, 125, 75),
- /* taskBounds */ new Rect(50, 0, 125, 100)),
- mLeash);
-
- // Task doesn't need to repositioned
- verifySetPosition(50, 0);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(25, 0, 75, 75));
-
- mLetterboxTaskListener.onTaskInfoChanged(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- // Activity is offset by 25 to the left
- /* activityBounds */ new Rect(50, 0, 100, 75),
- /* taskBounds */ new Rect(50, 0, 125, 100)));
-
- // Task needs to be repositioned by 25 to the left
- verifySetPosition(75, 0);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(0, 0, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_landscapeWithLeftGravity() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 10));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(150, 0, 200, 75),
- /* taskBounds */ new Rect(125, 0, 200, 100)),
- mLeash);
-
- verifySetPosition(-15, 0);
- // Should return activity coordinates offset by task coordinates minus unwanted right inset
- verifySetWindowCrop(new Rect(25, 0, 65, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_landscapeWithCenterGravity() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 10));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(150, 0, 200, 75),
- /* taskBounds */ new Rect(125, 0, 200, 100)),
- mLeash);
-
- verifySetPosition(55, 0);
- // Should return activity coordinates offset by task coordinates minus unwanted right inset
- verifySetWindowCrop(new Rect(25, 0, 65, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_landscapeWithRightGravity() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 10));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(50, 0, 100, 75),
- /* taskBounds */ new Rect(25, 0, 100, 100)),
- mLeash);
-
- verifySetPosition(115, 0);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(25, 0, 75, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_portraitWithTopGravity() {
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 20));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 100, 150),
- /* activityBounds */ new Rect(0, 75, 50, 125),
- /* taskBounds */ new Rect(0, 50, 100, 125)),
- mLeash);
-
- verifySetPosition(20, -15);
- // Should return activity coordinates offset by task coordinates minus unwanted left inset
- verifySetWindowCrop(new Rect(10, 25, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_portraitWithCenterGravity() {
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 20));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 100, 150),
- /* activityBounds */ new Rect(0, 75, 50, 125),
- /* taskBounds */ new Rect(0, 50, 100, 125)),
- mLeash);
-
- verifySetPosition(20, 20);
- // Should return activity coordinates offset by task coordinates minus unwanted left inset
- verifySetWindowCrop(new Rect(10, 25, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_portraitWithBottomGravity() {
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 20));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 100, 150),
- /* activityBounds */ new Rect(0, 75, 50, 125),
- /* taskBounds */ new Rect(0, 50, 100, 125)),
- mLeash);
-
- verifySetPosition(20, 55);
- // Should return activity coordinates offset by task coordinates minus unwanted left inset
- verifySetWindowCrop(new Rect(10, 25, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_partlyOverlapsWithAllInsets() {
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 125), // equal to parent bounds
- Insets.of(/* left= */ 25, /* top= */ 25, /* right= */ 35, /* bottom= */ 15));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 125), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 125),
- /* activityBounds */ new Rect(15, 0, 175, 120),
- /* taskBounds */ new Rect(0, 0, 100, 125)), // equal to parent bounds
- mLeash);
-
- // Activity fully covers parent bounds with insets so doesn't need to be moved.
- verifySetPosition(0, 0);
- // Should return activity coordinates offset by task coordinates minus all insets
- // except top one (keep status bar decor visible).
- verifySetWindowCrop(new Rect(25, 0, 165, 110));
- }
-
- @Test
- public void testOnTaskInfoAppeared_parentShiftedLikeInOneHandedMode() {
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150),
- Insets.of(/* left= */ 0, /* top= */ 10, /* right= */ 0, /* bottom= */ 0));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150),
- /* parentBounds */ new Rect(0, 75, 100, 225),
- /* activityBounds */ new Rect(25, 75, 75, 125),
- /* taskBounds */ new Rect(0, 75, 100, 125)),
- mLeash);
-
- verifySetPosition(0, 0);
- verifySetWindowCrop(new Rect(25, 0, 75, 50));
- }
-
- @Test(expected = IllegalStateException.class)
- public void testOnTaskAppeared_calledSecondTimeWithSameTaskId_throwsException() {
- setWindowBoundsAndInsets(new Rect(), Insets.NONE);
- RunningTaskInfo taskInfo =
- createTaskInfo(/* taskId */ 1, new Rect(), new Rect(), new Rect(), new Rect());
- mLetterboxTaskListener.onTaskAppeared(taskInfo, mLeash);
- mLetterboxTaskListener.onTaskAppeared(taskInfo, mLeash);
- }
-
- private void setWindowBoundsAndInsets(Rect windowBounds, Insets insets) {
- when(mWindowMetrics.getBounds()).thenReturn(windowBounds);
- when(mWindowInsets.getInsets(anyInt())).thenReturn(insets);
- }
-
- private void verifySetPosition(int x, int y) {
- verify(mTransaction).setPosition(eq(mLeash), eq((float) x), eq((float) y));
- }
-
- private void verifySetWindowCrop(final Rect crop) {
- // Should return activty coordinates offset by task coordinates
- verify(mTransaction).setWindowCrop(eq(mLeash), eq(crop));
- }
-
- private static RunningTaskInfo createTaskInfo(
- int taskId,
- final Rect maxBounds,
- final Rect parentBounds,
- final Rect activityBounds,
- final Rect taskBounds) {
- RunningTaskInfo taskInfo = new RunningTaskInfo();
- taskInfo.taskId = taskId;
- taskInfo.configuration.windowConfiguration.setMaxBounds(maxBounds);
- taskInfo.parentBounds = parentBounds;
- taskInfo.configuration.windowConfiguration.setBounds(taskBounds);
- taskInfo.letterboxActivityBounds = Rect.copyOrNull(activityBounds);
-
- return taskInfo;
- }
-}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java
index a65d832..ef99235 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java
@@ -337,7 +337,8 @@
reentryBounds.scale(1.25f);
final float reentrySnapFraction = mPipBoundsAlgorithm.getSnapFraction(reentryBounds);
- mPipBoundsState.saveReentryState(reentryBounds, reentrySnapFraction);
+ mPipBoundsState.saveReentryState(
+ new Size(reentryBounds.width(), reentryBounds.height()), reentrySnapFraction);
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
assertEquals(reentryBounds.width(), destinationBounds.width());
@@ -351,7 +352,8 @@
reentryBounds.offset(0, -100);
final float reentrySnapFraction = mPipBoundsAlgorithm.getSnapFraction(reentryBounds);
- mPipBoundsState.saveReentryState(reentryBounds, reentrySnapFraction);
+ mPipBoundsState.saveReentryState(
+ new Size(reentryBounds.width(), reentryBounds.height()), reentrySnapFraction);
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java
index 4bcca06..8ba301a 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java
@@ -47,7 +47,7 @@
@SmallTest
public class PipBoundsStateTest extends ShellTestCase {
- private static final Rect DEFAULT_BOUNDS = new Rect(0, 0, 10, 10);
+ private static final Size DEFAULT_SIZE = new Size(10, 10);
private static final float DEFAULT_SNAP_FRACTION = 1.0f;
private PipBoundsState mPipBoundsState;
@@ -71,22 +71,22 @@
@Test
public void testSetReentryState() {
- final Rect bounds = new Rect(0, 0, 100, 100);
+ final Size size = new Size(100, 100);
final float snapFraction = 0.5f;
- mPipBoundsState.saveReentryState(bounds, snapFraction);
+ mPipBoundsState.saveReentryState(size, snapFraction);
final PipBoundsState.PipReentryState state = mPipBoundsState.getReentryState();
- assertEquals(new Size(100, 100), state.getSize());
+ assertEquals(size, state.getSize());
assertEquals(snapFraction, state.getSnapFraction(), 0.01);
}
@Test
public void testClearReentryState() {
- final Rect bounds = new Rect(0, 0, 100, 100);
+ final Size size = new Size(100, 100);
final float snapFraction = 0.5f;
- mPipBoundsState.saveReentryState(bounds, snapFraction);
+ mPipBoundsState.saveReentryState(size, snapFraction);
mPipBoundsState.clearReentryState();
assertNull(mPipBoundsState.getReentryState());
@@ -95,20 +95,20 @@
@Test
public void testSetLastPipComponentName_notChanged_doesNotClearReentryState() {
mPipBoundsState.setLastPipComponentName(mTestComponentName1);
- mPipBoundsState.saveReentryState(DEFAULT_BOUNDS, DEFAULT_SNAP_FRACTION);
+ mPipBoundsState.saveReentryState(DEFAULT_SIZE, DEFAULT_SNAP_FRACTION);
mPipBoundsState.setLastPipComponentName(mTestComponentName1);
final PipBoundsState.PipReentryState state = mPipBoundsState.getReentryState();
assertNotNull(state);
- assertEquals(new Size(DEFAULT_BOUNDS.width(), DEFAULT_BOUNDS.height()), state.getSize());
+ assertEquals(DEFAULT_SIZE, state.getSize());
assertEquals(DEFAULT_SNAP_FRACTION, state.getSnapFraction(), 0.01);
}
@Test
public void testSetLastPipComponentName_changed_clearReentryState() {
mPipBoundsState.setLastPipComponentName(mTestComponentName1);
- mPipBoundsState.saveReentryState(DEFAULT_BOUNDS, DEFAULT_SNAP_FRACTION);
+ mPipBoundsState.saveReentryState(DEFAULT_SIZE, DEFAULT_SNAP_FRACTION);
mPipBoundsState.setLastPipComponentName(mTestComponentName2);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
index 4687d2d..62ffac4 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
@@ -30,10 +30,12 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
+import android.graphics.Rect;
import android.os.RemoteException;
import android.test.suitebuilder.annotation.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import android.util.Size;
import com.android.wm.shell.ShellTestCase;
import com.android.wm.shell.WindowManagerShellWrapper;
@@ -135,4 +137,28 @@
verify(mMockPipBoundsState, never()).setLastPipComponentName(null);
}
+
+ @Test
+ public void saveReentryState_noUserResize_doesNotSaveSize() {
+ final Rect bounds = new Rect(0, 0, 10, 10);
+ when(mMockPipBoundsAlgorithm.getSnapFraction(bounds)).thenReturn(1.0f);
+ when(mMockPipBoundsState.hasUserResizedPip()).thenReturn(false);
+
+ mPipController.saveReentryState(bounds);
+
+ verify(mMockPipBoundsState).saveReentryState(null, 1.0f);
+ }
+
+ @Test
+ public void saveReentryState_userHasResized_savesSize() {
+ final Rect bounds = new Rect(0, 0, 10, 10);
+ final Rect resizedBounds = new Rect(0, 0, 30, 30);
+ when(mMockPipBoundsAlgorithm.getSnapFraction(bounds)).thenReturn(1.0f);
+ when(mMockPipTouchHandler.getUserResizeBounds()).thenReturn(resizedBounds);
+ when(mMockPipBoundsState.hasUserResizedPip()).thenReturn(true);
+
+ mPipController.saveReentryState(bounds);
+
+ verify(mMockPipBoundsState).saveReentryState(new Size(30, 30), 1.0f);
+ }
}
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index 1ff1978..0533aa6 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -672,6 +672,7 @@
srcs: [
"tests/microbench/main.cpp",
+ "tests/microbench/CanvasOpBench.cpp",
"tests/microbench/DisplayListCanvasBench.cpp",
"tests/microbench/LinearAllocatorBench.cpp",
"tests/microbench/PathParserBench.cpp",
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index dc63e5d..dd24763 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -16,14 +16,15 @@
#pragma once
-#include "pipeline/skia/SkiaDisplayList.h"
-
namespace android {
namespace uirenderer {
namespace VectorDrawable {
class Tree;
};
+namespace skiapipeline {
+class SkiaDisplayList;
+}
typedef uirenderer::VectorDrawable::Tree VectorDrawableRoot;
/**
diff --git a/libs/hwui/FrameInfo.h b/libs/hwui/FrameInfo.h
index 738246d..ee7d15a 100644
--- a/libs/hwui/FrameInfo.h
+++ b/libs/hwui/FrameInfo.h
@@ -159,7 +159,7 @@
// GPU start time is approximated to the moment before swapBuffer is invoked.
// We could add an EGLSyncKHR fence at the beginning of the frame, but that is an overhead.
int64_t endTime = get(FrameInfoIndex::GpuCompleted);
- return endTime > 0 ? endTime - get(FrameInfoIndex::SwapBuffers) : 0;
+ return endTime > 0 ? endTime - get(FrameInfoIndex::SwapBuffers) : -1;
}
inline int64_t& set(FrameInfoIndex index) { return mFrameInfo[static_cast<int>(index)]; }
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 31e4555..74c70c8 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -380,7 +380,7 @@
if (mDisplayList) {
mDisplayList->updateChildren(
[&observer, info](RenderNode* child) { child->decParentRefCount(observer, info); });
- if (!mDisplayList->reuseDisplayList(this, info ? &info->canvasContext : nullptr)) {
+ if (!mDisplayList->reuseDisplayList(this)) {
delete mDisplayList;
}
}
diff --git a/libs/hwui/canvas/CanvasFrontend.cpp b/libs/hwui/canvas/CanvasFrontend.cpp
index 2c839b0..8f261c83 100644
--- a/libs/hwui/canvas/CanvasFrontend.cpp
+++ b/libs/hwui/canvas/CanvasFrontend.cpp
@@ -21,7 +21,14 @@
namespace android::uirenderer {
CanvasStateHelper::CanvasStateHelper(int width, int height) {
+ resetState(width, height);
+}
+
+void CanvasStateHelper::resetState(int width, int height) {
mInitialBounds = SkIRect::MakeWH(width, height);
+ mSaveStack.clear();
+ mClipStack.clear();
+ mTransformStack.clear();
mSaveStack.emplace_back();
mClipStack.emplace_back().setRect(mInitialBounds);
mTransformStack.emplace_back();
diff --git a/libs/hwui/canvas/CanvasFrontend.h b/libs/hwui/canvas/CanvasFrontend.h
index 5fccccb..d749d2f 100644
--- a/libs/hwui/canvas/CanvasFrontend.h
+++ b/libs/hwui/canvas/CanvasFrontend.h
@@ -57,9 +57,7 @@
}
bool internalSave(SaveEntry saveEntry);
- bool internalSave(SaveFlags::Flags flags) {
- return internalSave(flagsToSaveEntry(flags));
- }
+
void internalSaveLayer(const SkCanvas::SaveLayerRec& layerRec) {
internalSave({
.clip = true,
@@ -90,6 +88,8 @@
return mClipStack[mCurrentClipIndex];
}
+ void resetState(int width, int height);
+
public:
int saveCount() const { return mSaveStack.size(); }
@@ -186,14 +186,26 @@
submit(std::move(op));
}
- const CanvasOpReceiver& receiver() const { return mReceiver; }
+ const CanvasOpReceiver& receiver() const { return *mReceiver; }
+
+ CanvasOpReceiver finish() {
+ auto ret = std::move(mReceiver.value());
+ mReceiver.reset();
+ return std::move(ret);
+ }
+
+ template<class... Args>
+ void reset(int newWidth, int newHeight, Args&&... args) {
+ resetState(newWidth, newHeight);
+ mReceiver.emplace(std::forward<Args>(args)...);
+ }
private:
- CanvasOpReceiver mReceiver;
+ std::optional<CanvasOpReceiver> mReceiver;
template <CanvasOpType T>
void submit(CanvasOp<T>&& op) {
- mReceiver.push_container(CanvasOpContainer(std::move(op), transform()));
+ mReceiver->push_container(CanvasOpContainer(std::move(op), transform()));
}
};
diff --git a/libs/hwui/canvas/CanvasOps.h b/libs/hwui/canvas/CanvasOps.h
index 242dbdb..62c26c7 100644
--- a/libs/hwui/canvas/CanvasOps.h
+++ b/libs/hwui/canvas/CanvasOps.h
@@ -310,7 +310,7 @@
template<>
struct CanvasOp<CanvasOpType::DrawImage> {
- CanvasOp<CanvasOpType::DrawImageRect>(
+ CanvasOp(
const sk_sp<Bitmap>& bitmap,
float left,
float top,
@@ -336,7 +336,7 @@
template<>
struct CanvasOp<CanvasOpType::DrawImageRect> {
- CanvasOp<CanvasOpType::DrawImageRect>(
+ CanvasOp(
const sk_sp<Bitmap>& bitmap,
SkRect src,
SkRect dst,
@@ -367,7 +367,7 @@
template<>
struct CanvasOp<CanvasOpType::DrawImageLattice> {
- CanvasOp<CanvasOpType::DrawImageLattice>(
+ CanvasOp(
const sk_sp<Bitmap>& bitmap,
SkRect dst,
SkCanvas::Lattice lattice,
diff --git a/libs/hwui/canvas/OpBuffer.h b/libs/hwui/canvas/OpBuffer.h
index 98e385f..6dc29d9 100644
--- a/libs/hwui/canvas/OpBuffer.h
+++ b/libs/hwui/canvas/OpBuffer.h
@@ -60,9 +60,8 @@
return (size + (Alignment - 1)) & -Alignment;
}
- static constexpr auto STARTING_SIZE = PadAlign(sizeof(BufferHeader));
-
public:
+ static constexpr auto STARTING_SIZE = PadAlign(sizeof(BufferHeader));
using ItemHeader = OpBufferItemHeader<ItemTypes>;
OpBuffer() = default;
diff --git a/libs/hwui/hwui/Canvas.h b/libs/hwui/hwui/Canvas.h
index 4d67166..11fa322 100644
--- a/libs/hwui/hwui/Canvas.h
+++ b/libs/hwui/hwui/Canvas.h
@@ -21,6 +21,7 @@
#include <SaveFlags.h>
#include <androidfw/ResourceTypes.h>
+#include "DisplayList.h"
#include "Properties.h"
#include "utils/Macros.h"
@@ -47,18 +48,6 @@
class CanvasPropertyPrimitive;
class DeferredLayerUpdater;
class RenderNode;
-
-namespace skiapipeline {
-class SkiaDisplayList;
-}
-
-/**
- * Data structure that holds the list of commands used in display list stream
- */
-using DisplayList = skiapipeline::SkiaDisplayList;
-}
-
-namespace uirenderer {
namespace VectorDrawable {
class Tree;
}
diff --git a/libs/hwui/jni/Typeface.cpp b/libs/hwui/jni/Typeface.cpp
index a2964d6..10c8077 100644
--- a/libs/hwui/jni/Typeface.cpp
+++ b/libs/hwui/jni/Typeface.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#define ATRACE_TAG ATRACE_TAG_VIEW
#include "FontUtils.h"
#include "GraphicsJNI.h"
#include "fonts/Font.h"
@@ -25,8 +26,13 @@
#include <minikin/FontCollection.h>
#include <minikin/FontFamily.h>
#include <minikin/SystemFonts.h>
+#include <utils/TraceUtils.h>
+
+#include <mutex>
+#include <unordered_map>
using namespace android;
+using android::uirenderer::TraceUtils;
static inline Typeface* toTypeface(jlong ptr) {
return reinterpret_cast<Typeface*>(ptr);
@@ -149,6 +155,20 @@
toTypeface(ptr)->fFontCollection);
}
+static sk_sp<SkData> makeSkDataCached(const std::string& path) {
+ // We don't clear cache as Typeface objects created by Typeface_readTypefaces() will be stored
+ // in a static field and will not be garbage collected.
+ static std::unordered_map<std::string, sk_sp<SkData>> cache;
+ static std::mutex mutex;
+ ALOG_ASSERT(!path.empty());
+ std::lock_guard lock{mutex};
+ sk_sp<SkData>& entry = cache[path];
+ if (entry.get() == nullptr) {
+ entry = SkData::MakeFromFileName(path.c_str());
+ }
+ return entry;
+}
+
static std::function<std::shared_ptr<minikin::MinikinFont>()> readMinikinFontSkia(
minikin::BufferReader* reader) {
std::string_view fontPath = reader->readString();
@@ -158,8 +178,9 @@
std::tie(axesPtr, axesCount) = reader->readArray<minikin::FontVariation>();
return [fontPath, fontIndex, axesPtr, axesCount]() -> std::shared_ptr<minikin::MinikinFont> {
std::string path(fontPath.data(), fontPath.size());
- sk_sp<SkData> data = SkData::MakeFromFileName(path.c_str());
- if (data == nullptr) {
+ ATRACE_FORMAT("Loading font %s", path.c_str());
+ sk_sp<SkData> data = makeSkDataCached(path);
+ if (data.get() == nullptr) {
// This may happen if:
// 1. When the process failed to open the file (e.g. invalid path or permission).
// 2. When the process failed to map the file (e.g. hitting max_map_count limit).
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
index 158c349..c63f5d3 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
@@ -47,7 +47,7 @@
}
}
-bool SkiaDisplayList::reuseDisplayList(RenderNode* node, renderthread::CanvasContext* context) {
+bool SkiaDisplayList::reuseDisplayList(RenderNode* node) {
reset();
node->attachAvailableList(this);
return true;
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.h b/libs/hwui/pipeline/skia/SkiaDisplayList.h
index cdd00db..f2f19ba 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.h
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.h
@@ -98,7 +98,7 @@
*
* @return true if the displayList will be reused and therefore should not be deleted
*/
- bool reuseDisplayList(RenderNode* node, renderthread::CanvasContext* context);
+ bool reuseDisplayList(RenderNode* node);
/**
* ONLY to be called by RenderNode::syncDisplayList so that we can notify any
diff --git a/libs/hwui/tests/microbench/CanvasOpBench.cpp b/libs/hwui/tests/microbench/CanvasOpBench.cpp
new file mode 100644
index 0000000..ef5749e
--- /dev/null
+++ b/libs/hwui/tests/microbench/CanvasOpBench.cpp
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2015 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 <benchmark/benchmark.h>
+
+#include "DisplayList.h"
+#include "hwui/Paint.h"
+#include "canvas/CanvasOpBuffer.h"
+#include "canvas/CanvasFrontend.h"
+#include "tests/common/TestUtils.h"
+
+using namespace android;
+using namespace android::uirenderer;
+
+void BM_CanvasOpBuffer_alloc(benchmark::State& benchState) {
+ while (benchState.KeepRunning()) {
+ auto displayList = new CanvasOpBuffer();
+ benchmark::DoNotOptimize(displayList);
+ delete displayList;
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_alloc);
+
+void BM_CanvasOpBuffer_record_saverestore(benchmark::State& benchState) {
+ CanvasFrontend<CanvasOpBuffer> canvas(100, 100);
+ while (benchState.KeepRunning()) {
+ canvas.reset(100, 100);
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.save(SaveFlags::MatrixClip);
+ benchmark::DoNotOptimize(&canvas);
+ canvas.restore();
+ canvas.restore();
+ canvas.finish();
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_record_saverestore);
+
+void BM_CanvasOpBuffer_record_saverestoreWithReuse(benchmark::State& benchState) {
+ CanvasFrontend<CanvasOpBuffer> canvas(100, 100);
+
+ while (benchState.KeepRunning()) {
+ canvas.reset(100, 100);
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.save(SaveFlags::MatrixClip);
+ benchmark::DoNotOptimize(&canvas);
+ canvas.restore();
+ canvas.restore();
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_record_saverestoreWithReuse);
+
+void BM_CanvasOpBuffer_record_simpleBitmapView(benchmark::State& benchState) {
+ CanvasFrontend<CanvasOpBuffer> canvas(100, 100);
+
+ Paint rectPaint;
+ sk_sp<Bitmap> iconBitmap(TestUtils::createBitmap(80, 80));
+
+ while (benchState.KeepRunning()) {
+ canvas.reset(100, 100);
+ {
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.draw(CanvasOp<CanvasOpType::DrawRect> {
+ .rect = SkRect::MakeWH(100, 100),
+ .paint = rectPaint,
+ });
+ canvas.restore();
+ }
+ {
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.translate(10, 10);
+ canvas.draw(CanvasOp<CanvasOpType::DrawImage> {
+ iconBitmap,
+ 0,
+ 0,
+ SkPaint{}
+ });
+ canvas.restore();
+ }
+ benchmark::DoNotOptimize(&canvas);
+ canvas.finish();
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_record_simpleBitmapView);
diff --git a/libs/hwui/tests/microbench/RenderNodeBench.cpp b/libs/hwui/tests/microbench/RenderNodeBench.cpp
index 206dcd5..011939a 100644
--- a/libs/hwui/tests/microbench/RenderNodeBench.cpp
+++ b/libs/hwui/tests/microbench/RenderNodeBench.cpp
@@ -30,3 +30,29 @@
}
}
BENCHMARK(BM_RenderNode_create);
+
+void BM_RenderNode_recordSimple(benchmark::State& state) {
+ sp<RenderNode> node = new RenderNode();
+ std::unique_ptr<Canvas> canvas(Canvas::create_recording_canvas(100, 100));
+ delete canvas->finishRecording();
+
+ while (state.KeepRunning()) {
+ canvas->resetRecording(100, 100, node.get());
+ canvas->drawColor(0x00000000, SkBlendMode::kSrcOver);
+ node->setStagingDisplayList(canvas->finishRecording());
+ }
+}
+BENCHMARK(BM_RenderNode_recordSimple);
+
+void BM_RenderNode_recordSimpleWithReuse(benchmark::State& state) {
+ sp<RenderNode> node = new RenderNode();
+ std::unique_ptr<Canvas> canvas(Canvas::create_recording_canvas(100, 100));
+ delete canvas->finishRecording();
+
+ while (state.KeepRunning()) {
+ canvas->resetRecording(100, 100, node.get());
+ canvas->drawColor(0x00000000, SkBlendMode::kSrcOver);
+ canvas->finishRecording()->reuseDisplayList(node.get());
+ }
+}
+BENCHMARK(BM_RenderNode_recordSimpleWithReuse);
\ No newline at end of file
diff --git a/libs/hwui/tests/unit/SkiaDisplayListTests.cpp b/libs/hwui/tests/unit/SkiaDisplayListTests.cpp
index 2d34b09..c63f008 100644
--- a/libs/hwui/tests/unit/SkiaDisplayListTests.cpp
+++ b/libs/hwui/tests/unit/SkiaDisplayListTests.cpp
@@ -84,7 +84,7 @@
// attach a displayList for reuse
SkiaDisplayList skiaDL;
- ASSERT_TRUE(skiaDL.reuseDisplayList(renderNode.get(), nullptr));
+ ASSERT_TRUE(skiaDL.reuseDisplayList(renderNode.get()));
// detach the list that you just attempted to reuse
availableList = renderNode->detachAvailableList();
diff --git a/libs/incident/OWNERS b/libs/incident/OWNERS
new file mode 100644
index 0000000..f766115
--- /dev/null
+++ b/libs/incident/OWNERS
@@ -0,0 +1 @@
+include /cmds/incidentd/OWNERS
diff --git a/libs/input/OWNERS b/libs/input/OWNERS
new file mode 100644
index 0000000..d701f23
--- /dev/null
+++ b/libs/input/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/input/OWNERS
diff --git a/libs/storage/OWNERS b/libs/storage/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/libs/storage/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/libs/usb/OWNERS b/libs/usb/OWNERS
new file mode 100644
index 0000000..f7b2a37
--- /dev/null
+++ b/libs/usb/OWNERS
@@ -0,0 +1 @@
+include /services/usb/OWNERS
diff --git a/location/OWNERS b/location/OWNERS
new file mode 100644
index 0000000..5ac6028
--- /dev/null
+++ b/location/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/location/OWNERS
diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java
index b4392b1..a7e9a0d 100644
--- a/location/java/android/location/Location.java
+++ b/location/java/android/location/Location.java
@@ -19,6 +19,7 @@
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
@@ -1048,11 +1049,7 @@
* <ul>
* <li> satellites - the number of satellites used to derive the fix
* </ul>
- *
- * @deprecated Do not use. For GNSS related information, prefer listening for GNSS status
- * information via {@link LocationManager}.
*/
- @Deprecated
public Bundle getExtras() {
return mExtras;
}
@@ -1062,11 +1059,8 @@
*
* <p>Note this stores a copy of the given extras, so any changes to extras after calling this
* method won't be reflected in the location bundle.
- *
- * @deprecated Do not use.
*/
- @Deprecated
- public void setExtras(Bundle extras) {
+ public void setExtras(@Nullable Bundle extras) {
mExtras = (extras == null) ? null : new Bundle(extras);
}
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 7085a75..914beaf 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -159,21 +159,21 @@
public static final long BLOCK_GPS_STATUS_USAGE = 144027538L;
/**
- * Name of the network location provider.
+ * Standard name of the network location provider.
*
- * <p>This provider determines location based on nearby of cell tower and WiFi access points.
- * Results are retrieved by means of a network lookup.
+ * <p>If present, this provider determines location based on nearby of cell tower and WiFi
+ * access points. Operation of this provider may require a data connection.
*/
public static final String NETWORK_PROVIDER = "network";
/**
- * Name of the GNSS location provider.
+ * Standard name of the GNSS location provider.
*
- * <p>This provider determines location using GNSS satellites. Depending on conditions, this
- * provider may take a while to return a location fix. Requires the
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} permission.
+ * <p>If present, this provider determines location using GNSS satellites. The responsiveness
+ * and accuracy of location fixes may depend on GNSS signal conditions.
*
- * <p>The extras Bundle for the GPS location provider can contain the following key/value pairs:
+ * <p>The extras Bundle for locations derived by this location provider may contain the
+ * following key/value pairs:
* <ul>
* <li> satellites - the number of satellites used to derive the fix
* </ul>
@@ -181,29 +181,22 @@
public static final String GPS_PROVIDER = "gps";
/**
- * A special location provider for receiving locations without actually initiating a location
- * fix.
+ * A special location provider for receiving locations without actively initiating a location
+ * fix. This location provider is always present.
*
* <p>This provider can be used to passively receive location updates when other applications or
* services request them without actually requesting the locations yourself. This provider will
- * only return locations generated by other providers. You can query the
- * {@link Location#getProvider()} method to determine the actual provider that supplied the
- * location update. Requires the {@link android.Manifest.permission#ACCESS_FINE_LOCATION}
- * permission, although there is no guarantee of fine locations.
+ * only return locations generated by other providers.
*/
public static final String PASSIVE_PROVIDER = "passive";
/**
- * The fused location provider.
+ * Standard name of the fused location provider.
*
- * <p>This provider may combine inputs from several location sources to provide the
- * best possible location fix. It is implicitly used for all API's that involve the
- * {@link LocationRequest} object.
- *
- * @hide
+ * <p>If present, this provider may combine inputs from several other location providers to
+ * provide the best possible location fix. It is implicitly used for all requestLocationUpdates
+ * APIs that involve a {@link Criteria}.
*/
- @SystemApi
- @TestApi
public static final String FUSED_PROVIDER = "fused";
/**
@@ -918,6 +911,9 @@
/**
* Register for a single location update using a Criteria and a callback.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(long, float, Criteria, PendingIntent)} for more detail
* on how to use this method.
*
@@ -985,6 +981,9 @@
/**
* Register for a single location update using a Criteria and pending intent.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(long, float, Criteria, PendingIntent)} for more detail
* on how to use this method.
*
@@ -1113,6 +1112,9 @@
* Register for location updates using a provider selected through the given Criteria, and a
* callback on the specified {@link Looper}.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(String, LocationRequest, Executor, LocationListener)}
* for more detail on how this method works.
*
@@ -1124,7 +1126,12 @@
* @throws IllegalArgumentException if criteria is null
* @throws IllegalArgumentException if listener is null
* @throws SecurityException if no suitable permission is present
+ *
+ * @deprecated Use
+ * {@link #requestLocationUpdates(String, long, float, LocationListener, Looper)} instead to
+ * explicitly select a provider.
*/
+ @Deprecated
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(long minTimeMs, float minDistanceM,
@NonNull Criteria criteria, @NonNull LocationListener listener,
@@ -1138,6 +1145,9 @@
* Register for location updates using a provider selected through the given Criteria, and a
* callback on the specified {@link Executor}.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(String, LocationRequest, Executor, LocationListener)}
* for more detail on how this method works.
*
@@ -1151,7 +1161,12 @@
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if listener is null
* @throws SecurityException if no suitable permission is present
+ *
+ * @deprecated Use
+ * {@link #requestLocationUpdates(String, long, float, Executor, LocationListener)} instead to
+ * explicitly select a provider.
*/
+ @Deprecated
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(
long minTimeMs,
@@ -1199,6 +1214,9 @@
* Register for location updates using a provider selected through the given Criteria, and
* callbacks delivered via the provided {@link PendingIntent}.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(String, long, float, PendingIntent)} for more detail on
* how this method works.
*
@@ -1210,7 +1228,11 @@
* @throws IllegalArgumentException if provider is null or doesn't exist
* @throws IllegalArgumentException if pendingIntent is null
* @throws SecurityException if no suitable permission is present
+ *
+ * @deprecated Use {@link #requestLocationUpdates(String, long, float, PendingIntent)} instead
+ * to explicitly select a provider.
*/
+ @Deprecated
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(long minTimeMs, float minDistanceM,
@NonNull Criteria criteria, @NonNull PendingIntent pendingIntent) {
@@ -1594,9 +1616,8 @@
}
/**
- * Returns a list of the names of all known location providers. All providers are returned,
- * including ones that are not permitted to be accessed by the calling activity or are currently
- * disabled.
+ * Returns a list of the names of all available location providers. All providers are returned,
+ * including those that are currently disabled.
*
* @return list of provider names
*/
@@ -1609,8 +1630,8 @@
}
/**
- * Returns a list of the names of location providers. Only providers that the caller has
- * permission to access will be returned.
+ * Returns a list of the names of available location providers. If {@code enabledOnly} is false,
+ * this is functionally the same as {@link #getAllProviders()}.
*
* @param enabledOnly if true then only enabled providers are included
* @return list of provider names
@@ -1624,8 +1645,7 @@
}
/**
- * Returns a list of the names of providers that satisfy the given criteria. Only providers that
- * the caller has permission to access will be returned.
+ * Returns a list of the names of available location providers that satisfy the given criteria.
*
* @param criteria the criteria that providers must match
* @param enabledOnly if true then only enabled providers are included
diff --git a/location/java/android/location/OWNERS b/location/java/android/location/OWNERS
new file mode 100644
index 0000000..6032144
--- /dev/null
+++ b/location/java/android/location/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 880425
+
+sooniln@google.com
+wyattriley@google.com
+yuhany@google.com
+weiwa@google.com
diff --git a/media/java/android/media/AudioDeviceInfo.java b/media/java/android/media/AudioDeviceInfo.java
index b67851a..2a3704d 100644
--- a/media/java/android/media/AudioDeviceInfo.java
+++ b/media/java/android/media/AudioDeviceInfo.java
@@ -23,6 +23,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
+import java.util.List;
import java.util.Objects;
import java.util.TreeSet;
@@ -498,6 +499,13 @@
}
/**
+ * @return A list of {@link AudioProfile} supported by the audio devices.
+ */
+ public @NonNull List<AudioProfile> getAudioProfiles() {
+ return mPort.profiles();
+ }
+
+ /**
* Returns an array of supported encapsulation modes for the device.
*
* The array can include any of the {@code AudioTrack} encapsulation modes,
diff --git a/media/java/android/media/AudioDevicePort.java b/media/java/android/media/AudioDevicePort.java
index 0f79675..9c42bf7 100644
--- a/media/java/android/media/AudioDevicePort.java
+++ b/media/java/android/media/AudioDevicePort.java
@@ -21,6 +21,7 @@
import android.os.Build;
import java.util.Arrays;
+import java.util.List;
/**
* The AudioDevicePort is a specialized type of AudioPort
@@ -57,6 +58,18 @@
mEncapsulationMetadataTypes = encapsulationMetadataTypes;
}
+ AudioDevicePort(AudioHandle handle, String deviceName, List<AudioProfile> profiles,
+ AudioGain[] gains, int type, String address, int[] encapsulationModes,
+ @AudioTrack.EncapsulationMetadataType int[] encapsulationMetadataTypes) {
+ super(handle,
+ AudioManager.isInputDevice(type) ? AudioPort.ROLE_SOURCE : AudioPort.ROLE_SINK,
+ deviceName, profiles, gains);
+ mType = type;
+ mAddress = address;
+ mEncapsulationModes = encapsulationModes;
+ mEncapsulationMetadataTypes = encapsulationMetadataTypes;
+ }
+
/**
* Get the device type (e.g AudioManager.DEVICE_OUT_SPEAKER)
*/
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 4578883..3bd68d8 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -2319,7 +2319,55 @@
if (attributes == null) {
throw new NullPointerException("Illegal null AudioAttributes");
}
- return AudioSystem.isOffloadSupported(format, attributes);
+ return AudioSystem.getOffloadSupport(format, attributes) != PLAYBACK_OFFLOAD_NOT_SUPPORTED;
+ }
+
+ /** Return value for {@link #getPlaybackOffloadSupport(AudioFormat, AudioAttributes)}:
+ offload playback not supported */
+ public static final int PLAYBACK_OFFLOAD_NOT_SUPPORTED = AudioSystem.OFFLOAD_NOT_SUPPORTED;
+ /** Return value for {@link #getPlaybackOffloadSupport(AudioFormat, AudioAttributes)}:
+ offload playback supported */
+ public static final int PLAYBACK_OFFLOAD_SUPPORTED = AudioSystem.OFFLOAD_SUPPORTED;
+ /** Return value for {@link #getPlaybackOffloadSupport(AudioFormat, AudioAttributes)}:
+ offload playback supported with gapless transitions */
+ public static final int PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED =
+ AudioSystem.OFFLOAD_GAPLESS_SUPPORTED;
+
+ /** @hide */
+ @IntDef(flag = false, prefix = "PLAYBACK_OFFLOAD_", value = {
+ PLAYBACK_OFFLOAD_NOT_SUPPORTED,
+ PLAYBACK_OFFLOAD_SUPPORTED,
+ PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED }
+ )
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface AudioOffloadMode {}
+
+ /**
+ * Returns whether offloaded playback of an audio format is supported on the device or not and
+ * when supported whether gapless transitions are possible or not.
+ * <p>Offloaded playback is the feature where the decoding and playback of an audio stream
+ * is not competing with other software resources. In general, it is supported by dedicated
+ * hardware, such as audio DSPs.
+ * <p>Note that this query only provides information about the support of an audio format,
+ * it does not indicate whether the resources necessary for the offloaded playback are
+ * available at that instant.
+ * @param format the audio format (codec, sample rate, channels) being checked.
+ * @param attributes the {@link AudioAttributes} to be used for playback
+ * @return {@link #PLAYBACK_OFFLOAD_NOT_SUPPORTED} if offload playback if not supported,
+ * {@link #PLAYBACK_OFFLOAD_SUPPORTED} if offload playback is supported or
+ * {@link #PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED} if gapless transitions are
+ * also supported.
+ */
+ @AudioOffloadMode
+ public static int getPlaybackOffloadSupport(@NonNull AudioFormat format,
+ @NonNull AudioAttributes attributes) {
+ if (format == null) {
+ throw new NullPointerException("Illegal null AudioFormat");
+ }
+ if (attributes == null) {
+ throw new NullPointerException("Illegal null AudioAttributes");
+ }
+ return AudioSystem.getOffloadSupport(format, attributes);
}
//====================================================================
@@ -2881,7 +2929,12 @@
* @return true if any music tracks are active.
*/
public boolean isMusicActive() {
- return AudioSystem.isStreamActive(STREAM_MUSIC, 0);
+ final IAudioService service = getService();
+ try {
+ return service.isMusicActive();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
diff --git a/media/java/android/media/AudioMixPort.java b/media/java/android/media/AudioMixPort.java
index 0e286b0..7f2249d 100644
--- a/media/java/android/media/AudioMixPort.java
+++ b/media/java/android/media/AudioMixPort.java
@@ -19,6 +19,8 @@
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
+import java.util.List;
+
/**
* The AudioMixPort is a specialized type of AudioPort
* describing an audio mix or stream at an input or output stream of the audio
@@ -42,6 +44,12 @@
mIoHandle = ioHandle;
}
+ AudioMixPort(AudioHandle handle, int ioHandle, int role, String deviceName,
+ List<AudioProfile> profiles, AudioGain[] gains) {
+ super(handle, role, deviceName, profiles, gains);
+ mIoHandle = ioHandle;
+ }
+
/**
* Build a specific configuration of this audio mix port for use by methods
* like AudioManager.connectAudioPatch().
diff --git a/media/java/android/media/AudioPort.java b/media/java/android/media/AudioPort.java
index e6dc622..0302250 100644
--- a/media/java/android/media/AudioPort.java
+++ b/media/java/android/media/AudioPort.java
@@ -19,6 +19,13 @@
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
/**
* An audio port is a node of the audio framework or hardware that can be connected to or
* disconnect from another audio node to create a specific audio routing configuration.
@@ -78,6 +85,7 @@
private final int[] mChannelMasks;
private final int[] mChannelIndexMasks;
private final int[] mFormats;
+ private final List<AudioProfile> mProfiles;
@UnsupportedAppUsage
private final AudioGain[] mGains;
@UnsupportedAppUsage
@@ -87,7 +95,6 @@
AudioPort(AudioHandle handle, int role, String name,
int[] samplingRates, int[] channelMasks, int[] channelIndexMasks,
int[] formats, AudioGain[] gains) {
-
mHandle = handle;
mRole = role;
mName = name;
@@ -96,6 +103,39 @@
mChannelIndexMasks = channelIndexMasks;
mFormats = formats;
mGains = gains;
+ mProfiles = new ArrayList<>();
+ if (mFormats != null) {
+ for (int format : mFormats) {
+ mProfiles.add(new AudioProfile(
+ format, samplingRates, channelMasks, channelIndexMasks));
+ }
+ }
+ }
+
+ AudioPort(AudioHandle handle, int role, String name,
+ List<AudioProfile> profiles, AudioGain[] gains) {
+ mHandle = handle;
+ mRole = role;
+ mName = name;
+ mProfiles = profiles;
+ mGains = gains;
+ Set<Integer> formats = new HashSet<>();
+ Set<Integer> samplingRates = new HashSet<>();
+ Set<Integer> channelMasks = new HashSet<>();
+ Set<Integer> channelIndexMasks = new HashSet<>();
+ for (AudioProfile profile : profiles) {
+ formats.add(profile.getFormat());
+ samplingRates.addAll(Arrays.stream(profile.getSampleRates()).boxed()
+ .collect(Collectors.toList()));
+ channelMasks.addAll(Arrays.stream(profile.getChannelMasks()).boxed()
+ .collect(Collectors.toList()));
+ channelIndexMasks.addAll(Arrays.stream(profile.getChannelIndexMasks()).boxed()
+ .collect(Collectors.toList()));
+ }
+ mSamplingRates = samplingRates.stream().mapToInt(Number::intValue).toArray();
+ mChannelMasks = channelMasks.stream().mapToInt(Number::intValue).toArray();
+ mChannelIndexMasks = channelIndexMasks.stream().mapToInt(Number::intValue).toArray();
+ mFormats = formats.stream().mapToInt(Number::intValue).toArray();
}
AudioHandle handle() {
@@ -163,6 +203,13 @@
}
/**
+ * Get the list of supported audio profiles
+ */
+ public List<AudioProfile> profiles() {
+ return mProfiles;
+ }
+
+ /**
* Get the list of gain descriptors
* Empty array if this port does not have gain control
*/
diff --git a/media/java/android/media/AudioProfile.java b/media/java/android/media/AudioProfile.java
new file mode 100644
index 0000000..4204166
--- /dev/null
+++ b/media/java/android/media/AudioProfile.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2020 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.media;
+
+import android.annotation.NonNull;
+
+/**
+ * AudioProfile is a class used by {@link AudioDeviceInfo} to list the audio formats, sampling rates
+ * and channel masks supported.
+ * Each AudioProfile is specific to an audio format and lists all sampling rates and channel masks
+ * supported for this format.
+ */
+public class AudioProfile {
+ private final int mFormat;
+ private final int[] mSamplingRates;
+ private final int[] mChannelMasks;
+ private final int[] mChannelIndexMasks;
+
+ AudioProfile(int format, @NonNull int[] samplingRates, @NonNull int[] channelMasks,
+ @NonNull int[] channelIndexMasks) {
+ mFormat = format;
+ mSamplingRates = samplingRates;
+ mChannelMasks = channelMasks;
+ mChannelIndexMasks = channelIndexMasks;
+ }
+
+ /**
+ * @return the encoding format for this AudioProfile.
+ */
+ public @AudioFormat.Encoding int getFormat() {
+ return mFormat;
+ }
+
+ /**
+ * @return an array of channel position masks that are associated with the encoding format.
+ */
+ public @NonNull int[] getChannelMasks() {
+ return mChannelMasks;
+ }
+
+ /**
+ * @return an array of channel index masks that are associated with the encoding format.
+ */
+ public @NonNull int[] getChannelIndexMasks() {
+ return mChannelIndexMasks;
+ }
+
+ /**
+ * @return an array of sample rates that are associated with the encoding format.
+ */
+ public @NonNull int[] getSampleRates() {
+ return mSamplingRates;
+ }
+}
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index bd27f6d..8987a71 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -1639,13 +1639,22 @@
*/
public static native int setAllowedCapturePolicy(int uid, int flags);
- static boolean isOffloadSupported(@NonNull AudioFormat format, @NonNull AudioAttributes attr) {
- return native_is_offload_supported(format.getEncoding(), format.getSampleRate(),
+ /**
+ * @hide
+ * Compressed audio offload decoding modes supported by audio HAL implementation.
+ * Keep in sync with system/media/include/media/audio.h.
+ */
+ public static final int OFFLOAD_NOT_SUPPORTED = 0;
+ public static final int OFFLOAD_SUPPORTED = 1;
+ public static final int OFFLOAD_GAPLESS_SUPPORTED = 2;
+
+ static int getOffloadSupport(@NonNull AudioFormat format, @NonNull AudioAttributes attr) {
+ return native_get_offload_support(format.getEncoding(), format.getSampleRate(),
format.getChannelMask(), format.getChannelIndexMask(),
attr.getVolumeControlStream());
}
- private static native boolean native_is_offload_supported(int encoding, int sampleRate,
+ private static native int native_get_offload_support(int encoding, int sampleRate,
int channelMask, int channelIndexMask, int streamType);
/** @hide */
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index e8c6206..e3b6fba 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -1256,7 +1256,8 @@
throw new UnsupportedOperationException(
"Offload and low latency modes are incompatible");
}
- if (!AudioSystem.isOffloadSupported(mFormat, mAttributes)) {
+ if (AudioSystem.getOffloadSupport(mFormat, mAttributes)
+ == AudioSystem.OFFLOAD_NOT_SUPPORTED) {
throw new UnsupportedOperationException(
"Cannot create AudioTrack, offload format / attributes not supported");
}
diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl
index 5c012be..2ac5b50 100755
--- a/media/java/android/media/IAudioService.aidl
+++ b/media/java/android/media/IAudioService.aidl
@@ -334,4 +334,6 @@
oneway void setStreamVolumeForUid(int streamType, int direction, int flags,
in String packageName, int uid, int pid, in UserHandle userHandle,
int targetSdkVersion);
+
+ boolean isMusicActive();
}
diff --git a/media/java/android/media/IMediaRouterService.aidl b/media/java/android/media/IMediaRouterService.aidl
index 068f968..4b8a8ad 100644
--- a/media/java/android/media/IMediaRouterService.aidl
+++ b/media/java/android/media/IMediaRouterService.aidl
@@ -73,6 +73,8 @@
void unregisterManager(IMediaRouter2Manager manager);
void setRouteVolumeWithManager(IMediaRouter2Manager manager, int requestId,
in MediaRoute2Info route, int volume);
+ void startScan(IMediaRouter2Manager manager);
+ void stopScan(IMediaRouter2Manager manager);
void requestCreateSessionWithManager(IMediaRouter2Manager manager, int requestId,
in RoutingSessionInfo oldSession, in @nullable MediaRoute2Info route);
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index c2168f1..e7e83eb 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -25,6 +25,7 @@
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
+import android.os.Process;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Pair;
@@ -188,13 +189,14 @@
// COMMON CONSTANTS
private static final Range<Integer> POSITIVE_INTEGERS =
- Range.create(1, Integer.MAX_VALUE);
+ Range.create(1, Integer.MAX_VALUE);
private static final Range<Long> POSITIVE_LONGS =
- Range.create(1l, Long.MAX_VALUE);
+ Range.create(1L, Long.MAX_VALUE);
private static final Range<Rational> POSITIVE_RATIONALS =
- Range.create(new Rational(1, Integer.MAX_VALUE),
- new Rational(Integer.MAX_VALUE, 1));
- private static final Range<Integer> SIZE_RANGE = Range.create(1, 32768);
+ Range.create(new Rational(1, Integer.MAX_VALUE),
+ new Rational(Integer.MAX_VALUE, 1));
+ private static final Range<Integer> SIZE_RANGE =
+ Process.is64Bit() ? Range.create(1, 32768) : Range.create(1, 4096);
private static final Range<Integer> FRAME_RATE_RANGE = Range.create(0, 960);
private static final Range<Integer> BITRATE_RANGE = Range.create(0, 500000000);
private static final int DEFAULT_MAX_SUPPORTED_INSTANCES = 32;
@@ -1399,6 +1401,9 @@
/**
* Returns the range of supported video widths.
+ * <p class=note>
+ * 32-bit processes will not support resolutions larger than 4096x4096 due to
+ * the limited address space.
*/
public Range<Integer> getSupportedWidths() {
return mWidthRange;
@@ -1406,6 +1411,9 @@
/**
* Returns the range of supported video heights.
+ * <p class=note>
+ * 32-bit processes will not support resolutions larger than 4096x4096 due to
+ * the limited address space.
*/
public Range<Integer> getSupportedHeights() {
return mHeightRange;
@@ -1857,6 +1865,10 @@
&& aligned.mMaxMacroBlockRate >= otherAligned.mMaxMacroBlockRate);
}
+ /* package private */ boolean isEqualDimension(@NonNull PerformancePoint other) {
+ return mWidth == other.mWidth && mHeight == other.mHeight;
+ }
+
private @NonNull Size getCommonBlockSize(@NonNull PerformancePoint other) {
return new Size(
Math.max(mBlockSize.getWidth(), other.mBlockSize.getWidth()) * 16,
@@ -1997,6 +2009,9 @@
* Performance points assume a single active codec. For use cases where multiple
* codecs are active, should use that highest pixel count, and add the frame rates of
* each individual codec.
+ * <p class=note>
+ * Supported resolution could be further restricted for 32-bit processes due to
+ * the limited virtual memory space.
*/
@Nullable
public List<PerformancePoint> getSupportedPerformancePoints() {
@@ -2164,6 +2179,12 @@
if (size == null || size.getWidth() * size.getHeight() <= 0) {
continue;
}
+ if (size.getWidth() > SIZE_RANGE.getUpper()
+ || size.getHeight() > SIZE_RANGE.getUpper()) {
+ size = new Size(
+ Math.min(size.getWidth(), SIZE_RANGE.getUpper()),
+ Math.min(size.getHeight(), SIZE_RANGE.getUpper()));
+ }
Range<Long> range = Utils.parseLongRange(map.get(key), null);
if (range == null || range.getLower() < 0 || range.getUpper() < 0) {
continue;
@@ -2193,6 +2214,29 @@
(a.getMaxMacroBlockRate() < b.getMaxMacroBlockRate() ? -1 : 1) :
(a.getMaxFrameRate() != b.getMaxFrameRate()) ?
(a.getMaxFrameRate() < b.getMaxFrameRate() ? -1 : 1) : 0));
+
+ // remove redundant points
+ for (int i = 1; i < ret.size(); ++i) {
+ PerformancePoint a = ret.get(i);
+ for (int j = 0; j < i; ++j) {
+ PerformancePoint b = ret.get(j);
+ if (b.isEqualDimension(a) && b.covers(a)) {
+ ret.set(i, null);
+ break;
+ }
+ }
+ }
+ int newSize = 0;
+ for (int i = 0; i < ret.size(); ++i) {
+ PerformancePoint a = ret.get(i);
+ if (a == null) {
+ continue;
+ }
+ ret.set(newSize, a);
+ ++newSize;
+ }
+ ret.setSize(newSize);
+
return Collections.unmodifiableList(ret);
}
diff --git a/media/java/android/media/MediaHTTPConnection.java b/media/java/android/media/MediaHTTPConnection.java
index a17ff82..babc1d5 100644
--- a/media/java/android/media/MediaHTTPConnection.java
+++ b/media/java/android/media/MediaHTTPConnection.java
@@ -19,7 +19,7 @@
import static android.media.MediaPlayer.MEDIA_ERROR_UNSUPPORTED;
import android.compat.annotation.UnsupportedAppUsage;
-import android.net.NetworkUtils;
+import android.net.InetAddresses;
import android.os.IBinder;
import android.os.StrictMode;
import android.util.Log;
@@ -214,7 +214,7 @@
if (host.equalsIgnoreCase("localhost")) {
return true;
}
- if (NetworkUtils.numericToInetAddress(host).isLoopbackAddress()) {
+ if (InetAddresses.parseNumericAddress(host).isLoopbackAddress()) {
return true;
}
} catch (IllegalArgumentException iex) {
diff --git a/media/java/android/media/MediaRouter2Manager.java b/media/java/android/media/MediaRouter2Manager.java
index 4b09a5f..68237de 100644
--- a/media/java/android/media/MediaRouter2Manager.java
+++ b/media/java/android/media/MediaRouter2Manager.java
@@ -147,6 +147,36 @@
}
/**
+ * Starts scanning remote routes.
+ * @see #stopScan(String)
+ */
+ public void startScan() {
+ Client client = getOrCreateClient();
+ if (client != null) {
+ try {
+ mMediaRouterService.startScan(client);
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Unable to get sessions. Service probably died.", ex);
+ }
+ }
+ }
+
+ /**
+ * Stops scanning remote routes to reduce resource consumption.
+ * @see #startScan(String)
+ */
+ public void stopScan() {
+ Client client = getOrCreateClient();
+ if (client != null) {
+ try {
+ mMediaRouterService.stopScan(client);
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Unable to get sessions. Service probably died.", ex);
+ }
+ }
+ }
+
+ /**
* Gets a {@link android.media.session.MediaController} associated with the
* given routing session.
* If there is no matching media session, {@code null} is returned.
diff --git a/media/java/android/media/OWNERS b/media/java/android/media/OWNERS
new file mode 100644
index 0000000..cbc9ab7
--- /dev/null
+++ b/media/java/android/media/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 1344
+
+fgoldfain@google.com
+elaurent@google.com
+lajos@google.com
+olly@google.com
+andrewlewis@google.com
+sungsoo@google.com
diff --git a/media/java/android/media/RouteDiscoveryPreference.java b/media/java/android/media/RouteDiscoveryPreference.java
index 68f2964..2f95247 100644
--- a/media/java/android/media/RouteDiscoveryPreference.java
+++ b/media/java/android/media/RouteDiscoveryPreference.java
@@ -153,6 +153,7 @@
return false;
}
RouteDiscoveryPreference other = (RouteDiscoveryPreference) o;
+ //TODO: Make this order-free
return Objects.equals(mPreferredFeatures, other.mPreferredFeatures)
&& mShouldPerformActiveScan == other.mShouldPerformActiveScan;
}
diff --git a/media/java/android/media/audiofx/OWNERS b/media/java/android/media/audiofx/OWNERS
new file mode 100644
index 0000000..189fe0f
--- /dev/null
+++ b/media/java/android/media/audiofx/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 48436
+
+elaurent@google.com
diff --git a/media/java/android/media/audiopolicy/OWNERS b/media/java/android/media/audiopolicy/OWNERS
new file mode 100644
index 0000000..189fe0f
--- /dev/null
+++ b/media/java/android/media/audiopolicy/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 48436
+
+elaurent@google.com
diff --git a/media/java/android/media/browse/OWNERS b/media/java/android/media/browse/OWNERS
new file mode 100644
index 0000000..916fc36
--- /dev/null
+++ b/media/java/android/media/browse/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 137631
+
+hdmoon@google.com
+insun@google.com
+jaewan@google.com
+jinpark@google.com
+klhyun@google.com
+gyumin@google.com
diff --git a/media/java/android/media/midi/OWNERS b/media/java/android/media/midi/OWNERS
new file mode 100644
index 0000000..6a351d3
--- /dev/null
+++ b/media/java/android/media/midi/OWNERS
@@ -0,0 +1 @@
+elaurent@google.com
diff --git a/media/java/android/media/session/OWNERS b/media/java/android/media/session/OWNERS
new file mode 100644
index 0000000..916fc36
--- /dev/null
+++ b/media/java/android/media/session/OWNERS
@@ -0,0 +1,8 @@
+# Bug component: 137631
+
+hdmoon@google.com
+insun@google.com
+jaewan@google.com
+jinpark@google.com
+klhyun@google.com
+gyumin@google.com
diff --git a/media/java/android/media/session/PlaybackState.java b/media/java/android/media/session/PlaybackState.java
index b1a88ed..e7d30ebb 100644
--- a/media/java/android/media/session/PlaybackState.java
+++ b/media/java/android/media/session/PlaybackState.java
@@ -46,7 +46,8 @@
ACTION_SKIP_TO_PREVIOUS, ACTION_SKIP_TO_NEXT, ACTION_FAST_FORWARD, ACTION_SET_RATING,
ACTION_SEEK_TO, ACTION_PLAY_PAUSE, ACTION_PLAY_FROM_MEDIA_ID, ACTION_PLAY_FROM_SEARCH,
ACTION_SKIP_TO_QUEUE_ITEM, ACTION_PLAY_FROM_URI, ACTION_PREPARE,
- ACTION_PREPARE_FROM_MEDIA_ID, ACTION_PREPARE_FROM_SEARCH, ACTION_PREPARE_FROM_URI})
+ ACTION_PREPARE_FROM_MEDIA_ID, ACTION_PREPARE_FROM_SEARCH, ACTION_PREPARE_FROM_URI,
+ ACTION_SET_PLAYBACK_SPEED})
@Retention(RetentionPolicy.SOURCE)
public @interface Actions {}
@@ -176,6 +177,14 @@
*/
public static final long ACTION_PREPARE_FROM_URI = 1 << 17;
+ // Note: The value jumps from 1 << 17 to 1 << 22 for matching same value with AndroidX.
+ /**
+ * Indicates this session supports the set playback speed command.
+ *
+ * @see Builder#setActions(long)
+ */
+ public static final long ACTION_SET_PLAYBACK_SPEED = 1 << 22;
+
/**
* @hide
*/
@@ -428,6 +437,7 @@
* <li> {@link PlaybackState#ACTION_PREPARE_FROM_MEDIA_ID}</li>
* <li> {@link PlaybackState#ACTION_PREPARE_FROM_SEARCH}</li>
* <li> {@link PlaybackState#ACTION_PREPARE_FROM_URI}</li>
+ * <li> {@link PlaybackState#ACTION_SET_PLAYBACK_SPEED}</li>
* </ul>
*/
@Actions
@@ -823,6 +833,7 @@
* <li> {@link PlaybackState#ACTION_PREPARE_FROM_MEDIA_ID}</li>
* <li> {@link PlaybackState#ACTION_PREPARE_FROM_SEARCH}</li>
* <li> {@link PlaybackState#ACTION_PREPARE_FROM_URI}</li>
+ * <li> {@link PlaybackState#ACTION_SET_PLAYBACK_SPEED}</li>
* </ul>
*
* @param actions The set of actions allowed.
diff --git a/media/java/android/media/soundtrigger/OWNERS b/media/java/android/media/soundtrigger/OWNERS
new file mode 100644
index 0000000..6a351d3
--- /dev/null
+++ b/media/java/android/media/soundtrigger/OWNERS
@@ -0,0 +1 @@
+elaurent@google.com
diff --git a/media/java/android/media/tv/OWNERS b/media/java/android/media/tv/OWNERS
index a891154..8bccc9a 100644
--- a/media/java/android/media/tv/OWNERS
+++ b/media/java/android/media/tv/OWNERS
@@ -1,9 +1,6 @@
-amyjojo@google.com
nchalko@google.com
-shubang@google.com
quxiangfang@google.com
# For android remote service
per-file ITvRemoteServiceInput.aidl = file:/media/lib/tvremote/OWNERS
per-file ITvRemoteProvider.aidl = file:/media/lib/tvremote/OWNERS
-
diff --git a/media/java/android/media/tv/tuner/Tuner.java b/media/java/android/media/tv/tuner/Tuner.java
index d094c2c..20f02a4 100644
--- a/media/java/android/media/tv/tuner/Tuner.java
+++ b/media/java/android/media/tv/tuner/Tuner.java
@@ -279,6 +279,7 @@
@Nullable
private FrontendInfo mFrontendInfo;
private Integer mFrontendHandle;
+ private Boolean mIsSharedFrontend = false;
private int mFrontendType = FrontendSettings.TYPE_UNDEFINED;
private int mUserId;
private Lnb mLnb;
@@ -441,8 +442,11 @@
*/
public void shareFrontendFromTuner(@NonNull Tuner tuner) {
mTunerResourceManager.shareFrontend(mClientId, tuner.mClientId);
- mFrontendHandle = tuner.mFrontendHandle;
- mFrontend = nativeOpenFrontendByHandle(mFrontendHandle);
+ synchronized (mIsSharedFrontend) {
+ mFrontendHandle = tuner.mFrontendHandle;
+ mFrontend = tuner.mFrontend;
+ mIsSharedFrontend = true;
+ }
}
/**
@@ -473,14 +477,19 @@
private void releaseAll() {
if (mFrontendHandle != null) {
- int res = nativeCloseFrontend(mFrontendHandle);
- if (res != Tuner.RESULT_SUCCESS) {
- TunerUtils.throwExceptionForResult(res, "failed to close frontend");
+ synchronized (mIsSharedFrontend) {
+ if (!mIsSharedFrontend) {
+ int res = nativeCloseFrontend(mFrontendHandle);
+ if (res != Tuner.RESULT_SUCCESS) {
+ TunerUtils.throwExceptionForResult(res, "failed to close frontend");
+ }
+ }
+ mIsSharedFrontend = false;
}
mTunerResourceManager.releaseFrontend(mFrontendHandle, mClientId);
FrameworkStatsLog
.write(FrameworkStatsLog.TV_TUNER_STATE_CHANGED, mUserId,
- FrameworkStatsLog.TV_TUNER_STATE_CHANGED__STATE__UNKNOWN);
+ FrameworkStatsLog.TV_TUNER_STATE_CHANGED__STATE__UNKNOWN);
mFrontendHandle = null;
mFrontend = null;
}
diff --git a/media/java/android/media/tv/tuner/frontend/DvbsFrontendSettings.java b/media/java/android/media/tv/tuner/frontend/DvbsFrontendSettings.java
index 98f8096..a2a602a 100644
--- a/media/java/android/media/tv/tuner/frontend/DvbsFrontendSettings.java
+++ b/media/java/android/media/tv/tuner/frontend/DvbsFrontendSettings.java
@@ -341,13 +341,13 @@
return mScanType;
}
/**
- * Get if the client could handle the Diseqc Rx Message or not. Default value is false.
+ * Get if the client can handle the Diseqc Rx Message or not. Default value is false.
*
- * The setter {@link Builder#setCouldHandleDiseqcRxMessage(boolean)} is only supported with
+ * The setter {@link Builder#setCanHandleDiseqcRxMessage(boolean)} is only supported with
* Tuner HAL 1.1 or higher. Use {@link TunerVersionChecker.getTunerVersion()} to check the
* version.
*/
- public boolean getCouldHandleDiseqcRxMessage() {
+ public boolean canHandleDiseqcRxMessage() {
return mIsDiseqcRxMessage;
}
@@ -409,7 +409,7 @@
}
/**
- * Set true to indicate the client could handle the Diseqc Messages. Note that it's still
+ * Set true to indicate the client can handle the Diseqc Messages. Note that it's still
* possible that the client won't receive the messages when HAL is not able to setup Rx
* channel in the hardware layer.
*
@@ -417,10 +417,10 @@
* no-op. Use {@link TunerVersionChecker.getTunerVersion()} to check the version.
*/
@NonNull
- public Builder setCouldHandleDiseqcRxMessage(boolean couldReceiveDiseqcMessage) {
+ public Builder setCanHandleDiseqcRxMessage(boolean canHandleDiseqcMessage) {
if (TunerVersionChecker.checkHigherOrEqualVersionTo(
- TunerVersionChecker.TUNER_VERSION_1_1, "setCouldHandleDiseqcRxMessage")) {
- mIsDiseqcRxMessage = couldReceiveDiseqcMessage;
+ TunerVersionChecker.TUNER_VERSION_1_1, "setCanHandleDiseqcRxMessage")) {
+ mIsDiseqcRxMessage = canHandleDiseqcMessage;
}
return this;
}
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index 948ebcd..6a622c5a 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -68,7 +68,7 @@
mClass = (jclass)env->NewGlobalRef(clazz);
mObject = env->NewWeakGlobalRef(thiz);
- mImpl = new NuMediaExtractor;
+ mImpl = new NuMediaExtractor(NuMediaExtractor::EntryPoint::SDK);
}
JMediaExtractor::~JMediaExtractor() {
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp
index 126897a..ddc51cd 100644
--- a/media/jni/android_media_MediaMetadataRetriever.cpp
+++ b/media/jni/android_media_MediaMetadataRetriever.cpp
@@ -464,11 +464,13 @@
|| thumbPixels * 6 >= maxPixels) {
frameMemory = retriever->getImageAtIndex(
index, colorFormat, false /*metaOnly*/, true /*thumbnail*/);
- // TODO: Using unsecurePointer() has some associated security pitfalls
- // (see declaration for details).
- // Either document why it is safe in this case or address the
- // issue (e.g. by copying).
- videoFrame = static_cast<VideoFrame *>(frameMemory->unsecurePointer());
+ if (frameMemory != 0) {
+ // TODO: Using unsecurePointer() has some associated security pitfalls
+ // (see declaration for details).
+ // Either document why it is safe in this case or address the
+ // issue (e.g. by copying).
+ videoFrame = static_cast<VideoFrame *>(frameMemory->unsecurePointer());
+ }
if (thumbPixels > maxPixels) {
int downscale = ceil(sqrt(thumbPixels / (float)maxPixels));
diff --git a/media/mca/effect/java/android/media/effect/OWNERS b/media/mca/effect/java/android/media/effect/OWNERS
new file mode 100644
index 0000000..6a351d3
--- /dev/null
+++ b/media/mca/effect/java/android/media/effect/OWNERS
@@ -0,0 +1 @@
+elaurent@google.com
diff --git a/media/mca/effect/java/android/media/effect/effects/OWNERS b/media/mca/effect/java/android/media/effect/effects/OWNERS
new file mode 100644
index 0000000..6a351d3
--- /dev/null
+++ b/media/mca/effect/java/android/media/effect/effects/OWNERS
@@ -0,0 +1 @@
+elaurent@google.com
diff --git a/media/mca/filterfw/java/android/filterfw/OWNERS b/media/mca/filterfw/java/android/filterfw/OWNERS
new file mode 100644
index 0000000..5d351ef
--- /dev/null
+++ b/media/mca/filterfw/java/android/filterfw/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 50018
+
+elaurent@google.com
diff --git a/media/mca/filterfw/java/android/filterfw/samples/OWNERS b/media/mca/filterfw/java/android/filterfw/samples/OWNERS
new file mode 100644
index 0000000..5d351ef
--- /dev/null
+++ b/media/mca/filterfw/java/android/filterfw/samples/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 50018
+
+elaurent@google.com
diff --git a/media/native/midi/amidi.cpp b/media/native/midi/amidi.cpp
index 35c4d42..923377c 100644
--- a/media/native/midi/amidi.cpp
+++ b/media/native/midi/amidi.cpp
@@ -131,7 +131,7 @@
MidiDeviceInfo deviceInfo;
Status txResult = device->server->getDeviceInfo(&deviceInfo);
if (!txResult.isOk()) {
- ALOGE("AMIDI_getDeviceInfo transaction error: %d", txResult.transactionError());
+ ALOGE("%s server exception code: %d", __func__, txResult.exceptionCode());
return AMEDIA_ERROR_UNKNOWN;
}
@@ -253,7 +253,7 @@
? device->server->openOutputPort(portToken, portNumber, &ufd)
: device->server->openInputPort(portToken, portNumber, &ufd);
if (!txResult.isOk()) {
- ALOGE("AMIDI_openPort transaction error: %d", txResult.transactionError());
+ ALOGE("%s server exception code: %d", __func__, txResult.exceptionCode());
return AMEDIA_ERROR_UNKNOWN;
}
@@ -282,7 +282,7 @@
Status txResult = port->device->server->closePort(port->binderToken);
if (!txResult.isOk()) {
- ALOGE("Transaction error closing MIDI port:%d", txResult.transactionError());
+ ALOGE("%s server exception code: %d", __func__, txResult.exceptionCode());
}
delete port;
diff --git a/mime/OWNERS b/mime/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/mime/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/mime/java-res/android.mime.types b/mime/java-res/android.mime.types
index e5273a9..92365d1 100644
--- a/mime/java-res/android.mime.types
+++ b/mime/java-res/android.mime.types
@@ -63,6 +63,7 @@
?application/x-android-drm-fl fl
?application/x-flac flac
?application/x-font pcf
+?application/x-mobipocket-ebook prc mobi
?application/x-mpegurl m3u m3u8
?application/x-pem-file pem
?application/x-pkcs12 p12 pfx
diff --git a/native/android/aidl/com/android/internal/compat/OWNERS b/native/android/aidl/com/android/internal/compat/OWNERS
new file mode 100644
index 0000000..f8c3520
--- /dev/null
+++ b/native/android/aidl/com/android/internal/compat/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/compat/OWNERS
diff --git a/native/graphics/OWNERS b/native/graphics/OWNERS
new file mode 100644
index 0000000..a6d1bc3
--- /dev/null
+++ b/native/graphics/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/graphics/OWNERS
diff --git a/opengl/java/android/opengl/OWNERS b/opengl/java/android/opengl/OWNERS
new file mode 100644
index 0000000..9c6c610
--- /dev/null
+++ b/opengl/java/android/opengl/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 25421
+
+sumir@google.com
+prahladk@google.com
diff --git a/packages/AppPredictionLib/OWNERS b/packages/AppPredictionLib/OWNERS
new file mode 100644
index 0000000..3a5d23d
--- /dev/null
+++ b/packages/AppPredictionLib/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/appprediction/OWNERS
diff --git a/packages/Backup/OWNERS b/packages/Backup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/packages/Backup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/packages/BackupEncryption/OWNERS b/packages/BackupEncryption/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/packages/BackupEncryption/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/packages/BackupRestoreConfirmation/OWNERS b/packages/BackupRestoreConfirmation/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/packages/BackupRestoreConfirmation/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/packages/Connectivity/OWNERS b/packages/Connectivity/OWNERS
new file mode 100644
index 0000000..48e54da
--- /dev/null
+++ b/packages/Connectivity/OWNERS
@@ -0,0 +1,3 @@
+set noparent
+
+include platform/frameworks/base:/services/core/java/com/android/server/net/OWNERS
diff --git a/packages/CtsShim/build/Android.bp b/packages/CtsShim/build/Android.bp
index 43e3868..14a3376 100644
--- a/packages/CtsShim/build/Android.bp
+++ b/packages/CtsShim/build/Android.bp
@@ -34,6 +34,8 @@
compile_multilib: "both",
jni_libs: ["libshim_jni"],
+
+ uses_libs: ["android.test.runner"],
}
genrule {
@@ -108,6 +110,7 @@
compile_multilib: "both",
jni_libs: ["libshim_jni"],
+ uses_libs: ["android.test.runner"],
}
//##########################################################
diff --git a/packages/EasterEgg/OWNERS b/packages/EasterEgg/OWNERS
new file mode 100644
index 0000000..2e96c97
--- /dev/null
+++ b/packages/EasterEgg/OWNERS
@@ -0,0 +1 @@
+include /packages/SystemUI/OWNERS
diff --git a/packages/ExternalStorageProvider/OWNERS b/packages/ExternalStorageProvider/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/packages/ExternalStorageProvider/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/packages/FusedLocation/OWNERS b/packages/FusedLocation/OWNERS
new file mode 100644
index 0000000..5ac6028
--- /dev/null
+++ b/packages/FusedLocation/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/location/OWNERS
diff --git a/packages/MtpDocumentsProvider/OWNERS b/packages/MtpDocumentsProvider/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/packages/MtpDocumentsProvider/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/packages/OsuLogin/res/values-my/strings.xml b/packages/OsuLogin/res/values-my/strings.xml
deleted file mode 100644
index 1bd992e..0000000
--- a/packages/OsuLogin/res/values-my/strings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_name" msgid="8288271429327488421">"OsuLogin"</string>
- <string name="action_bar_label" msgid="550995560341508693">"အွန်လိုင်း အကောင့်ဖွင့်ရန်"</string>
- <string name="sign_up_failed" msgid="837216244603867568">"အကောင့်ဖွင့်၍ မရပါ"</string>
-</resources>
diff --git a/packages/PrintRecommendationService/OWNERS b/packages/PrintRecommendationService/OWNERS
new file mode 100644
index 0000000..2c7b881
--- /dev/null
+++ b/packages/PrintRecommendationService/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/print/OWNERS
diff --git a/packages/PrintSpooler/OWNERS b/packages/PrintSpooler/OWNERS
new file mode 100644
index 0000000..2c7b881
--- /dev/null
+++ b/packages/PrintSpooler/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/print/OWNERS
diff --git a/packages/SettingsLib/HelpUtils/res/values-ar/strings.xml b/packages/SettingsLib/HelpUtils/res/values-ar/strings.xml
index 7ab3abc..5b12fc5 100644
--- a/packages/SettingsLib/HelpUtils/res/values-ar/strings.xml
+++ b/packages/SettingsLib/HelpUtils/res/values-ar/strings.xml
@@ -17,5 +17,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="help_feedback_label" msgid="7106780063063027882">"المساعدة والتعليقات"</string>
+ <string name="help_feedback_label" msgid="7106780063063027882">"المساعدة والملاحظات والآراء"</string>
</resources>
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index 41af185..438e8b8 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktief. Tik om te wissel."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Programbystandstatus:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Mediakodewisselinginstellings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Deaktiveer kodewisseling"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ignoreer kodewisselingverstekke"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktiveer kodewisseling"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Aanvaar dat programme moderne formate steun"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktiveer kodewisseling vir programme"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Lopende dienste"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Sien en beheer dienste wat tans aktief is"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> oor tot battery gelaai is"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> tot battery gelaai is"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery word tydelik beperk"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimeer tans vir batterygesondheid"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Onbekend"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Laai"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Laai tans vinnig"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index 8e4e402..fd5777d 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ገቢር። ለመቀያየር ነካ ያድርጉ።"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"የመተግበሪያ ዝግጁ የመሆን ሁኔታ፦<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"የሚዲያ ትራንስኮዲንግ ቅንብሮች"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ትራንስኮንግን አሰናክል"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"የትራንስኮዲንግ ነባሪዎችን ሻር"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ትራንስኮዲንግን ያንቁ"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"መተግበሪያዎች ዘመናዊ ቅርጸቶችን እንደሚደግፉ አድርገው ይቁጠሩ"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ለመተግበሪያዎች ትራንስኮዲንግን ያንቁ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"አሂድ አገልግሎቶች"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"በአሁኑጊዜ እየሄዱ ያሉ አገልግሎቶችን ተቆጣጠር እና እይ"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ኃይል እስከሚሞላ ድረስ ይቀራል"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ኃይል እስከሚሞላ ድረስ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ባትሪ ለጊዜው ተገድቧል"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ለባትሪ ጤና ማመቻቸት"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ያልታወቀ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ኃይል በመሙላት ላይ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ኃይል በፍጥነት በመሙላት ላይ"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index 691ec046..b81031e 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"نشط، انقر للتبديل."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"حالة تطبيق وضع الاستعداد:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"إعدادات تحويل ترميز الوسائط"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"إيقاف تحويل الترميز"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"إلغاء الإعدادات التلقائية لتحويل الترميز"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"تفعيل تحويل الترميز"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"افتراض أن التطبيق يتوافق مع التنسيقات الحديثة"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"تفعيل تحويل الترميز للتطبيقات"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"الخدمات قيد التشغيل"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"عرض الخدمات قيد التشغيل في الوقت الحالي والتحكم فيها"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> إلى أن يتم شحن الجهاز بالكامل"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> إلى أن يتم شحن الجهاز بالكامل"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - تأثير محدود على البطارية مؤقتًا"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - التحسين لسلامة البطارية"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"غير معروف"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"جارٍ الشحن"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"جارٍ الشحن سريعًا"</string>
@@ -518,7 +520,7 @@
<string name="media_transfer_this_device_name" msgid="2716555073132169240">"مكبر صوت الهاتف"</string>
<string name="profile_connect_timeout_subtext" msgid="4043408193005851761">"حدثت مشكلة أثناء الاتصال. يُرجى إيقاف الجهاز ثم إعادة تشغيله."</string>
<string name="media_transfer_wired_device_name" msgid="4447880899964056007">"جهاز سماعي سلكي"</string>
- <string name="help_label" msgid="3528360748637781274">"المساعدة والتعليقات"</string>
+ <string name="help_label" msgid="3528360748637781274">"المساعدة والملاحظات والآراء"</string>
<string name="storage_category" msgid="2287342585424631813">"مساحة التخزين"</string>
<string name="shared_data_title" msgid="1017034836800864953">"البيانات المشتركة"</string>
<string name="shared_data_summary" msgid="5516326713822885652">"عرض البيانات المشتركة وتعديلها"</string>
diff --git a/packages/SettingsLib/res/values-as/strings.xml b/packages/SettingsLib/res/values-as/strings.xml
index 61214e0..e482329 100644
--- a/packages/SettingsLib/res/values-as/strings.xml
+++ b/packages/SettingsLib/res/values-as/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"সক্ৰিয়। ট\'গল কৰিবলৈ টিপক।"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"এপ্ ষ্টেণ্ডবাই অৱস্থাত আছে:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"মিডিয়া ট্ৰান্সক\'ডিঙৰ ছেটিং"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ট্ৰান্সক\'ডিং অক্ষম কৰক"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ট্ৰেন্সক’ডিং ডিফ’ল্ট অ’ভাৰৰাইড কৰক"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ট্ৰেন্সক’ডিং সক্ষম কৰক"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"এপে আধুনিক ফৰ্মেট সমৰ্থন কৰে বুলি ধৰি লওক"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"এপৰ বাবে ট্ৰান্সক\'ডিং সক্ষম কৰক"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"চলিত সেৱা"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"বৰ্তমান চলি থকা সেৱাসমূহ চাওক আৰু নিয়ন্ত্ৰণ কৰক"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"চাৰ্জ হ’বলৈ <xliff:g id="TIME">%1$s</xliff:g> বাকী আছে"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> চাৰ্জ হ\'বলৈ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - বেটাৰী সাময়িকভাৱে সীমিত কৰা হৈছে"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - বেটাৰীৰ অৱস্থা অপ্টিমাইজ কৰি থকা হৈছে"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"অজ্ঞাত"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"চাৰ্জ কৰি থকা হৈছে"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"দ্ৰুততাৰে চাৰ্জ হৈছে"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index db61527..637785d 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivdir. Keçid etmək üçün basın."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Tətbiqin gözləmə rejimi:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media yenidən kodlaşdırma ayarları"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Yenidən kodlaşdırmanı deaktiv edin"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Yenidən kodlaşdırma defoltlarını əvəzləyin"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Yenidən kodlaşdırmanı aktiv edin"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Tətbiqlərin müasir formatları dəstəklədiyini qəbul edin"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Tətbiqlər üçün yenidən kodlaşdırmanı aktiv edin"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"İşləyən xidmətlər"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Hazırda prosesdə olan xidmətləri görüntüləyin və onlara nəzarət edin"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Enerjinin dolmasına <xliff:g id="TIME">%1$s</xliff:g> qalıb"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - Enerjinin dolmasına <xliff:g id="TIME">%2$s</xliff:g> qalıb"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batareya müvəqqəti məhdudlaşdırılıb"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Enerjiyə qənaət üçün optimallaşdırma"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Naməlum"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Enerji doldurma"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Sürətlə doldurulur"</string>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
index 70fb363..219d5a0 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivna. Dodirnite da biste je deaktivirali."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje pripravnosti aplikacije: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Podešavanja transkodiranja medija"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogući transkodiranje"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Zameni podrazumevana podešavanja transkodiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogući transkodiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Podrazumevaj da aplikacije podržavaju moderne formate"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogućite transkodiranje za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Pokrenute usluge"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Prikaz i kontrola trenutno pokrenutih usluga"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Napuniće se za <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – napuniće se za <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – baterija je trenutno ograničena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimizuje se radi stanja baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nepoznato"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Puni se"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Brzo se puni"</string>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 8a0db82..4772e03 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Актыўная. Краніце, каб пераключыць."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Стан праграмы ў рэжыме чакання: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Налады перакадзіравання мультымедыя"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Выключыць перакадзіраванне"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Уключыць перакадзіраванне для праграм"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Запушчаныя службы"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Прагляд запушчаных службаў i кіраванне iмi"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Засталося <xliff:g id="TIME">%1$s</xliff:g> да поўнай зарадкі"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> да поўнай зарадкі"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – зарад акумулятара часова абмежаваны"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Аптымізацыя стану акумулятара"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Невядома"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Зарадка"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Хуткая зарадка"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index 27dcf10..75d1eeb 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активно. Докоснете, за да превключите."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Състояние на готовност на приложението: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Настройки за прекодирането на мултимедия"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Деактивиране на прекодирането"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Отмяна на стандартните настройки за прекодирането"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Активиране на прекодирането"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Предполагане, че приложенията поддържат съвременни формати"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Активиране на прекодирането за приложения"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Изпълнявани услуги"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Преглед и контрол върху изпълняващите се понастоящем услуги"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Оставащо време до пълно зареждане: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> до пълно зареждане"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Батерията е временно ограничена"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Оптимизиране за състоян. на батерията"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Неизвестно"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Зарежда се"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Зарежда се бързо"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index 29862e6..325f2bd 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"সক্রিয় রয়েছে৷ টগল করতে আলতো চাপুন৷"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"অ্যাপ স্ট্যান্ডবাই-এর অবস্থা:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"মিডিয়া ট্রান্সকোডিং সেটিংস"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ট্রান্সকোডিং বন্ধ করুন"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"অ্যাপের জন্য ট্রান্সকোডিং চালু করুন"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"এখন চলছে যে পরিষেবাগুলি"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"বর্তমান চলমান পরিষেবাগুলি দেখুন এবং নিয়ন্ত্রণ করুন"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"সম্পূর্ণ চার্জ হতে <xliff:g id="TIME">%1$s</xliff:g> বাকি আছে"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>-এ সম্পূর্ণ চার্জ হয়ে যাবে"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ব্যাটারি কিছুক্ষণের জন্য সীমিত করা হয়েছে"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ব্যাটারির চার্জ অপটিমাইজ করা হচ্ছে"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"অজানা"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"চার্জ হচ্ছে"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"দ্রুত চার্জ হচ্ছে"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index 4704ec8..ab4ac14 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Greška u konfiguraciji IP-a"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Niste povezani zbog slabog kvaliteta mreže"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Greška pri povezivanju na WiFi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problem pri autentifikaciji."</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problem pri autentifikaciji"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Nije se moguće povezati"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"Nije se moguće povezati na aplikaciju \'<xliff:g id="AP_NAME">%1$s</xliff:g>\'"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Provjerite lozinku i pokušajte ponovo"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivno. Dodirnite za promjenu opcije."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje mirovanja aplikacije:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Postavke transkodiranja medija"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogućite transkodiranje"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Zaobiđi zadane postavke transkodiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogući transkodiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Pretpostavi da aplikacije podržavaju moderne formate"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogućite transkodiranje za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Pokrenute usluge"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Prikaz i kontrola trenutno pokrenutih usluga"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Napunit će se za <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – napunit će se za <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Baterija je privremeno ograničena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimiziranje radi očuvanja baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nepoznato"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Punjenje"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Brzo punjenje"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index 5d04963..9bb919f 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aplicació activa. Toca per desactivar-la."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estat de les aplicacions inactives: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuració de la transcodificació de contingut multimèdia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desactiva la transcodificació"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substitueix els valors predeterminats de la transcodificació"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activa la transcodificació"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assumeix que les aplicacions són compatibles amb formats moderns"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activa la transcodificació per a les aplicacions"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serveis en execució"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualitza i controla els serveis en execució"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> per completar la càrrega"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> per completar la càrrega"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria limitada temporalment"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: optimitzant per a l\'estat de la bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconegut"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"S\'està carregant"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregant ràpidament"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index a99a4da..5f2e005 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivní. Klepnutím možnost přepnete."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stav pohotovostního režimu aplikace: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Nastavení překódování médií"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Zakázat překódování"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Přepsat výchozí nastavení překódování"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Povolit překódování"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Předpokládat, že aplikace podporují moderní formáty"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Povolit překódování pro aplikace"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Spuštěné služby"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Umožňuje zobrazit a ovládat aktuálně spuštěné služby"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Do nabití zbývá: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> do nabití"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Baterie dočasně omezena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimalizace pro výdrž baterie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Neznámé"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Nabíjí se"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Rychlé nabíjení"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index c90155e..f4f4650 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Tryk for at skifte."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Standbystatus for appen:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Indstillinger for omkodning af medier"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Deaktiver omkodning"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Tilsidesæt standardindstillingerne for omkodning"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktivér omkodning"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Gå ud fra, at apps understøtter moderne formater"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktivér omkodning for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Kørende tjenester"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Vis og administrer kørende tjenester"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Opladet om <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – opladet om <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batteriet er midlertidigt begrænset"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimerer batteritilstanden"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ukendt"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Oplader"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Oplader hurtigt"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index b5b9fc4..1d6894b 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Zum Wechseln tippen."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Standby-Status der App:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Einstellungen für Medientranscodierung"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Transcodierung deaktivieren"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Transcodierung für Apps aktivieren"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktive Dienste"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Momentan ausgeführte Dienste anzeigen und steuern"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Noch <xliff:g id="TIME">%1$s</xliff:g> bis zur Aufladung"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> bis zur Aufladung"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akku vorübergehend eingeschränkt"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimierung des Akkuzustands"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unbekannt"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Wird aufgeladen"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Schnelles Aufladen"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index 203ec40..3affbce 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ενεργό. Πατήστε για εναλλαγή."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Κατάσταση αναμονής εφαρμογής:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Ρυθμίσεις διακωδικοποίησης μέσων"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Απενεργοποίηση διακωδικοποίησης"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Παράκαμψη προεπιλογών διακωδικοποίησης"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ενεργοποίηση διακωδικοποίησης"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Να θεωρείται ότι οι εφαρμογές χρησιμοποιούν σύγχρονες μορφές"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ενεργοποίηση διακωδικοποίησης για εφαρμογές"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Υπηρεσίες που εκτελούνται"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Προβολή και έλεγχος των εφαρμογών που εκτελούνται αυτή τη στιγμή"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Απομένουν <xliff:g id="TIME">%1$s</xliff:g> για ολοκλήρωση της φόρτισης"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> για την ολοκλήρωση της φόρτισης"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Η μπαταρία περιορίστηκε προσωρινά."</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Βελτιστοποίηση κατάστασης μπαταρίας"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Άγνωστο"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Φόρτιση"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ταχεία φόρτιση"</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index f8019d2..9d5debb 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rCA/strings.xml b/packages/SettingsLib/res/values-en-rCA/strings.xml
index 7135de5..b0190a2 100644
--- a/packages/SettingsLib/res/values-en-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-en-rCA/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index f8019d2..9d5debb 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index f8019d2..9d5debb 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rXC/strings.xml b/packages/SettingsLib/res/values-en-rXC/strings.xml
index 54290d2..9296a59 100644
--- a/packages/SettingsLib/res/values-en-rXC/strings.xml
+++ b/packages/SettingsLib/res/values-en-rXC/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Optimizing for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index 08ff550..41466be 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Activa. Presiona para activar o desactivar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado de la app en espera: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuración de transcodificación de contenido multimedia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Inhabilitar transcodificación"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Anular los valores predeterminados de transcodificación"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Habilitar la transcodificación"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Suponer que las apps admiten formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Habilitar transcodificación en apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"En ejecución"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ver y controlar servicios actuales en ejecución"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> para completar la carga"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> para completar la carga"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batería limitada temporalmente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: Optimizando el estado de la batería"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconocido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Cargando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Cargando rápido"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index 6f6a1a1..8a0a123 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Activa. Toca para alternar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado de la aplicación en espera: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuración de la transcodificación multimedia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Inhabilitar transcodificación"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Anular valores predeterminados de transcodificación"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Habilitar transcodificación"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que las aplicaciones admiten formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Habilitar transcodificación en las aplicaciones"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servicios en ejecución"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ver y controlar los servicios en ejecución"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> hasta cargarse completamente"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> (<xliff:g id="TIME">%2$s</xliff:g> hasta cargarse completamente)"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: batería limitada temporalmente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: preservando estado de la batería"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconocido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Cargando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Cargando rápidamente"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index 9d6326e..4b82c08 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiivne. Puudutage vahetamiseks."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Rakenduse ootelolek:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Meedia transkodeerimise seaded"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Keela transkodeerimine"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Alista transkodeerimise vaikeseaded"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Luba transkodeerimine"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Oleta, et rakendused toetavad kaasaegseid vorminguid"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Luba rakenduste puhul transkodeerimine"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Käitatud teenused"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Praegu käitatud teenuste vaatamine ja juhtimine"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Täislaadimiseni on jäänud <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> täislaadimiseni"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – akutase on ajutiselt piiratud"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – optimeerimine aku seisukorra põhjal"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tundmatu"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Laadimine"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Kiirlaadimine"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index 01afa17..37c1fd8 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktibo. Aldatzeko, sakatu hau."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Egonean moduko aplikazioaren egoera: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Multimedia-edukia transkodetzeko ezarpenak"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desgaitu transkodetzeko aukera"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ez erabili transkodetzearen balio lehenetsiak"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Gaitu transkodetzea"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Arduratu aplikazioek formatu modernoak onartzeaz"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Gaitu aplikazioak transkodetzeko aukera"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Abian diren zerbitzuak"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ikusi eta kontrolatu une honetan abian diren zerbitzuak"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> guztiz kargatu arte"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> guztiz kargatu arte"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria mugatuta egongo da aldi batez"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Optimizatzen bateria egoera onean mantentzeko"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ezezaguna"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Kargatzen"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Bizkor kargatzen"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index dd7ab96..7d20aaf 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -34,7 +34,7 @@
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"گذرواژه را بررسی و دوباره امتحان کنید"</string>
<string name="wifi_not_in_range" msgid="1541760821805777772">"در محدوده نیست"</string>
<string name="wifi_no_internet_no_reconnect" msgid="821591791066497347">"اتصال بهصورت خودکار انجام نمیشود"</string>
- <string name="wifi_no_internet" msgid="1774198889176926299">"بدون دسترسی به اینترنت"</string>
+ <string name="wifi_no_internet" msgid="1774198889176926299">"دسترسی به اینترنت ندارد"</string>
<string name="saved_network" msgid="7143698034077223645">"ذخیرهشده توسط <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="connected_via_network_scorer" msgid="7665725527352893558">"اتصال خودکار ازطریق %1$s"</string>
<string name="connected_via_network_scorer_default" msgid="7973529709744526285">"اتصال خودکار ازطریق ارائهدهنده رتبهبندی شبکه"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"فعال. برای تغییر حالت ضربه بزنید."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"وضعیت حالت آماده بهکار برنامه:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"تنظیمات تراتبدیل رسانه"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"غیرفعال کردن تراتبدیل"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ملغی کردن پیشفرضهای تراتبدیل"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"فعال کردن تراتبدیل"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"فرض شود برنامهها از قالبهای مدرن پشتیبانی میکنند"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"فعال کردن تراتبدیل برای برنامهها"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"سرویسهای در حال اجرا"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"مشاهده و کنترل سرویسهای در حال اجرای فعلی"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> مانده تا شارژ کامل"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> تا شارژ کامل"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - باتری موقتاً محدود شده است"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - بهینهسازی برای سلامت باتری"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ناشناس"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"در حال شارژ شدن"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"درحال شارژ شدن سریع"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index b86b02d..a43c5d7 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiivinen. Vaihda koskettamalla."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Sovelluksen valmiusluokka: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Median transkoodausasetukset"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Poista transkoodaus käytöstä"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ohita transkoodauksen oletukset"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Salli transkoodaus"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Oleta, että sovellukset tukevat nykyaikaisia formaatteja"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ota sovellusten transkoodaus käyttöön"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Käynnissä olevat palvelut"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Tarkastele ja hallitse käynnissä olevia palveluita."</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> jäljellä täyteen lataukseen"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> täyteen lataukseen"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akun käyttöä rajoitettu tilapäisesti"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akun kunnon optimointi"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tuntematon"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Ladataan"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Nopea lataus"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index 0bca1db..0cb7b17 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Application active. Touchez ici pour la désactiver."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"État de l\'application en veille :<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Paramètres de transcodage des éléments multimédias"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Désactiver le transcodage"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Remplacer les valeurs par défaut de transcodage"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activer le transcodage"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Présumer que les applications prennent en charge les formats modernes"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activer le transcodage pour les applications"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Services en cours d\'exécution"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Afficher et contrôler les services en cours d\'exécution"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> jusqu\'à la charge complète"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> : <xliff:g id="TIME">%2$s</xliff:g> jusqu\'à la charge complète"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Pile limitée temporairement"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimisation pour la santé de la pile"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Inconnu"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charge en cours…"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Recharge rapide"</string>
diff --git a/packages/SettingsLib/res/values-fr/strings.xml b/packages/SettingsLib/res/values-fr/strings.xml
index ebde43b..e928a48 100644
--- a/packages/SettingsLib/res/values-fr/strings.xml
+++ b/packages/SettingsLib/res/values-fr/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Échec de configuration de l\'adresse IP"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Non connecté en raison de la faible qualité du réseau"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Échec de la connexion Wi-Fi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problème d\'authentification."</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problème d\'authentification"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Connexion impossible"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"Impossible de se connecter au réseau \"<xliff:g id="AP_NAME">%1$s</xliff:g>\""</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Vérifiez le mot de passe et réessayez"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Application active. Appuyez ici pour la désactiver."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"État de mise en veille de l\'application : <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Paramètres de transcodage des contenus multimédias"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Désactiver le transcodage"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ignorer les paramètres de transcodage par défaut"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activer le transcodage"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Supposer que les applications sont compatibles avec les formats modernes"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activer le transcodage pour les applications"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Services en cours d\'exécution"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Afficher et contrôler les services en cours d\'exécution"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> jusqu\'à ce que la batterie soit chargée"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> jusqu\'à la charge complète"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batterie limitée temporairement"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Optimisation pour préserver batterie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Inconnu"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Batterie en charge"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charge rapide"</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index b040817..c439253 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aplicación activa. Toca para alternar a configuración."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado en espera da aplicación: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuración de transcodificación de contido multimedia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desactivar transcodificación"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Anular valores predeterminados de transcodificación"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activar transcodificación"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que as aplicacións admiten formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activar transcodificación para as aplicacións"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servizos en uso"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Comproba e controla os servizos actualmente en uso"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> para completar a carga"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> para completar a carga"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> (batería limitada temporalmente)"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: optimizando para manter a batería en bo estado"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Descoñecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Cargando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Cargando rapidamente"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index c1bd7ca..7dfdcee 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"સક્રિય. ટોગલ કરવા માટે ટૅપ કરો."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ઍપ સ્ટૅન્ડબાયની સ્થિતિ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"મીડિયાનું ફૉર્મેટ બદલવાની પ્રક્રિયાના સેટિંગ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ફૉર્મેટ બદલવાની પ્રક્રિયા બંધ કરો"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ઍપ માટે ફૉર્મેટ બદલવાની પ્રક્રિયા ચાલુ કરો"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ચાલુ સેવાઓ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"હાલમાં ચાલતી સેવાઓ જુઓ અને નિયંત્રિત કરો"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ચાર્જ થવામાં <xliff:g id="TIME">%1$s</xliff:g> બાકી છે"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ચાર્જ થવા માટે <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - બૅટરીનો વપરાશ હંગામી રૂપે મર્યાદિત છે"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> • બૅટરીની ક્ષમતા વધારવા ઑપ્ટિમાઇઝ કરી રહ્યાં છીએ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"અજાણ્યું"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ચાર્જ થઈ રહ્યું છે"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ઝડપથી ચાર્જ થાય છે"</string>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index d9153a1..26d1a756 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP कॉन्फ़िगरेशन की विफलता"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"खराब नेटवर्क होने के कारण कनेक्ट नहीं हुआ"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"वाईफ़ाई कनेक्शन विफलता"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"प्रमाणीकरण समस्या"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"पुष्टि नहीं हो सकी"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"कनेक्ट नहीं हो पा रहा है"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\' से कनेक्ट नहीं हो पा रहा है"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"पासवर्ड जाँचें और दोबारा कोशिश करें"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"सक्रिय. टॉगल करने के लिए टैप करें."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ऐप्लिकेशन स्टैंडबाय की स्थिति:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"मीडिया ट्रांसकोडिंग सेटिंग"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ट्रांसकोडिंग को बंद करें"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ट्रांसकोडिंग की डिफ़ॉल्ट सेटिंग बदलें"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ट्रांसकोडिंग चालू करें"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"मानकर चलें कि ऐप्लिकेशन, मॉडर्न फ़ॉर्मैट के साथ काम करेंगे"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ऐप्लिकेशन के लिए ट्रांसकोडिंग चालू करें"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"चल रही सेवाएं"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"इस समय चल रही सेवाओं को देखें और नियंत्रित करें"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"चार्ज पूरा होने में <xliff:g id="TIME">%1$s</xliff:g> बचा है"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> में पूरा चार्ज हो जाएगा"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - कुछ समय के लिए, बैटरी का सीमित इस्तेमाल होगा"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - बैटरी की परफ़ॉर्मेंस बेहतर करने के लिए, ऑप्टिमाइज़ किया जा रहा है"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"अज्ञात"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"चार्ज हो रही है"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"तेज़ चार्ज हो रही है"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index b51e096..eccfd7a 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivno. Dodirnite da biste to promijenili."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje aplikacije u mirovanju: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Postavke konvertiranja medija"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogućivanje konvertiranja"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Nadjačaj zadane postavke konvertiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogući konvertiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Pretpostavi da aplikacije podržavaju moderne formate"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogućivanje konvertiranja za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Pokrenute usluge"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Pregledajte i kontrolirajte pokrenute usluge"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Napunit će se za <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – napunit će se za <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Baterija je privremeno ograničena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimiziranje radi zdravlja baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nepoznato"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Punjenje"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Brzo punjenje"</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index 33770fc..e5d4bd1 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Bekapcsolva. Koppintson ide a váltáshoz."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Alkalmazás készenléti állapota:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Médiaátkódolási beállítások"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Átkódolás letiltása"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Az átkódolás alapértelmezett beállításainak felülbírálása"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Átkódolás engedélyezése"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Annak feltételezése, hogy az alkalmazások támogatják a modern formátumokat"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Átkódolás engedélyezése az alkalmazásoknál"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Futó szolgáltatások"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"A jelenleg futó szolgáltatások megtekintése és vezérlése"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> van hátra a feltöltésből"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> a feltöltésig"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akkumulátor ideiglenesen korlátozva"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akkumulátor-élettartam optimalizálása"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ismeretlen"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Töltés"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Gyorstöltés"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index 06d70f8..53eb766 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ակտիվ է: Հպեք՝ փոխելու համար:"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Հավելվածի սպասման կարգավիճակ՝ <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Մեդիա ֆայլերի վերակոդավորման կարգավորումներ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Անջատել վերակոդավորումը"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Չեղարկել վերակոդավորման կանխադրված կարգավորումները"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Միացնել վերակոդավորումը"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Ենթադրել, որ հավելվածներն աջակցում են ժամանակակից ձևաչափեր"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Միացնել վերակոդավորումը հավելվածների համար"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Աշխատող ծառայություններ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Դիտել և վերահսկել ընթացիկ աշխատող ծառայությունները"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> մինչև լիցքավորումը"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> մինչև լիցքավորումը"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Մարտկոցը ժամանակավորապես սահմանափակված է"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Օպտիմալացվում է"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Անհայտ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Լիցքավորում"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Արագ լիցքավորում"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 4123d9e..edce3c5 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktif. Ketuk untuk beralih."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Status standby aplikasi:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Setelan transcoding media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Menonaktifkan transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ganti default transcoding"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktifkan transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Asumsikan aplikasi mendukung format modern"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Mengaktifkan transcoding untuk aplikasi"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Layanan yang sedang berjalan"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Melihat dan mengontrol layanan yang sedang berjalan"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Sisa <xliff:g id="TIME">%1$s</xliff:g> hingga terisi penuh"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> lagi terisi penuh"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Daya baterai terbatas untuk sementara"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Mengoptimalkan untuk kesehatan baterai"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tidak diketahui"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Mengisi daya"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Mengisi daya cepat"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index 3b9bef8..9e072cc 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Virkt. Ýttu til að breyta."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Biðstaða forrits: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Stillingar efnisumkóðunar"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Slökkva á umkóðun"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Hnekkja sjálfgefinni umkóðun"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Kveikja á umkóðun"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Gera ráð fyrir að forrit styðji nútímasnið"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Kveikja á umkóðun í forritum"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Þjónustur í gangi"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Skoða og stjórna þjónustum í gangi"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> að fullri hleðslu"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> að fullri hleðslu"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Rafhlaða takmörkuð tímabundið"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Fínstillir fyrir rafhlöðuendingu"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Óþekkt"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Í hleðslu"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Hröð hleðsla"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index 1ab6b24..fc87d89 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Attiva. Tocca per attivare/disattivare."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stato di standby dell\'app: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Impostazioni transcodifica contenuti multimediali"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disattiva transcodifica"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Sostituisci impostazioni predefinite transcodifica"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Attiva transcodifica"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Presupponi che le app supportino i formati moderni"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Attiva transcodifica per le app"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servizi in esecuzione"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualizza e controlla i servizi attualmente in esecuzione"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Tempo rimanente alla carica completa: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> alla carica completa"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batteria momentaneamente limitata"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ottimizzazione per integrità batteria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Sconosciuta"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"In carica"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ricarica veloce"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 15868d5..b899b59 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"אפליקציה פעילה. הקש כדי להחליף מצב."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"אפליקציה במצב המתנה:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"הגדרות של המרת קידוד למדיה"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"השבתה של המרת קידוד"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ביטול ברירות המחדל של המרת קידוד"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"הפעלת המרת קידוד"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"הנחת העבודה היא שאפליקציות תומכות בפורמטים מודרניים"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"הפעלה של המרת קידוד לאפליקציות"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"שירותים פועלים"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"הצגת השירותים הפועלים כעת ושליטה בהם"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"נשארו <xliff:g id="TIME">%1$s</xliff:g> עד הטעינה"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> עד הטעינה"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - הסוללה מוגבלת באופן זמני"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> ﹣ מופעל מיטוב לשמירה על תקינות הסוללה"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"לא ידוע"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"בטעינה"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"הסוללה נטענת מהר"</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index 89ee98e..ded207d 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"有効です。タップすると切り替わります。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"アプリ スタンバイ状態: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"メディアのコード変換設定"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"コード変換を無効にする"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"デフォルトのコード変換をオーバーライド"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"コード変換を有効にする"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"アプリによる最新形式のサポートを想定"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"アプリに対しコード変換を有効にする"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"実行中のサービス"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"現在実行中のサービスを表示して制御する"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"充電完了まであと <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - 充電完了まで <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 電池の使用が一時的に制限されています"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 電池の状態を最適化"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"不明"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"充電中"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"急速充電中"</string>
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index d188578..2d89dc6 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"აქტიური. შეეხეთ გადასართავად."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"აპის მოლოდინის რეჟიმის მდგომარეობა:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"მედიის ტრანსკოდირების პარამეტრები"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ტრანსკოდირების გათიშვა"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ტრანსკოდირების ნაგულისხმევების უგულებელყოფა"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ტრანსკოდირების ჩართვა"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"დაშვება, რომ აპებს აქვთ თანამედროვე ფორმატების მხარდაჭერა"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ტრანსკოდირების ჩართვა აპებისთვის"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"მიმდინარე სერვისები"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ამჟამად მოქმედი სერვისების ნახვა და მართვა"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"დატენვამდე დარჩა <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> დატენვამდე"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> — ბატარეა დროებით შეზღუდულია"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> — ოპტიმიზაცია ბატარეის გამართულობისთვის"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"უცნობი"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"იტენება"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"სწრაფად იტენება"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index 2bc1c4d..fa99529 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Белсенді. Ауыстырып қосу үшін түртіңіз."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Қолданбаның күту режимі: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Медиамазмұнды қайта кодтау параметрлері"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Қайта кодтауды өшіру"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Қайта қодтаудың әдепкі параметрлерін қайта анықтау"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Қайта кодтауды қосу"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Қолданбалар қазіргі заманғы форматтарды қолдайды делік"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Қолданбалар үшін қайта кодтауға рұқсат ету"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Қосылып тұрған қызметтер"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Қазір істеп тұрған қызметтерді көру және басқару"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Зарядталғанға дейін <xliff:g id="TIME">%1$s</xliff:g> қалды"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – зарядталғанға дейін <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батарея жұмысы уақытша шектелген"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батареяның жұмыс істеу қабілеті оңтайландырылуда"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Белгісіз"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Зарядталуда"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Жылдам зарядталуда"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index 7306cf8..a2b5e01 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"សកម្ម។ ប៉ះដើម្បីបិទ/បើក។"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ស្ថានភាពមុខងារផ្អាកដំណើរការកម្មវិធី៖<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ការកំណត់ការបំប្លែងកូដមេឌៀ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"បិទការបំប្លែងកូដ"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"លុបពីលើលំនាំដើមនៃការបំប្លែងកូដ"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"បើកការបំប្លែងកូដ"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"សន្មតថាកម្មវិធីអាចប្រើទម្រង់ទំនើបបាន"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"បើកការបំប្លែងកូដសម្រាប់កម្មវិធី"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"សេវាកម្មកំពុងដំណើរការ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"មើល និងគ្រប់គ្រងសេវាកម្មកំពុងដំណើរការបច្ចុប្បន្ន"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ទៀតទើបសាកថ្មពេញ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ទៀតទើបសាកថ្មពេញ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - បានដាក់កម្រិតថ្មជាបណ្ដោះអាសន្ន"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - កំពុងបង្កើនប្រសិទ្ធភាពគុណភាពថ្ម"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"មិនស្គាល់"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"កំពុងបញ្ចូលថ្ម"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"កំពុងសាកថ្មយ៉ាងឆាប់រហ័ស"</string>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index 0c1502c..f37cf8b 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ಸಕ್ರಿಯ. ಟಾಗಲ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ಅಪ್ಲಿಕೇಶನ್ ಸ್ಟ್ಯಾಂಡ್ಬೈ ಸ್ಥಿತಿ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ಮೀಡಿಯಾ ಟ್ರಾನ್ಸ್ಕೋಡಿಂಗ್ ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ಟ್ರಾನ್ಸ್ಕೋಡಿಂಗ್ ಅನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಿ"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ಆ್ಯಪ್ಗಳಿಗಾಗಿ ಟ್ರಾನ್ಸ್ಕೋಡಿಂಗ್ ಅನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ರನ್ ಆಗುತ್ತಿರುವ ಸೇವೆಗಳು"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ಈಗ ರನ್ ಆಗುತ್ತಿರುವ ಸೇವೆಗಳನ್ನು ವೀಕ್ಷಿಸಿ ಮತ್ತು ನಿಯಂತ್ರಿಸಿ"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ಚಾರ್ಜ್ ಆಗಲು <xliff:g id="TIME">%1$s</xliff:g> ಸಮಯ ಬಾಕಿ ಇದೆ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ಚಾರ್ಜ್ ಆಗಲು <xliff:g id="TIME">%2$s</xliff:g> ಸಮಯ ಬೇಕು"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ಬ್ಯಾಟರಿ ತಾತ್ಕಾಲಿಕವಾಗಿ ಸೀಮಿತವಾಗಿದೆ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ಬ್ಯಾಟರಿಯ ಆರೋಗ್ಯಕ್ಕಾಗಿ ಆಪ್ಟಿಮೈಸ್ ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ಅಪರಿಚಿತ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ಚಾರ್ಜ್ ಆಗುತ್ತಿದೆ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ವೇಗದ ಚಾರ್ಜಿಂಗ್"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index 1322344..73921c2 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"활성화되었습니다. 전환하려면 탭하세요."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"앱 대기 상태:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"미디어 트랜스코딩 설정"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"트랜스코딩 사용 중지"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"트랜스코딩 기본값 재정의"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"트랜스코딩 사용"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"앱이 최신 형식을 지원하는 것으로 가정"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"앱 트랜스코딩 사용 설정"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"실행 중인 서비스"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"현재 실행 중인 서비스 보기 및 제어"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"충전 완료까지 <xliff:g id="TIME">%1$s</xliff:g> 남음"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - 충전 완료까지 <xliff:g id="TIME">%2$s</xliff:g> 남음"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 일시적으로 배터리 사용 제한"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 배터리 상태 최적화 중"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"알 수 없음"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"충전 중"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"고속 충전 중"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index 9697aa7..5e978ba 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Иштеп турат. Өчүрүү үчүн басып коюңуз."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Көшүү режиминдеги колдонмонун абалы:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Медиа файлдарды транскоддоо жөндөөлөрү"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Транскоддоону өчүрүү"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Демейки жүргүзүлгөн транскоддоону өзгөртүп коюу"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Транскоддоо жүргүзүүнү иштетүү"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Колдонмолордо заманбап форматтар колдоого алынат"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Колдонмолорду транскоддоону күйгүзүү"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Иштеп жаткан кызматтар"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Учурда иштеп жаткан кызматтарды көрүп, көзөмөлдөп турасыз"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> кийин толук кубатталып бүтөт"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> кийин толук кубатталып бүтөт"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батареяны колдонуу убактлуу чектелген"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батареянын кубатын үнөмдөө иштетилди"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Белгисиз"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Кубатталууда"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ыкчам кубатталууда"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index 7201222..498cb25 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ນຳໃຊ້ຢູ່. ແຕະເພື່ອສັບປ່ຽນ."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ສະຖານະສະແຕນບາຍແອັບ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ການຕັ້ງຄ່າການປ່ຽນຮູບແບບລະຫັດມີເດຍ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ປິດການນຳໃຊ້ການປ່ຽນຮູບແບບລະຫັດ"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ຍົກເລີກຄ່າເລີ່ມຕົ້ນການປ່ຽນຮູບແບບລະຫັດ"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ເປີດການນຳໃຊ້ການປ່ຽນຮູບແບບລະຫັດ"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ສົມມຸດວ່າແອັບຮອງຮັບຮູບແບບສະໄໝໃໝ່"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ເປີດການນຳໃຊ້ການປ່ຽນຮູບແບບລະຫັດສຳລັບແອັບ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ບໍລິການທີ່ເຮັດວຽກຢູ່"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ເບິ່ງ ແລະຈັດການບໍລິການທີ່ກຳລັງເຮັດວຽກຢູ່ໃນປັດຈຸບັນ"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ຈົນກວ່າຈະສາກເຕັມ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ຈົນກວ່າຈະສາກເຕັມ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ຈຳກັດແບັດເຕີຣີຊົ່ວຄາວ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ກຳລັງເພີ່ມປະສິດທິພາບເພື່ອສຸຂະພາບແບັດເຕີຣີ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ບໍ່ຮູ້ຈັກ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ກຳລັງສາກໄຟ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ກຳລັງສາກໄຟດ່ວນ"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index e62eeb2..c077268 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktyvi. Palieskite, kad perjungtumėte."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Programų budėjimo režimo būsena: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Medijos perkodavimo nustatymai"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Išjungti perkodavimą"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Perkodavimo numatytųjų nustatymų nepaisymas"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Perkodavimo įgalinimas"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Manoma, kad programos palaiko modernius formatus"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Įjungti programų perkodavimą"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Vykdomos paslaugos"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Žiūrėti ir valdyti dabar vykdomas paslaugas"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Iki visiškos įkrovos liko <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – iki visiškos įkrovos liko <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – akumuliatorius laikinai apribotas"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – optimizuoj. siekiant apsaugoti akum."</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nežinomas"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Kraunasi..."</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Greitai įkraunama"</string>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index 2f30561..d5755511 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktīva. Pieskarieties, lai pārslēgtu."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Lietotnes gaidstāves stāvoklis: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Multivides failu pārkodēšanas iestatījumi"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Atspējot pārkodēšanu"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ignorēt pārkodēšanas noklusējuma iestatījumus"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Iespējot pārkodēšanu"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Pieņemt, ka lietotnēs tiek atbalstīti moderni formāti"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Iespējot pārkodēšanu noteiktām lietotnēm"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktīvie pakalpojumi"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Pašreiz darbojošos pakalpojumu skatīšana un vadība"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> — <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Vēl <xliff:g id="TIME">%1$s</xliff:g> līdz pilnai uzlādei"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> — <xliff:g id="TIME">%2$s</xliff:g> līdz pilnai uzlādei"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>, akumulatora uzlāde pagaidām ierobežota"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: akumulatora darbības optimizēšana"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nezināms"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Uzlāde"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Notiek ātrā uzlāde"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index 1936fe2..21dcb02 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активно. Допрете за да смените."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Состојба на мирување на апликацијата: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Поставки за транскодирање аудиовизуелни содржини"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Оневозможи транскодирање"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Отфрли стандардни вредности за транскодирање"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Овозможи транскодирање"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Претпостави дека апликациите поддржуваат модерни формати"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Овозможете транскодирање за апликациите"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Активни услуги"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Погледнете и контролирајте услуги што се моментално активни"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Уште <xliff:g id="TIME">%1$s</xliff:g> до целосно полнење"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> до целосно полнење"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батеријата е привремено ограничена"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Се оптимизира за состојба на батерија"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Непознато"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Се полни"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Брзо полнење"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index de4a49a..97c22d5 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"സജീവം. മാറ്റുന്നതിന് ടാപ്പുചെയ്യുക."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ആപ്പ് സ്റ്റാൻഡ്ബൈ നില:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"മീഡിയ ട്രാൻസ്കോഡ് ചെയ്യൽ ക്രമീകരണം"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ട്രാൻസ്കോഡ് ചെയ്യൽ പ്രവർത്തനരഹിതമാക്കുക"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ആപ്പുകൾക്കായി ട്രാൻസ്കോഡ് ചെയ്യുന്നത് പ്രവർത്തനക്ഷമമാക്കുക"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"പ്രവർത്തിക്കുന്ന സേവനങ്ങൾ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"നിലവിൽ പ്രവർത്തിക്കുന്ന സേവനങ്ങൾ കാണുക, നിയന്ത്രിക്കുക"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"പൂർണ്ണമായി ചാർജാവാൻ <xliff:g id="TIME">%1$s</xliff:g> ശേഷിക്കുന്നു"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - പൂർണ്ണമായി ചാർജാവാൻ <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ബാറ്ററി താൽക്കാലം പരിമിതപ്പെടുത്തി"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ബാറ്ററി നില ഒപ്റ്റിമൈസ് ചെയ്യുന്നു"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"അജ്ഞാതം"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ചാർജ് ചെയ്യുന്നു"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"അതിവേഗ ചാർജിംഗ്"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index dee8add..8d1cc33 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP тохируулга амжилтгүй"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Сүлжээний чанар муу байгаа тул холбогдож чадсангүй"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"WiFi холболт амжилтгүй"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Гэрчлэлийн асуудал"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Баталгаажуулалтын асуудал"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Холбогдож чадсангүй"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\'-д холбогдож чадсангүй"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Нууц үгийг шалгаад дахин оролдоно уу"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Идэвхтэй байна. Унтраах/асаахын тулд дарна уу."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Апп зогсолтын горимын төлөв:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Медиа хөрвүүлгийн тохиргоо"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Хөрвүүлгийг идэвхгүй болгох"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Хөрвүүлгийн өгөгдмөлийг дарах"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Хөрвүүлгийг идэвхжүүлэх"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Аппыг орчин үеийн форматыг дэмждэг гэж үздэг"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Аппуудад хөрвүүлгийг идэвхжүүлэх"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Ажиллаж байгаа үйлчилгээнүүд"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Одоо ажиллаж байгаа үйлчилгээнүүдийг харах болон хянах"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Цэнэглэх хүртэл үлдсэн <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - цэнэглэх хүртэл <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батарейг түр хугацаанд хязгаарласан"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батарейн чанарыг оновчилж байна"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Тодорхойгүй"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Цэнэглэж байна"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Хурдан цэнэглэж байна"</string>
@@ -534,7 +536,7 @@
<string name="user_add_user_item_title" msgid="2394272381086965029">"Хэрэглэгч"</string>
<string name="user_add_profile_item_title" msgid="3111051717414643029">"Хязгаарлагдсан профайл"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"Шинэ хэрэглэгч нэмэх үү?"</string>
- <string name="user_add_user_message_long" msgid="1527434966294733380">"Та нэмэлт хэрэглэгч үүсгэх замаар бусад хүмүүстэй энэ төхөөрөмжийг хуваалцаж болно. Хэрэглэгч тус бүр апп, ханын цаас болон бусад зүйлээ өөрчлөх боломжтой хувийн орон зайтай байдаг. Түүнчлэн хэрэглэгч нь бүх хэрэглэгчид нөлөөлөх боломжтой Wi-Fi зэрэг төхөөрөмжийн тохиргоог өөрчлөх боломжтой.\n\nХэрэв та шинэ хэрэглэгч нэмэх бол тухайн хүн хувийн орон зайгаа бүрдүүлэх ёстой.\n\nХэрэглэгч бүр бусад бүх хэрэглэгчийн өмнөөс апп шинэчилж болно. Хүртээмжийн тохиргоо болон үйлчилгээг шинэ хэрэглэгчид шилжүүлэх боломжгүй байж болзошгүй."</string>
+ <string name="user_add_user_message_long" msgid="1527434966294733380">"Та нэмэлт хэрэглэгч үүсгэх замаар бусад хүмүүстэй энэ төхөөрөмжийг хуваалцаж болно. Хэрэглэгч тус бүр апп, дэлгэцийн зураг болон бусад зүйлээ өөрчлөх боломжтой хувийн орон зайтай байдаг. Түүнчлэн хэрэглэгч нь бүх хэрэглэгчид нөлөөлөх боломжтой Wi-Fi зэрэг төхөөрөмжийн тохиргоог өөрчлөх боломжтой.\n\nХэрэв та шинэ хэрэглэгч нэмэх бол тухайн хүн хувийн орон зайгаа бүрдүүлэх ёстой.\n\nХэрэглэгч бүр бусад бүх хэрэглэгчийн өмнөөс апп шинэчилж болно. Хүртээмжийн тохиргоо болон үйлчилгээг шинэ хэрэглэгчид шилжүүлэх боломжгүй байж болзошгүй."</string>
<string name="user_add_user_message_short" msgid="3295959985795716166">"Та шинэ хэрэглэгч нэмбэл тухайн хүн өөрийн профайлыг тохируулах шаардлагатай.\n\nАль ч хэрэглэгч бүх хэрэглэгчийн апп-уудыг шинэчлэх боломжтой."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"Хэрэглэгчийг одоо тохируулах уу?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"Хэрэглэгч төхөөрөмжийг авч өөрийн профайлыг тохируулах боломжтой эсэхийг шалгана уу"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index 60ad68e..c20888e 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"सक्रिय. टॉगल करण्यासाठी टॅप करा."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"अॅप स्टँडबाय स्थिती: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"मीडिया ट्रान्सकोडिंगची सेटिंग्ज"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ट्रान्सकोडिंग बंद करा"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ॲप्ससाठी ट्रान्सकोडिंग सुरू करा"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"सुरू सेवा"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"सध्या सुरू असलेल्या सेवा पहा आणि नियंत्रित करा"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> पर्यंत पूर्ण चार्ज होईल"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> पर्यंत पूर्ण चार्ज होईल"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - बॅटरी तात्पुरती मर्यादित आहे"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - बॅटरीची क्षमता वाढवण्यासाठी ऑप्टिमाइझ करत आहे"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"अज्ञात"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"चार्ज होत आहे"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"वेगाने चार्ज होत आहे"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index e4d5912..76840a5 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktif. Ketik untuk menogol."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Keadaan tunggu sedia apl:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Tetapan transpengekodan media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Lumpuhkan transpengekodan"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Batalkan transpengekodan lalai"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Dayakan transpengekodan"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Mengambil alih sokongan apl format moden"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Dayakan transpengekodan untuk apl"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Perkhidmatan dijalankan"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Lihat dan kawal perkhidmatan yang sedang dijalankan"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> lagi sehingga dicas penuh"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> sehingga dicas"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Bateri terhad untuk sementara"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pengoptimuman untuk kesihatan bateri"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tidak diketahui"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Mengecas"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Mengecas dgn cepat"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 09a8bf8..377e49da 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP ပြုပြင်ခြင်း မအောင်မြင်ပါ"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"ကွန်ရက်ချိတ်ဆက်မှု အားနည်းသည့်အတွက် ချိတ်ဆက်ထားခြင်း မရှိပါ"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"WiFi ချိတ်ဆက်မှု မအောင်မြင်ပါ"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"စစ်မှန်ကြောင်းအတည်ပြုရန်၌ ပြသနာရှိခြင်း"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"အထောက်အထားစိစစ်မှု ပြဿနာ"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"ချိတ်ဆက်၍ မရပါ"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\' နှင့် ချိတ်ဆက်၍ မရပါ"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"စကားဝှက်ကို စစ်ဆေးပြီး ထပ်လုပ်ကြည့်ပါ"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ပွင့်နေသည်။ ပြောင်းရန်တို့ပါ။"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"အက်ပ်ကို အရန်သင့်ထားရှိခြင်း အခြေအနေ-<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"မီဒီယာအမျိုးအစားပြောင်းခြင်း ဆက်တင်များ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"အမျိုးအစားပြောင်းခြင်းကို ပိတ်ရန်"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"အမျိုးအစားပြောင်းခြင်း၏ မူရင်းဆက်တင်များကို အစားထိုးရန်"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"အမျိုးအစားပြောင်းခြင်းကို ဖွင့်ရန်"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ဤအက်ပ်များက ဖော်မက်အသစ်များကို ပံ့ပိုးသည်"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"အက်ပ်များအတွက် အမျိုးအစားပြောင်းခြင်းကို ဖွင့်ရန်"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"အလုပ်လုပ်နေသောဝန်ဆောင်မှုများ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"လက်ရှိ ဝန်ဆောင်မှုများကို ကြည့်ရှု ထိန်းသိမ်းသည်"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"အားပြည့်ရန် <xliff:g id="TIME">%1$s</xliff:g> ကျန်သည်"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - အားပြည့်ရန် <xliff:g id="TIME">%2$s</xliff:g> ကျန်သည်"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ဘက်ထရီ ယာယီကန့်သတ်ထားသည်"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ဘက်ထရီအခြေအနေကို အကောင်းဆုံးဖြစ်အောင် လုပ်နေသည်"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"မသိ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"အားသွင်းနေပါသည်"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"အမြန် အားသွင်းနေသည်"</string>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index d1af289..db93121 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -34,7 +34,7 @@
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Sjekk passordet og prøv igjen"</string>
<string name="wifi_not_in_range" msgid="1541760821805777772">"Utenfor område"</string>
<string name="wifi_no_internet_no_reconnect" msgid="821591791066497347">"Kobler ikke til automatisk"</string>
- <string name="wifi_no_internet" msgid="1774198889176926299">"Ingen Internett-tilgang"</string>
+ <string name="wifi_no_internet" msgid="1774198889176926299">"Ingen internettilgang"</string>
<string name="saved_network" msgid="7143698034077223645">"Lagret av <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="connected_via_network_scorer" msgid="7665725527352893558">"Automatisk tilkoblet via %1$s"</string>
<string name="connected_via_network_scorer_default" msgid="7973529709744526285">"Automatisk tilkoblet via leverandør av nettverksvurdering"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Trykk for å slå av/på."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Hvilemodus:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Innstillinger for omkoding av medier"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Deaktiver omkoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Overstyr omkodingsstandarder"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Slå på omkoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Anta at apper støtter moderne formater"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktiver omkoding for apper"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktive tjenester"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Se og kontrollér tjenester som kjører"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> til batteriet er fulladet"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> til batteriet er fulladet"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batteriet er midlertidig begrenset"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimaliserer batteritilstanden"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ukjent"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Lader"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Lader raskt"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index 0c6114b..25a2919 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"सक्रिय। टगल गर्न ट्याप गर्नुहोस्।"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"एपको स्ट्यान्डबाई अवस्था:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"मिडिया ट्रान्सकोडिङ सेटिङ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ट्रान्सकोडिङ अफ गर्नुहोस्"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"एपहरूमा ट्रान्सकोडिङ अन गर्नुहोस्"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"चलिरहेका सेवाहरू"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"हाल चालु भइरहेका सेवाहरू हेर्नुहोस् र नियन्त्रण गर्नुहोस्"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"पूर्ण चार्ज हुन <xliff:g id="TIME">%1$s</xliff:g> बाँकी"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"पूर्ण चार्ज हुन <xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> लाग्छ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - केही समयका लागि ब्याट्री प्रयोग सीमित गरिएको छ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ब्याट्री लामो समयसम्म टिक्ने बनाउन अप्टिमाइज गरिँदै छ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"अज्ञात"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"चार्ज हुँदै"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"द्रुत गतिमा चार्ज गरिँदै"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index a409756..0f2cc6f 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Actief. Tik om te schakelen."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stand-bystatus app: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Instellingen voor mediatranscodering"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Transcodering uitschakelen"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Standaardwaarden voor transcodering overschrijven"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Transcodering inschakelen"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Aannemen dat apps moderne indelingen ondersteunen"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Transcodering inschakelen voor apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Actieve services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Services die momenteel actief zijn, weergeven en beheren"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Nog <xliff:g id="TIME">%1$s</xliff:g> tot opgeladen"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> tot opgeladen"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batterij tijdelijk beperkt"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Optimaliseren voor batterijduur"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Onbekend"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Opladen"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Snel opladen"</string>
diff --git a/packages/SettingsLib/res/values-or/strings.xml b/packages/SettingsLib/res/values-or/strings.xml
index 0a0eeff..040dddd 100644
--- a/packages/SettingsLib/res/values-or/strings.xml
+++ b/packages/SettingsLib/res/values-or/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP କନଫିଗରେଶନ ବିଫଳ ହୋଇଛି"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"ନିମ୍ନ ମାନର ନେଟ୍ୱର୍କ କାରଣରୁ ସଂଯୁକ୍ତ ହୋଇନାହିଁ"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"ୱାଇଫାଇ ସଂଯୋଗ ବିଫଳ ହୋଇଛି"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"ସତ୍ୟାପନରେ ସମସ୍ୟା"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"ପ୍ରମାଣୀକରଣରେ ସମସ୍ୟା"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"ସଂଯୋଗ କରିପାରିବ ନାହିଁ"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\' ସହିତ ସଂଯୁକ୍ତ ହୋଇପାରୁନାହିଁ"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"ପାସ୍ୱର୍ଡ ଯାଞ୍ଚ କରନ୍ତୁ ଏବଂ ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ"</string>
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ସକ୍ରିୟ। ବଦଳାଇବା ପାଇଁ ଟାପ୍ କରନ୍ତୁ"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ଆପ୍ ଷ୍ଟାଣ୍ଡବାଏ ଅବସ୍ଥା:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ମିଡିଆ ଟ୍ରାନ୍ସକୋଡିଂ ସେଟିଂସ୍"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ଟ୍ରାନ୍ସକୋଡିଂ ଅକ୍ଷମ କରନ୍ତୁ"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ଆପଗୁଡ଼ିକ ପାଇଁ ଟ୍ରାନ୍ସକୋଡିଂ ସକ୍ଷମ କରନ୍ତୁ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ଚାଲୁଥିବା ସେବାଗୁଡ଼ିକ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ଏବେ ଚାଲୁଥିବା ସେବାଗୁଡ଼ିକୁ ଦେଖନ୍ତୁ ଓ ନିୟନ୍ତ୍ରଣ କରନ୍ତୁ"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ଚାର୍ଜ ହେବା ପାଇଁ <xliff:g id="TIME">%1$s</xliff:g> ବାକି ଅଛି"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ଚାର୍ଜ ହେବା ପର୍ଯ୍ୟନ୍ତ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ବ୍ୟାଟେରୀ ଅସ୍ଥାୟୀ ଭାବେ ସୀମିତ ଅଛି"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ବ୍ୟାଟେରୀ ହେଲ୍ଥ ପାଇଁ ଅପ୍ଟିମାଇଜ୍ ହେଉଛି"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ଅଜ୍ଞାତ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ଚାର୍ଜ ହେଉଛି"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ଶୀଘ୍ର ଚାର୍ଜ ହେଉଛି"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index c9c37d9..e6adff3 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ਕਿਰਿਆਸ਼ੀਲ। ਟੌਗਲ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ।"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ਐਪ ਸਟੈਂਡਬਾਈ ਸਥਿਤੀ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ਮੀਡੀਆ ਟ੍ਰਾਂਸਕੋਡਿੰਗ ਸੈਟਿੰਗਾਂ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ਟ੍ਰਾਂਸਕੋਡਿੰਗ ਬੰਦ ਕਰੋ"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ਐਪਾਂ ਲਈ ਟ੍ਰਾਂਸਕੋਡਿੰਗ ਚਾਲੂ ਕਰੋ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ਚੱਲ ਰਹੀਆਂ ਸੇਵਾਵਾਂ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ਇਸ ਵੇਲੇ ਚੱਲ ਰਹੀਆਂ ਸੇਵਾਵਾਂ ਦੇਖੋ ਅਤੇ ਇਹਨਾਂ ਨੂੰ ਕੰਟਰੋਲ ਕਰੋ"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ਚਾਰਜ ਹੋਣ ਵਿੱਚ <xliff:g id="TIME">%1$s</xliff:g> ਬਾਕੀ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ਤੱਕ ਚਾਰਜ ਹੋ ਜਾਵੇਗੀ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ਬੈਟਰੀ ਕੁਝ ਸਮੇਂ ਲਈ ਸੀਮਤ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ਬੈਟਰੀ ਸਥਿਤੀ ਲਈ ਅਨੁਕੂਲ ਬਣਾਇਆ ਜਾ ਰਿਹਾ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ਅਗਿਆਤ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ਚਾਰਜ ਹੋ ਰਿਹਾ ਹੈ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ਤੇਜ਼ ਚਾਰਜ ਹੋ ਰਹੀ ਹੈ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index e894c2c..5690e74 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktywna. Dotknij, by zmienić."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stan aplikacji w trybie czuwania: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Ustawienia transkodowania multimediów"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Wyłącz transkodowanie"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Włącz transkodowanie dla aplikacji"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Uruchomione usługi"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Wyświetl obecnie uruchomione usługi i nimi zarządzaj"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Do naładowania <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – do naładowania <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – bateria tymczasowo ograniczona"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optymalizuję, by utrzymać baterię w dobrym stanie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nieznane"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Ładowanie"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Szybkie ładowanie"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index acaabc7..a0ddcf2 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ativo. Tocar para alternar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado em espera do app:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configurações de transcodificação de mídia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desativar transcodificação"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substituir os padrões de transcodificação"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ativar transcodificação"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que os apps são compatíveis com formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ativar transcodificação para apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serviços em execução"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualizar e controlar os serviços em execução no momento"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Tempo restante até a carga completa: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> até a carga completa"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria limitada temporariamente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: otimizando para integridade da bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconhecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Carregando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregando rápido"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index 2c1a967..adaed74 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ativo. Toque para ativar/desativar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado do Modo de espera das apps:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Definições da transcodificação de multimédia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desativar a transcodificação"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substituir as predefinições da transcodificação"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ativar a transcodificação"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assumir que as apps suportam formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ative a transcodificação para apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serviços em execução"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ver e controlar os serviços actualmente em execução"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Falta(m) <xliff:g id="TIME">%1$s</xliff:g> até ficar carregada"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> até ficar carregada"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Bateria limitada temporariamente."</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – A otimizar o estado da bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconhecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"A carregar"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregamento rápido"</string>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index acaabc7..a0ddcf2 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ativo. Tocar para alternar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado em espera do app:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configurações de transcodificação de mídia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desativar transcodificação"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substituir os padrões de transcodificação"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ativar transcodificação"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que os apps são compatíveis com formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ativar transcodificação para apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serviços em execução"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualizar e controlar os serviços em execução no momento"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Tempo restante até a carga completa: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> até a carga completa"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria limitada temporariamente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: otimizando para integridade da bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconhecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Carregando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregando rápido"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 57a0454..266dff2 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Activă. Atingeți pentru a comuta."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stare Standby aplicații: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Setări pentru transcodarea conținutului media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Dezactivați transcodarea"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Modificați setările prestabilite de transcodare"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activați transcodarea"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Presupuneți că aplicațiile acceptă formatele moderne"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activați transcodarea pentru aplicații"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servicii în curs de funcționare"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Vedeți și controlați serviciile care funcționează în prezent"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Au mai rămas <xliff:g id="TIME">%1$s</xliff:g> până la încărcare"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> până la încărcare"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – baterie limitată temporar"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Se fac optimizări pentru buna funcționare a bateriei"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Necunoscut"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Se încarcă"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Se încarcă rapid"</string>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index 09b8de0..ca20bae 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Включено. Нажмите, чтобы отключить."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Статус приложения в режиме ожидания:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Настройки перекодирования медиафайлов"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Отключить перекодирование"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Переопределять настройки транскодирования по умолчанию"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Включить перекодирование"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Считать, что приложения поддерживают современные форматы кодирования"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Включить перекодирование для приложений"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Работающие службы"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Просмотр и управление работающими службами"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> до полной зарядки"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> до полной зарядки"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> • Уровень заряда временно ограничен"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"Оптимизация для увеличения срока службы батареи (<xliff:g id="LEVEL">%1$s</xliff:g>)"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Неизвестно"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Идет зарядка"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Быстрая зарядка"</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index d36140f..da69b81 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"සක්රියයි. ටොගල කිරීමට තට්ටු කරන්න."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"යෙදුම් පොරොත්තු තත්ත්වය:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"මාධ්ය ට්රාන්ස්කෝඩින් සැකසීම්"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ට්රාන්ස්කෝඩින් අබල කරන්න"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ට්රාන්ස්කෝඩින් පෙරනිමි ප්රතික්ෂේප කරන්න"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ට්රාන්ස්කෝඩින් සබල කරන්න"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"යෙදුම් නවීන ආකෘති සඳහා සහාය දක්වයි යැයි උපකල්පනය කරමු"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"යෙදුම් සඳහා ට්රාන්ස්කෝඩින් සබල කරන්න"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ධාවනය වන සේවා"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"දැනට ධාවනය වන සේවා බලන්න සහ පාලනය කරන්න"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ආරෝපණය වන තෙක් <xliff:g id="TIME">%1$s</xliff:g> ඇත"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ආරෝපණය වන තෙක් <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - බැටරිය තාවකාලිකව සීමිතයි"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - බැටරි සෞඛ්යය සඳහා ප්රශස්ත කරමින්"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"නොදනී"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ආරෝපණය වෙමින්"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ශීඝ්ර ආරෝපණය"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index 096e95e..b428b42 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Zlyhanie konfigurácie adresy IP"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Nepripojené z dôvodu siete nízkej kvality"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Zlyhanie pripojenia Wi‑Fi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problém s overením totožnosti"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problém s overením"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Nedá sa pripojiť"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"K sieti <xliff:g id="AP_NAME">%1$s</xliff:g> sa nedá pripojiť"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Skontrolujte heslo a skúste to znova"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktívne. Prepnite klepnutím."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stav pohotovostného režimu aplikácie: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Nastavenia prekódovania médií"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Vypnúť prekódovanie"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Prepísať predvolené nastavenia prekódovania"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Povoliť prekódovanie"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Prepdokladať, že aplikácie podporujú moderné formáty"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Zapnúť prekódovanie aplikácií"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Spustené služby"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Zobrazovať a riadiť aktuálne spustené služby"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Zostávajúci čas do úplného nabitia: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> do úplného nabitia"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batéria je dočasne obmedzená"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimalizácia stavu batérie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Neznáme"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Nabíja sa"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Rýchle nabíjanie"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index 345fa36..3ba31fa 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivno. Dotaknite se za preklop."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje pripravljenosti aplikacije: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Nastavitve prekodiranja predstavnosti"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogočanje prekodiranja"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Preglasi privzete nastavitve prekodiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogoči prekodiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Aplikacije naj bi podpirale sodobne oblike zapisov"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogočanje prekodiranja za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Zagnane storitve"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Preglejte in nadzorujte storitve, ki so trenutno zagnane"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Še <xliff:g id="TIME">%1$s</xliff:g> do polne napolnjenosti"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> do polne napolnjenosti"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – baterija je začasno omejena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimizacija za ohran. zmog. baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Neznano"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Polnjenje"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Hitro polnjenje"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index 3953a6a4f..15cbb74 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Trokit për ta ndryshuar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Gjendja e gatishmërisë e aplikacionit:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Cilësimet e transkodimit të multimediave"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Çaktivizo transkodimin"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktivizo transkodimin për aplikacionet"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Shërbimet në ekzekutim"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Shiko dhe kontrollo shërbimet që po ekzekutohen aktualisht"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> të mbetura deri në karikim"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> derisa të karikohet"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Bateria e kufizuar përkohësisht"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Po optimizohet për integritetin e baterisë"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"I panjohur"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Po karikohet"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Po ngarkon me shpejtësi"</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index 70b2879..c337182 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активна. Додирните да бисте је деактивирали."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Стање приправности апликације: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Подешавања транскодирања медија"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Онемогући транскодирање"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Замени подразумевана подешавања транскодирања"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Омогући транскодирање"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Подразумевај да апликације подржавају модерне формате"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Омогућите транскодирање за апликације"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Покренуте услуге"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Приказ и контрола тренутно покренутих услуга"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Напуниће се за <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – напуниће се за <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – батерија је тренутно ограничена"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Оптимизује се ради стања батерије"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Непознато"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Пуни се"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Брзо се пуни"</string>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index f466e88..2bf9785 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Tryck om du vill inaktivera."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Status för strömsparfunktion för appar:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Inställningar för medieomkodning"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Inaktivera omkodning"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Åsidosätta standardinställningar för omkodning"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktivera omkodning"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Anta att appar har stöd för moderna format"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktivera omkodning för appar"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktiva tjänster"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visa och styr aktiva tjänster"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> kvar till full laddning"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> till full laddning"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – batteriet är tillfälligt begränsat"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimerar batteriets livslängd"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Okänd"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Laddar"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Laddas snabbt"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index e1060fec..610bfee 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Inatumika. Gusa ili ugeuze."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Hali ya kisitisha programu:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Mipangilio ya kubadilisha muundo wa faili ya maudhui"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Zima ubadilishaji muundo wa faili"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Batilisha chaguomsingi za kubadilisha miundo ya faili"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ruhusu ubadilishaji wa miundo ya faili"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Chukulia kuwa programu zinatumia miundo ya kisasa"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Washa ubadilishaji muundo wa faili kwenye programu"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Huduma zinazoendeshwa"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Onyesha na udhibiti huduma zinazoendeshwa kwa sasa"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Imebakisha <xliff:g id="TIME">%1$s</xliff:g> ijae chaji"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ijae chaji"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Betri imedhibitiwa kwa muda"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Inaboresha muda wa kutumia betri"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Haijulikani"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Inachaji"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Inachaji kwa kasi"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index ba98d79..7d77967 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"செயலில் உள்ளது. மாற்ற, தட்டவும்."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"காத்திருப்பில் உள்ள ஆப்ஸின் நிலை:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"மீடியா குறிமாற்ற அமைப்புகள்"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"குறிமாற்றத்தை முடக்கு"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"இயல்புநிலை குறிமாற்றங்களை மீறிச் செயல்படு"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"குறிமாற்றத்தை இயக்கு"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ஆப்ஸ் மாடர்ன் வடிவங்களை ஆதரிக்கும்படி அமை"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ஆப்ஸுக்குக் குறிமாற்றத்தை இயக்கு"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"இயங்கும் சேவைகள்"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"தற்போது இயக்கத்தில் இருக்கும் சேவைகளைப் பார்த்து கட்டுப்படுத்து"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"முழு சார்ஜாக <xliff:g id="TIME">%1$s</xliff:g> ஆகும்"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - முழு சார்ஜாக <xliff:g id="TIME">%2$s</xliff:g> ஆகும்"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>-பேட்டரி தற்காலிகக் கட்டுப்பாட்டிலுள்ளது"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - பேட்டரியின் ஆயுளை மேம்படுத்துகிறது"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"அறியப்படாத"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"சார்ஜ் ஆகிறது"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"வேகமாக சார்ஜாகிறது"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 0b93979..f24caec 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"సక్రియంగా ఉంది. టోగుల్ చేయడానికి నొక్కండి."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"యాప్ స్టాండ్బై స్థితి:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"మీడియా ట్రాన్స్కోడింగ్ సెట్టింగ్లు"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ట్రాన్స్కోడింగ్ను డిజేబుల్ చేయండి"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"యాప్ల కోసం ట్రాన్స్కోడింగ్ను ఎనేబుల్ చేయండి"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"అమలులో ఉన్న సేవలు"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ప్రస్తుతం అమలులో ఉన్న సేవలను వీక్షించండి మరియు నియంత్రించండి"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ఛార్జ్ అవ్వడానికి <xliff:g id="TIME">%1$s</xliff:g> సమయం మిగిలి ఉంది"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ఛార్జ్ అవ్వడానికి <xliff:g id="TIME">%2$s</xliff:g> పడుతుంది"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> -బ్యాటరీ తాత్కాలికంగా పరిమితం చేయబడింది"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - బ్యాటరీ స్థితిని ఆప్టిమైజ్ చేయడం కోసం"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"తెలియదు"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ఛార్జ్ అవుతోంది"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"వేగవంతమైన ఛార్జింగ్"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index a31e146..2c01998 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ใช้งานอยู่ แตะเพื่อสลับ"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"สถานะการสแตนด์บายของแอป:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"การตั้งค่าการแปลงสื่อ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ปิดใช้การแปลง"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ลบล้างค่าเริ่มต้นของการแปลง"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"เปิดใช้การแปลง"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ถือว่าแอปรองรับรูปแบบสมัยใหม่"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"เปิดใช้การแปลงสำหรับแอป"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"บริการที่ทำงานอยู่"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ดูและควบคุมบริการที่ทำงานอยู่"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"เหลือ <xliff:g id="TIME">%1$s</xliff:g> จนกว่าจะชาร์จเต็ม"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> จนกว่าจะชาร์จ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - การชาร์จแบตเตอรี่จำกัดชั่วคราว"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - กำลังเพิ่มประสิทธิภาพแบตเตอรี่"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ไม่ทราบ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"กำลังชาร์จ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"กำลังชาร์จอย่างเร็ว"</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index bbb7779..54ba90e 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Pagkabigo ng Configuration ng IP"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Hindi nakakonekta dahil mababa ang kalidad ng network"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Pagkabigo ng Koneksyon sa WiFi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problema sa pagpapatotoo"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problema sa pag-authenticate"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Hindi makakonekta"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"Hindi makakonekta sa \'<xliff:g id="AP_NAME">%1$s</xliff:g>\'"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Suriin ang password at subukang muli"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktibo. I-tap upang i-toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Status ng app standby:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Mga setting ng pag-transcode ng media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"I-disable ang pag-transcode"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"I-override ang mga default ng pagta-transcode"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"I-enable ang pagta-transcode"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Ipagpalagay na sinusuportahan ng mga app ang mga modernong format"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"I-enable ang pag-transcode para sa mga app"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Mga tumatakbong serbisyo"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Tingnan at kontrolin ang mga kasalukuyang tumatakbong serbisyo"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ang natitira bago matapos mag-charge"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> hanggang matapos mag-charge"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pansamantalang limitado ang baterya"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ino-optimize para sa tagal ng baterya"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Hindi Kilala"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Nagcha-charge"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Mabilis na charge"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index fba7f41..942834f 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Etkin. Geçiş yapmak için dokunun."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Uygulamayı beklemeye alma durumu: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Medya kod dönüştürme ayarları"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Kod dönüştürmeyi devre dışı bırak"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Kod dönüştürme varsayılanlarını geçersiz kıl"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Kod dönüştürmeyi etkinleştir"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Uygulamaların modern biçimleri desteklediğini varsay"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Uygulamalar için kod dönüştürmeyi etkinleştir"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Çalışan hizmetler"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Şu anda çalışan hizmetleri görüntüle ve denetle"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Şarj olmaya <xliff:g id="TIME">%1$s</xliff:g> kaldı"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - şarj olmaya <xliff:g id="TIME">%2$s</xliff:g> kaldı"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pil geçici olarak sınırlı"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pil sağlığı için optimize ediliyor"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Bilinmiyor"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Şarj oluyor"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Hızlı şarj oluyor"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index b633752..f6063f8 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активний додаток. Торкніться, щоб дезактивувати."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Режим очікування: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Налаштування перекодування медіафайлів"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Вимкнути перекодування"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Замінити стандартні налаштування перекодування"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Увімкнути перекодування"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Вважати, що додатки підтримують сучасні формати"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Увімкнути перекодування додатків"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Запущені сервіси"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Переглянути й налаштувати запущені сервіси"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> до повного заряду"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> до повного заряду"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – дані акумулятора тимчасово недоступні"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – стан акумулятора оптимізується"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Невідомо"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Заряджається"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Швидке заряджання"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index b4d8ad2..5d75437 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"فعال۔ ٹوگل کرنے کیلئے تھپتھپائیں۔"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ایپ اسٹینڈ بائی کی حالت:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"میڈیا ٹرانسکوڈنگ کی ترتیبات"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ٹرانسکوڈنگ غیر فعال کریں"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ایپس کے لئے ٹرانسکوڈنگ فعال کریں"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"چل رہی سروسز"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"فی الحال چل رہی سروسز دیکھیں اور انہیں کنٹرول کریں"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"چارج ہونے میں <xliff:g id="TIME">%1$s</xliff:g> باقی"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> چارج ہونے تک"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - بیٹری عارضی طور پر محدود ہے"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - بیٹری کی صحت کیلئے بہتر بنایا جا رہا ہے"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"نامعلوم"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"چارج ہو رہا ہے"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"تیزی سے چارج ہو رہا ہے"</string>
diff --git a/packages/SettingsLib/res/values-uz/arrays.xml b/packages/SettingsLib/res/values-uz/arrays.xml
index 2f06fcf..0770dcc 100644
--- a/packages/SettingsLib/res/values-uz/arrays.xml
+++ b/packages/SettingsLib/res/values-uz/arrays.xml
@@ -25,7 +25,7 @@
<item msgid="3288373008277313483">"Qidiruv…"</item>
<item msgid="6050951078202663628">"Ulanmoqda…"</item>
<item msgid="8356618438494652335">"Tasdiqdan o‘tilmoqda…"</item>
- <item msgid="2837871868181677206">"IP manzil o‘zlashtirilmoqda…"</item>
+ <item msgid="2837871868181677206">"IP manzil olinmoqda…"</item>
<item msgid="4613015005934755724">"Ulangan"</item>
<item msgid="3763530049995655072">"Muzlatildi"</item>
<item msgid="7852381437933824454">"Uzilmoqda…"</item>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index 5bb422e..f1fc8dd 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP manzilini sozlab bo‘lmadi"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Sifatsiz tarmoq sababli ulanib bo‘lmadi"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Wi-Fi ulanishini o‘rnatib bo‘lmadi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Tasdiqdan o‘tishda muammo"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Tekshiruvda muammo"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Tarmoqqa ulanilmadi"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"“<xliff:g id="AP_NAME">%1$s</xliff:g>” nomli tarmoqqa ulanilmadi"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Parolni tekshirib, qaytadan urining"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Faol. O‘zgartirish uchun bu yerga bosing."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Kutish rejimi holati: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transkripsiyasi sozlamalari"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Transkripsiyani faolsizlantirish"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Transkripsiya parametrlarini almashtirish"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Transkripsiyasini yoqish"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Ilovalar zamonaviy kodlash formatlarini qoʻllab-quvvatlaydi deb hisoblash"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ilovalar uchun transkripsiyani yoqish"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Ishlab turgan ilovalar"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ishlab turgan ilovalarni ko‘rish va boshqarish"</string>
@@ -432,8 +434,8 @@
<skip />
<string name="power_discharge_by_enhanced" msgid="563438403581662942">"Joriy holatda taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
<string name="power_discharge_by_only_enhanced" msgid="3268796172652988877">"Joriy holatda taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi"</string>
- <string name="power_discharge_by" msgid="4113180890060388350">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
- <string name="power_discharge_by_only" msgid="92545648425937000">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi"</string>
+ <string name="power_discharge_by" msgid="4113180890060388350">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha yetadi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
+ <string name="power_discharge_by_only" msgid="92545648425937000">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha yetadi"</string>
<string name="power_discharge_by_only_short" msgid="5883041507426914446">"<xliff:g id="TIME">%1$s</xliff:g> gacha"</string>
<string name="power_suggestion_battery_run_out" msgid="6332089307827787087">"Batareya quvvati tugash vaqti: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_remaining_less_than_duration_only" msgid="8956656616031395152">"<xliff:g id="THRESHOLD">%1$s</xliff:g>dan kam qoldi"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ichida toʻladi"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> ichida toʻladi"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Quvvat darajasi vaqtincha cheklangan"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batareya quvvati muvozanatlanmoqda"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Noma’lum"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Quvvat olmoqda"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Tezkor quvvat olmoqda"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index 0acf941..910fa26 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Hiện hoạt. Nhấn để chuyển đổi."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Trạng thái chờ ứng dụng:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Cài đặt chuyển mã nội dung nghe nhìn"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Tắt tùy chọn chuyển mã"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ghi đè tùy chọn chuyển mã mặc định"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Bật tính năng chuyển mã"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Giả định rằng các ứng dụng hỗ trợ định dạng hiện đại"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Bật tùy chọn chuyển mã cho ứng dụng"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Các dịch vụ đang chạy"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Xem và kiểm soát các dịch vụ đang chạy"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Còn <xliff:g id="TIME">%1$s</xliff:g> nữa là sạc đầy"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> nữa là sạc đầy"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Thời lượng pin bị hạn chế tạm thời"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Đang tối ưu hóa để cải thiện độ bền của pin"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Không xác định"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Đang sạc"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Đang sạc nhanh"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index ca2ad87..c9ecab1 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"已启用。点按即可切换。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"应用待机状态:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"媒体转码设置"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"停用转码功能"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"覆盖转码默认设置"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"启用转码"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"假设应用支持现代格式"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"为应用启用转码功能"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"正在运行的服务"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"查看和控制当前正在运行的服务"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"还剩 <xliff:g id="TIME">%1$s</xliff:g>充满电"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>后充满电"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 暂时限用电池"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 正在针对电池状况进行优化"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"未知"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"正在充电"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"正在快速充电"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index 16ca19d..3bbfa21 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"已啟用。輕按即可切換。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"備用應用程式狀態:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"媒體轉碼設定"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"停用轉碼功能"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"覆寫轉碼預設設定"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"啟用轉碼功能"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"假設應用程式支援新型格式"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"為應用程式啟用轉碼功能"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"執行中的服務"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"查看並控制目前正在執行中的服務"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"還需 <xliff:g id="TIME">%1$s</xliff:g>才能充滿電"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - 還需 <xliff:g id="TIME">%2$s</xliff:g>才能充滿電"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 暫時限制電池充電"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 正在優化電池狀態"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"未知"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"充電中"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"正在快速充電"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index 810119b..b0dbb5f 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"已啟用。輕觸即可切換。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"應用程式待命狀態:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"媒體轉碼功能設定"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"停用轉碼功能"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"覆寫轉碼預設設定"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"啟用轉碼"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"假設應用程式支援新格式"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"替應用程式啟用轉碼功能"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"正在運作的服務"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"查看並管理目前正在執行的服務"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g>後充飽電"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>後充飽電"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 暫時限制電池用量"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 針對電池狀態進行最佳化調整"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"不明"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"充電中"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"快速充電中"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index 23beeb1..8f7c2ac1 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Kuyasebenza. Thepha ukuze ushintshe."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Isimo sokulinda kohlelo lokusebenza:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Amasethingi wemidiya yokudlulisela ikhodi"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Khubaza ukudlulisela ikhodi"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Khipha okuzenzakalelayo kokudlulisela ikhodi"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Nika amandla ukudlulisela ikhodi"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Kuthathe njengokungathi izinhlelo zokusebenza zisekela amafomethi esimanje"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Nika amandla ukudlulisela ikhodi kwezinhlelo zokusebenza"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Amasevisi asebenzayo"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Buka futhi ulawule amasevisi asebenzayo okwamanje"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> esele ize ishaje"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ize igcwale"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ibhethri ikhawulelwe okwesikhashana"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ilungiselela impilo yebhethri"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Akwaziwa"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Iyashaja"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ishaja ngokushesha"</string>
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index 22213cb..ca06867 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -1004,9 +1004,6 @@
<!-- Settings item title to select the default behavior for transcoding if an encodig is not supported by an app. [CHAR LIMIT=85] -->
<string name="transcode_default">Assume apps support modern formats</string>
- <!-- Settings category title for selecting apps to be enabled for transcoding. [CHAR LIMIT=85] -->
- <string name="transcode_skip_apps">Enable transcoding for apps</string>
-
<!-- Services settings screen, setting option name for the user to go to the screen to view running services -->
<string name="runningservices_settings_title">Running services</string>
<!-- Services settings screen, setting option summary for the user to go to the screen to view running services -->
@@ -1115,7 +1112,7 @@
<string name="power_remaining_charging_duration_only"><xliff:g id="time">%1$s</xliff:g> left until charged</string>
<!-- [CHAR_LIMIT=40] Label for battery level chart when charging with duration -->
<string name="power_charging_duration"><xliff:g id="level">%1$s</xliff:g> - <xliff:g id="time">%2$s</xliff:g> until charged</string>
- <!-- [CHAR_LIMIT=40] Label for battery level chart when charge been limited -->
+ <!-- [CHAR_LIMIT=80] Label for battery level chart when charge been limited -->
<string name="power_charging_limited"><xliff:g id="level">%1$s</xliff:g> - Optimizing for battery health</string>
<!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed -->
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java
new file mode 100644
index 0000000..5689860
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2020 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.settingslib.mobile;
+
+import android.telephony.Annotation;
+import android.telephony.TelephonyDisplayInfo;
+import android.telephony.TelephonyManager;
+
+/**
+ * Holds the utility functions to create the RAT to MobileIconGroup mappings.
+ */
+public class MobileMappings {
+
+ /**
+ * Generates the RAT key from the TelephonyDisplayInfo.
+ */
+ public static String getIconKey(TelephonyDisplayInfo telephonyDisplayInfo) {
+ if (telephonyDisplayInfo.getOverrideNetworkType()
+ == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) {
+ return toIconKey(telephonyDisplayInfo.getNetworkType());
+ } else {
+ return toDisplayIconKey(telephonyDisplayInfo.getOverrideNetworkType());
+ }
+ }
+
+ /**
+ * Converts the networkType into the RAT key.
+ */
+ public static String toIconKey(@Annotation.NetworkType int networkType) {
+ return Integer.toString(networkType);
+ }
+
+ /**
+ * Converts the displayNetworkType into the RAT key.
+ */
+ public static String toDisplayIconKey(@Annotation.OverrideNetworkType int displayNetworkType) {
+ switch (displayNetworkType) {
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA";
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA_Plus";
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_NR);
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_NR) + "_Plus";
+ default:
+ return "unsupported";
+ }
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java
new file mode 100644
index 0000000..b8030f1
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java
@@ -0,0 +1,286 @@
+/*
+ * Copyright (C) 2020 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.settingslib.mobile;
+
+import android.os.Handler;
+import android.os.Looper;
+import android.telephony.PhoneStateListener;
+import android.telephony.ServiceState;
+import android.telephony.SignalStrength;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyDisplayInfo;
+import android.telephony.TelephonyManager;
+import android.util.Log;
+
+/**
+ * Tracks the mobile signal status for the SysUI and Settings.
+ *
+ * This class is not threadsafe. All the mobile statuses monitored by this class is stored in
+ * MobileStatus. Whoever uses this class should only rely on the MobileStatusTracker#Callback
+ * to get the latest mobile statuses. Do not get mobile statues directly from
+ * MobileStatusTracker#MobileStatus.
+ */
+public class MobileStatusTracker {
+ private static final String TAG = "MobileStatusTracker";
+ private final TelephonyManager mPhone;
+ private final SubscriptionInfo mSubscriptionInfo;
+ private final Callback mCallback;
+ private final MobileStatus mMobileStatus;
+ private final PhoneStateListener mPhoneStateListener;
+ private final SubscriptionDefaults mDefaults;
+ private final Handler mReceiverHandler;
+
+ /**
+ * MobileStatusTracker constructors
+ *
+ * @param phone The TelephonyManager which corresponds to the subscription being monitored.
+ * @param receiverLooper The Looper on which the callback will be invoked.
+ * @param info The subscription being monitored.
+ * @param defaults The wrapper of the SubscriptionManager.
+ * @param callback The callback to notify any changes of the mobile status, users should only
+ * use this callback to get the latest mobile status.
+ */
+ public MobileStatusTracker(TelephonyManager phone, Looper receiverLooper,
+ SubscriptionInfo info, SubscriptionDefaults defaults, Callback callback) {
+ mPhone = phone;
+ mReceiverHandler = new Handler(receiverLooper);
+ mPhoneStateListener = new MobilePhoneStateListener();
+ mSubscriptionInfo = info;
+ mDefaults = defaults;
+ mCallback = callback;
+ mMobileStatus = new MobileStatus();
+ updateDataSim();
+ mReceiverHandler.post(() -> mCallback.onMobileStatusChanged(
+ /* updateTelephony= */false, new MobileStatus(mMobileStatus)));
+ }
+
+ public PhoneStateListener getPhoneStateListener() {
+ return mPhoneStateListener;
+ }
+
+ /**
+ * Config the MobileStatusTracker to start or stop monitoring platform signals.
+ */
+ public void setListening(boolean listening) {
+ if (listening) {
+ mPhone.registerPhoneStateListener(mReceiverHandler::post, mPhoneStateListener);
+ } else {
+ mPhone.unregisterPhoneStateListener(mPhoneStateListener);
+ }
+ }
+
+ private void updateDataSim() {
+ int activeDataSubId = mDefaults.getActiveDataSubId();
+ if (SubscriptionManager.isValidSubscriptionId(activeDataSubId)) {
+ mMobileStatus.dataSim = activeDataSubId == mSubscriptionInfo.getSubscriptionId();
+ } else {
+ // There doesn't seem to be a data sim selected, however if
+ // there isn't a MobileSignalController with dataSim set, then
+ // QS won't get any callbacks and will be blank. Instead
+ // lets just assume we are the data sim (which will basically
+ // show one at random) in QS until one is selected. The user
+ // should pick one soon after, so we shouldn't be in this state
+ // for long.
+ mMobileStatus.dataSim = true;
+ }
+ }
+
+ private void setActivity(int activity) {
+ mMobileStatus.activityIn = activity == TelephonyManager.DATA_ACTIVITY_INOUT
+ || activity == TelephonyManager.DATA_ACTIVITY_IN;
+ mMobileStatus.activityOut = activity == TelephonyManager.DATA_ACTIVITY_INOUT
+ || activity == TelephonyManager.DATA_ACTIVITY_OUT;
+ }
+
+ private class MobilePhoneStateListener extends PhoneStateListener implements
+ PhoneStateListener.ServiceStateChangedListener,
+ PhoneStateListener.SignalStrengthsChangedListener,
+ PhoneStateListener.CallStateChangedListener,
+ PhoneStateListener.DataConnectionStateChangedListener,
+ PhoneStateListener.DataActivityListener,
+ PhoneStateListener.CarrierNetworkChangeListener,
+ PhoneStateListener.ActiveDataSubscriptionIdChangedListener,
+ PhoneStateListener.DisplayInfoChangedListener{
+
+ @Override
+ public void onSignalStrengthsChanged(SignalStrength signalStrength) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onSignalStrengthsChanged signalStrength=" + signalStrength
+ + ((signalStrength == null) ? ""
+ : (" level=" + signalStrength.getLevel())));
+ }
+ mMobileStatus.signalStrength = signalStrength;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onServiceStateChanged(ServiceState state) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onServiceStateChanged voiceState="
+ + (state == null ? "" : state.getState())
+ + " dataState=" + (state == null ? "" : state.getDataRegistrationState()));
+ }
+ mMobileStatus.serviceState = state;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onDataConnectionStateChanged(int state, int networkType) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onDataConnectionStateChanged: state=" + state
+ + " type=" + networkType);
+ }
+ mMobileStatus.dataState = state;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onDataActivity(int direction) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onDataActivity: direction=" + direction);
+ }
+ setActivity(direction);
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */false, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onCarrierNetworkChange(boolean active) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onCarrierNetworkChange: active=" + active);
+ }
+ mMobileStatus.carrierNetworkChangeMode = active;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onActiveDataSubscriptionIdChanged(int subId) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onActiveDataSubscriptionIdChanged: subId=" + subId);
+ }
+ updateDataSim();
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onDisplayInfoChanged: telephonyDisplayInfo=" + telephonyDisplayInfo);
+ }
+ mMobileStatus.telephonyDisplayInfo = telephonyDisplayInfo;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */ true, new MobileStatus(mMobileStatus));
+ }
+ }
+
+ /**
+ * Wrapper class of the SubscriptionManager, for mock testing purpose
+ */
+ public static class SubscriptionDefaults {
+ public int getDefaultVoiceSubId() {
+ return SubscriptionManager.getDefaultVoiceSubscriptionId();
+ }
+
+ public int getDefaultDataSubId() {
+ return SubscriptionManager.getDefaultDataSubscriptionId();
+ }
+
+ public int getActiveDataSubId() {
+ return SubscriptionManager.getActiveDataSubscriptionId();
+ }
+ }
+
+ /**
+ * Wrapper class which contains all the mobile status tracked by MobileStatusTracker.
+ */
+ public static class MobileStatus {
+ public boolean activityIn;
+ public boolean activityOut;
+ public boolean dataSim;
+ public boolean carrierNetworkChangeMode;
+ public int dataState = TelephonyManager.DATA_DISCONNECTED;
+ public ServiceState serviceState;
+ public SignalStrength signalStrength;
+ public TelephonyDisplayInfo telephonyDisplayInfo =
+ new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
+
+ /**
+ * Empty constructor
+ */
+ public MobileStatus() { }
+
+ /**
+ * Copy constructors
+ *
+ * @param status Source MobileStatus
+ */
+ public MobileStatus(MobileStatus status) {
+ copyFrom(status);
+ }
+
+ protected void copyFrom(MobileStatus status) {
+ activityIn = status.activityIn;
+ activityOut = status.activityOut;
+ dataSim = status.dataSim;
+ carrierNetworkChangeMode = status.carrierNetworkChangeMode;
+ dataState = status.dataState;
+ // We don't do deep copy for the below members since they may be Mockito instances.
+ serviceState = status.serviceState;
+ signalStrength = status.signalStrength;
+ telephonyDisplayInfo = status.telephonyDisplayInfo;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ return builder.append("[activityIn=").append(activityIn).append(',')
+ .append("activityOut=").append(activityOut).append(',')
+ .append("dataSim=").append(dataSim).append(',')
+ .append("carrierNetworkChangeMode=").append(carrierNetworkChangeMode).append(',')
+ .append("dataState=").append(dataState).append(',')
+ .append("serviceState=").append(serviceState == null ? ""
+ : serviceState.toString()).append(',')
+ .append("signalStrength=").append(signalStrength == null ? ""
+ : signalStrength.toString()).append(',')
+ .append("telephonyDisplayInfo=").append(telephonyDisplayInfo == null ? ""
+ : telephonyDisplayInfo.toString()).append(']').toString();
+ }
+ }
+
+ /**
+ * Callback for notifying any changes of the mobile status.
+ *
+ * This callback will always be invoked on the receiverLooper which must be specified when
+ * MobileStatusTracker is constructed.
+ */
+ public interface Callback {
+ /**
+ * Notify the mobile status has been updated.
+ *
+ * @param updateTelephony Whether needs to update other Telephony related parameters, this
+ * is only used by SysUI.
+ * @param mobileStatus Holds the latest mobile statuses
+ */
+ void onMobileStatusChanged(boolean updateTelephony, MobileStatus mobileStatus);
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/emergencynumber/EmergencyNumberUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/emergencynumber/EmergencyNumberUtilsTest.java
index 1403631..99d2ff7 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/emergencynumber/EmergencyNumberUtilsTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/emergencynumber/EmergencyNumberUtilsTest.java
@@ -113,12 +113,13 @@
private void addEmergencyNumberToTelephony() {
final int subId = SubscriptionManager.getDefaultSubscriptionId();
EmergencyNumber emergencyNumber = mock(EmergencyNumber.class);
+ when(emergencyNumber.isInEmergencyServiceCategories(EMERGENCY_SERVICE_CATEGORY_POLICE))
+ .thenReturn(true);
Map<Integer, List<EmergencyNumber>> numbers = new ArrayMap<>();
List<EmergencyNumber> numbersForSubId = new ArrayList<>();
numbersForSubId.add(emergencyNumber);
numbers.put(subId, numbersForSubId);
- when(mTelephonyManager.getEmergencyNumberList(
- EMERGENCY_SERVICE_CATEGORY_POLICE)).thenReturn(numbers);
+ when(mTelephonyManager.getEmergencyNumberList()).thenReturn(numbers);
when(emergencyNumber.getNumber()).thenReturn(TELEPHONY_EMERGENCY_NUMBER);
}
}
diff --git a/packages/SharedStorageBackup/OWNERS b/packages/SharedStorageBackup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/packages/SharedStorageBackup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 7b1257b0..af775cc6 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -181,6 +181,8 @@
<!-- Permissions needed to test system only camera devices -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.SYSTEM_CAMERA" />
+ <!-- Permissions needed to test onCameraOpened/Closed callbacks -->
+ <uses-permission android:name="android.permission.CAMERA_OPEN_CLOSE_LISTENER" />
<!-- Permissions needed for CTS camera test: RecordingTest.java when assuming shell id -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- Permission needed to enable/disable Bluetooth/Wifi -->
@@ -362,6 +364,9 @@
<!-- Permissions required for CTS tests to close system dialogs -->
<uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
+ <!-- Permission required for CTS test - HideOverlayWindowsTest -->
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
+
<application android:label="@string/app_label"
android:theme="@android:style/Theme.DeviceDefault.DayNight"
android:defaultToDeviceProtectedStorage="true"
diff --git a/packages/StatementService/Android.bp b/packages/StatementService/Android.bp
index ae37efc..2664a03 100644
--- a/packages/StatementService/Android.bp
+++ b/packages/StatementService/Android.bp
@@ -21,6 +21,7 @@
platform_apis: true,
privileged: true,
libs: ["org.apache.http.legacy"],
+ uses_libs: ["org.apache.http.legacy"],
static_libs: [
"libprotobuf-java-nano",
"volley",
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 285c4a1..6e7b0b8 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -103,6 +103,7 @@
<uses-permission android:name="android.permission.START_ACTIVITY_AS_CALLER" />
<uses-permission android:name="android.permission.START_TASKS_FROM_RECENTS" />
<uses-permission android:name="android.permission.GET_INTENT_SENDER_INTENT" />
+ <uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
<!-- WindowManager -->
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java
index 6e86f26..4fc1973 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/FalsingManager.java
@@ -60,8 +60,8 @@
* Returns true if the last two gestures do not look like a double tap.
*
* Only works on data that has already been reported to the FalsingManager. Be sure that
- * {@link #onTouchEvent(MotionEvent, int, int)} has already been called for all of the
- * taps you want considered.
+ * {@link com.android.systemui.classifier.FalsingCollector#onTouchEvent(MotionEvent)}
+ * has already been called for all of the taps you want considered.
*
* This looks at the last two gestures on the screen, ensuring that they meet the following
* criteria:
@@ -85,8 +85,6 @@
boolean isReportingEnabled();
- void onTouchEvent(MotionEvent ev, int width, int height);
-
/** From com.android.systemui.Dumpable. */
void dump(FileDescriptor fd, PrintWriter pw, String[] args);
diff --git a/packages/SystemUI/res-keyguard/values-af/strings.xml b/packages/SystemUI/res-keyguard/values-af/strings.xml
index 276fa23..6f23f8c 100644
--- a/packages/SystemUI/res-keyguard/values-af/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-af/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Laai tans"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Laai tans vinnig"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Laai tans stadig"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimeer tans vir batterygesondheid"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Koppel jou laaier."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Druk Kieslys om te ontsluit."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Netwerk is gesluit"</string>
diff --git a/packages/SystemUI/res-keyguard/values-am/strings.xml b/packages/SystemUI/res-keyguard/values-am/strings.xml
index ae5d1f6..62f9554 100644
--- a/packages/SystemUI/res-keyguard/values-am/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-am/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ኃይል በመሙላት ላይ"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • በፍጥነት ኃይልን በመሙላት ላይ"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • በዝግታ ኃይልን በመሙላት ላይ"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ለባትሪ ጤና ማመቻቸት"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"ኃይል መሙያዎን ያያይዙ።"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"ለመክፈት ምናሌ ተጫን።"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"አውታረ መረብ ተቆልፏል"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ar/strings.xml b/packages/SystemUI/res-keyguard/values-ar/strings.xml
index fb03fe3..459d162 100644
--- a/packages/SystemUI/res-keyguard/values-ar/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ar/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • جارٍ الشحن"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • جارٍ الشحن سريعًا"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • جارٍ الشحن ببطء"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • التحسين لسلامة البطارية"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"توصيل جهاز الشحن."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"اضغط على \"القائمة\" لإلغاء التأمين."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"الشبكة مؤمّنة"</string>
diff --git a/packages/SystemUI/res-keyguard/values-as/strings.xml b/packages/SystemUI/res-keyguard/values-as/strings.xml
index 8e8b13d..84a8afa 100644
--- a/packages/SystemUI/res-keyguard/values-as/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-as/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • চ্চার্জ কৰি থকা হৈছে"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • দ্ৰুত গতিৰে চ্চাৰ্জ কৰি থকা হৈছে"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • লাহে লাহে চ্চাৰ্জ কৰি থকা হৈছে"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • বেটাৰীৰ অৱস্থা অপ্টিমাইজ কৰি থকা হৈছে"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"আপোনাৰ চ্চার্জাৰ সংযোগ কৰক।"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"আনলক কৰিবলৈ মেনু টিপক।"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"নেটৱর্ক লক কৰা অৱস্থাত আছে"</string>
diff --git a/packages/SystemUI/res-keyguard/values-az/strings.xml b/packages/SystemUI/res-keyguard/values-az/strings.xml
index f9bff73..e184679 100644
--- a/packages/SystemUI/res-keyguard/values-az/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-az/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Enerji yığır"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Sürətlə enerji yığır"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Yavaş enerji yığır"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Enerjiyə qənaət üçün optimallaşdırma"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Adapteri qoşun."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Kilidi açmaq üçün Menyu düyməsinə basın."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Şəbəkə kilidlidir"</string>
diff --git a/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml b/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml
index 3434ac6..3468740 100644
--- a/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Puni se"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Brzo se puni"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Sporo se puni"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimizuje se radi dobrog stanja baterije"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Priključite punjač."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Pritisnite Meni da biste otključali."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Mreža je zaključana"</string>
diff --git a/packages/SystemUI/res-keyguard/values-be/strings.xml b/packages/SystemUI/res-keyguard/values-be/strings.xml
index 07d682f..4f8ce16 100644
--- a/packages/SystemUI/res-keyguard/values-be/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-be/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ідзе зарадка"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ідзе хуткая зарадка"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ідзе павольная зарадка"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Аптымізацыя стану акумулятара"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Падключыце зарадную прыладу."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Націсніце кнопку \"Меню\", каб разблакіраваць."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Сетка заблакіравана"</string>
diff --git a/packages/SystemUI/res-keyguard/values-bg/strings.xml b/packages/SystemUI/res-keyguard/values-bg/strings.xml
index 3890c11..0911efa 100644
--- a/packages/SystemUI/res-keyguard/values-bg/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-bg/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Зарежда се"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Зарежда се бързо"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Зарежда се бавно"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Оптимизиране за състоянието на батерията"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Свържете зарядното си устройство."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Натиснете „Меню“, за да отключите."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Мрежата е заключена"</string>
diff --git a/packages/SystemUI/res-keyguard/values-bn/strings.xml b/packages/SystemUI/res-keyguard/values-bn/strings.xml
index f916374..0c878b6 100644
--- a/packages/SystemUI/res-keyguard/values-bn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-bn/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • চার্জ হচ্ছে"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • দ্রুত চার্জ হচ্ছে"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ধীরে চার্জ হচ্ছে"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ব্যাটারির চার্জ অপটিমাইজ করা হচ্ছে"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"আপনার চার্জার সংযুক্ত করুন।"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"আনলক করতে মেনুতে টিপুন।"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"নেটওয়ার্ক লক করা আছে"</string>
diff --git a/packages/SystemUI/res-keyguard/values-bs/strings.xml b/packages/SystemUI/res-keyguard/values-bs/strings.xml
index 59a881d..83ad38c 100644
--- a/packages/SystemUI/res-keyguard/values-bs/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-bs/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Punjenje"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Brzo punjenje"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Sporo punjenje"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimiziranje radi očuvanja baterije"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Priključite punjač."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Pritisnite meni da otključate."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Mreža je zaključana"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ca/strings.xml b/packages/SystemUI/res-keyguard/values-ca/strings.xml
index 82d63c1..421ddb6 100644
--- a/packages/SystemUI/res-keyguard/values-ca/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ca/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • S\'està carregant"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • S\'està carregant ràpidament"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • S\'està carregant lentament"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • S\'està optimitzant per mantenir el bon estat de la bateria"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Connecta el carregador."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Prem Menú per desbloquejar."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"La xarxa està bloquejada"</string>
diff --git a/packages/SystemUI/res-keyguard/values-cs/strings.xml b/packages/SystemUI/res-keyguard/values-cs/strings.xml
index a4e653f..855d3f0 100644
--- a/packages/SystemUI/res-keyguard/values-cs/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-cs/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Nabíjení"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Rychlé nabíjení"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Pomalé nabíjení"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimalizace pro výdrž baterie"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Připojte dobíjecí zařízení."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Klávesy odemknete stisknutím tlačítka nabídky."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Síť je blokována"</string>
diff --git a/packages/SystemUI/res-keyguard/values-da/strings.xml b/packages/SystemUI/res-keyguard/values-da/strings.xml
index 604852c..b5955c7 100644
--- a/packages/SystemUI/res-keyguard/values-da/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-da/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Oplader"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Oplader hurtigt"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Oplader langsomt"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimerer batteritilstanden"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Tilslut din oplader."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Tryk på menuen for at låse op."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Netværket er låst"</string>
diff --git a/packages/SystemUI/res-keyguard/values-de/strings.xml b/packages/SystemUI/res-keyguard/values-de/strings.xml
index 0e2ea13..d700df3 100644
--- a/packages/SystemUI/res-keyguard/values-de/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-de/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Wird geladen"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Wird schnell geladen"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Wird langsam geladen"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimierung des Akkuzustands"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Ladegerät anschließen."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Zum Entsperren die Menütaste drücken."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Netzwerk gesperrt"</string>
diff --git a/packages/SystemUI/res-keyguard/values-el/strings.xml b/packages/SystemUI/res-keyguard/values-el/strings.xml
index 90e2550..b305698 100644
--- a/packages/SystemUI/res-keyguard/values-el/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-el/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Φόρτιση"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Γρήγορη φόρτιση"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Αργή φόρτιση"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Βελτιστοποίηση για τη διατήρηση της καλής κατάστασης της μπαταρίας"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Συνδέστε τον φορτιστή."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Πατήστε \"Μενού\" για ξεκλείδωμα."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Κλειδωμένο δίκτυο"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml b/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
index 7b0c638..54c1a2b 100644
--- a/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging rapidly"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging slowly"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Battery limited temporarily"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimising for battery health"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Connect your charger."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Press Menu to unlock."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Network locked"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml b/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml
index 2ef720e..d8591e2 100644
--- a/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging rapidly"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging slowly"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Battery limited temporarily"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimising for battery health"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Connect your charger."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Press Menu to unlock."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Network locked"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml b/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
index 7b0c638..54c1a2b 100644
--- a/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging rapidly"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging slowly"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Battery limited temporarily"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimising for battery health"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Connect your charger."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Press Menu to unlock."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Network locked"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml b/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
index 7b0c638..54c1a2b 100644
--- a/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging rapidly"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging slowly"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Battery limited temporarily"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimising for battery health"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Connect your charger."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Press Menu to unlock."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Network locked"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rXC/strings.xml b/packages/SystemUI/res-keyguard/values-en-rXC/strings.xml
index 471ef8b..30f47d2 100644
--- a/packages/SystemUI/res-keyguard/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rXC/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging rapidly"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Charging slowly"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Battery limited temporarily"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimizing for battery health"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Connect your charger."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Press Menu to unlock."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Network locked"</string>
diff --git a/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml b/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml
index a5750b5..4ea99cc 100644
--- a/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando rápidamente"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando lentamente"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Se está optimizando el estado de la batería"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Conecta tu cargador."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Presiona Menú para desbloquear."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Bloqueada para la red"</string>
diff --git a/packages/SystemUI/res-keyguard/values-es/strings.xml b/packages/SystemUI/res-keyguard/values-es/strings.xml
index 69488da..b7384c5e 100644
--- a/packages/SystemUI/res-keyguard/values-es/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-es/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando rápidamente"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando lentamente"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimizando para preservar el estado de la batería"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Conecta el cargador."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Pulsa el menú para desbloquear la pantalla."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Bloqueada para la red"</string>
diff --git a/packages/SystemUI/res-keyguard/values-et/strings.xml b/packages/SystemUI/res-keyguard/values-et/strings.xml
index 948e134..a01d30d 100644
--- a/packages/SystemUI/res-keyguard/values-et/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-et/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Laadimine"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Kiirlaadimine"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Aeglane laadimine"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimeerimine aku seisukorra põhjal"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Ühendage laadija."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Vajutage avamiseks menüüklahvi."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Võrk on lukus"</string>
diff --git a/packages/SystemUI/res-keyguard/values-eu/strings.xml b/packages/SystemUI/res-keyguard/values-eu/strings.xml
index b1aa206..ce8ef20 100644
--- a/packages/SystemUI/res-keyguard/values-eu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-eu/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Kargatzen"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Bizkor kargatzen"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mantso kargatzen"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimizatzen bateria egoera onean mantentzeko"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Konektatu kargagailua."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Desblokeatzeko, sakatu Menua."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Sarea blokeatuta dago"</string>
diff --git a/packages/SystemUI/res-keyguard/values-fa/strings.xml b/packages/SystemUI/res-keyguard/values-fa/strings.xml
index 8fecdd3..61e2e1f 100644
--- a/packages/SystemUI/res-keyguard/values-fa/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fa/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • درحال شارژ شدن"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • درحال شارژ سریع"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • آهستهآهسته شارژ میشود"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • بهینهسازی برای سلامت باتری"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"شارژر را وصل کنید."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"برای باز کردن قفل روی «منو» فشار دهید."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"شبکه قفل شد"</string>
diff --git a/packages/SystemUI/res-keyguard/values-fi/strings.xml b/packages/SystemUI/res-keyguard/values-fi/strings.xml
index c47de5d..021de77 100644
--- a/packages/SystemUI/res-keyguard/values-fi/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fi/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ladataan"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ladataan nopeasti"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ladataan hitaasti"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Akun kunnon optimointi"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Kytke laturi."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Poista lukitus painamalla Valikkoa."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Verkko lukittu"</string>
diff --git a/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml b/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml
index b330452..d1a1582 100644
--- a/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"En recharge : <xliff:g id="PERCENTAGE">%s</xliff:g>"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"En recharge rapide : <xliff:g id="PERCENTAGE">%s</xliff:g>"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"En recharge lente : <xliff:g id="PERCENTAGE">%s</xliff:g>"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimisation en fonction de la santé de la pile"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Branchez votre chargeur."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Appuyez sur la touche Menu pour déverrouiller l\'appareil."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Réseau verrouillé"</string>
diff --git a/packages/SystemUI/res-keyguard/values-fr/strings.xml b/packages/SystemUI/res-keyguard/values-fr/strings.xml
index 0c13c0f..ba35acd 100644
--- a/packages/SystemUI/res-keyguard/values-fr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fr/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Recharge…"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Recharge rapide…"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Recharge lente…"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimisation pour préserver la batterie"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Branchez votre chargeur."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Appuyez sur \"Menu\" pour déverrouiller le clavier."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Réseau verrouillé"</string>
diff --git a/packages/SystemUI/res-keyguard/values-gl/strings.xml b/packages/SystemUI/res-keyguard/values-gl/strings.xml
index 601b2e2..01a0fac 100644
--- a/packages/SystemUI/res-keyguard/values-gl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-gl/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando rapidamente"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Cargando lentamente"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimizando para manter a batería en bo estado"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Conecta o cargador."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Preme Menú para desbloquear."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Bloqueada pola rede"</string>
diff --git a/packages/SystemUI/res-keyguard/values-gu/strings.xml b/packages/SystemUI/res-keyguard/values-gu/strings.xml
index 296124f..8ec7ba5 100644
--- a/packages/SystemUI/res-keyguard/values-gu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-gu/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ચાર્જિંગ"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ઝડપથી ચાર્જિંગ"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ધીમેથી ચાર્જિંગ"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • બૅટરીની ક્ષમતા વધારવા ઑપ્ટિમાઇઝ કરી રહ્યાં છીએ"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"તમારું ચાર્જર કનેક્ટ કરો."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"અનલૉક કરવા માટે મેનૂ દબાવો."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"નેટવર્ક લૉક થયું"</string>
diff --git a/packages/SystemUI/res-keyguard/values-hi/strings.xml b/packages/SystemUI/res-keyguard/values-hi/strings.xml
index c1c9dd5..5869078 100644
--- a/packages/SystemUI/res-keyguard/values-hi/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hi/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • चार्ज हो रहा है"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • तेज़ चार्ज हो रहा है"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • धीरे चार्ज हो रहा है"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • बैटरी की परफ़ॉर्मेंस बेहतर करने के लिए, ऑप्टिमाइज़ किया जा रहा है"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"अपना चार्जर कनेक्ट करें."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"लॉक खोलने के लिए मेन्यू दबाएं."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"नेटवर्क लॉक किया हुआ है"</string>
diff --git a/packages/SystemUI/res-keyguard/values-hr/strings.xml b/packages/SystemUI/res-keyguard/values-hr/strings.xml
index 1b51b33..7e06973 100644
--- a/packages/SystemUI/res-keyguard/values-hr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hr/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • punjenje"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • brzo punjenje"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • sporo punjenje"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimiziranje radi zdravlja baterije"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Priključite punjač."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Pritisnite Izbornik da biste otključali."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Mreža je zaključana"</string>
diff --git a/packages/SystemUI/res-keyguard/values-hu/strings.xml b/packages/SystemUI/res-keyguard/values-hu/strings.xml
index 4dcb229..e6c10d8 100644
--- a/packages/SystemUI/res-keyguard/values-hu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hu/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Töltés"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Gyors töltés"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Lassú töltés"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Az akkumulátor élettartamának optimalizálása…"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Csatlakoztassa a töltőt."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"A feloldáshoz nyomja meg a Menü gombot."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Hálózat zárolva"</string>
diff --git a/packages/SystemUI/res-keyguard/values-hy/strings.xml b/packages/SystemUI/res-keyguard/values-hy/strings.xml
index 354d932..c8ed16d 100644
--- a/packages/SystemUI/res-keyguard/values-hy/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hy/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Լիցքավորում"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Արագ լիցքավորում"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Դանդաղ լիցքավորում"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Օպտիմալացվում է մարտկոցի աշխատանքային հզորության համար"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Միացրեք լիցքավորիչը:"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Ապակողպելու համար սեղմեք Ընտրացանկը:"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Ցանցը կողպված է"</string>
diff --git a/packages/SystemUI/res-keyguard/values-in/strings.xml b/packages/SystemUI/res-keyguard/values-in/strings.xml
index d43823c..696f215 100644
--- a/packages/SystemUI/res-keyguard/values-in/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-in/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mengisi daya"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mengisi daya dengan cepat"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mengisi daya dengan lambat"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mengoptimalkan untuk kesehatan baterai"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Hubungkan pengisi daya."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Tekan Menu untuk membuka kunci."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Jaringan terkunci"</string>
diff --git a/packages/SystemUI/res-keyguard/values-is/strings.xml b/packages/SystemUI/res-keyguard/values-is/strings.xml
index 233402b..3f3bec9 100644
--- a/packages/SystemUI/res-keyguard/values-is/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-is/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Í hleðslu"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Hröð hleðsla"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Hæg hleðsla"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Fínstillir til að bæta rafhlöðuendingu"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Tengdu hleðslutækið."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Ýttu á valmyndarhnappinn til að taka úr lás."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Net læst"</string>
diff --git a/packages/SystemUI/res-keyguard/values-it/strings.xml b/packages/SystemUI/res-keyguard/values-it/strings.xml
index 87fd81c..47d17ce 100644
--- a/packages/SystemUI/res-keyguard/values-it/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-it/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • In carica"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ricarica veloce"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ricarica lenta"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Batteria momentaneamente limitata"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • È in corso l\'ottimizzazione per l\'integrità della batteria"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Collega il caricabatterie."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Premi Menu per sbloccare."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Rete bloccata"</string>
diff --git a/packages/SystemUI/res-keyguard/values-iw/strings.xml b/packages/SystemUI/res-keyguard/values-iw/strings.xml
index 6af70b4..8780dc5 100644
--- a/packages/SystemUI/res-keyguard/values-iw/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-iw/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • בטעינה"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • בטעינה מהירה"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • בטעינה איטית"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • מופעלת אופטימיזציה לשמירה על תקינות הסוללה"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"חבר את המטען."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"לחץ על \'תפריט\' כדי לבטל את הנעילה."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"הרשת נעולה"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ja/strings.xml b/packages/SystemUI/res-keyguard/values-ja/strings.xml
index ab5a13c..b4aea61 100644
--- a/packages/SystemUI/res-keyguard/values-ja/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ja/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 充電中"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 急速充電中"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 低速充電中"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 電池の状態を最適化"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"充電してください。"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"メニューからロックを解除できます。"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ネットワークがロックされました"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ka/strings.xml b/packages/SystemUI/res-keyguard/values-ka/strings.xml
index b10ab61..7e1e59b 100644
--- a/packages/SystemUI/res-keyguard/values-ka/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ka/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • იტენება"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • სწრაფად იტენება"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ნელა იტენება"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ბატარეა დროებით შეზღუდულია"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ოპტიმიზაცია ბატარეის გამართულობისთვის"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"შეაერთეთ დამტენი."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"განსაბლოკად დააჭირეთ მენიუს."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ქსელი ჩაკეტილია"</string>
diff --git a/packages/SystemUI/res-keyguard/values-kk/strings.xml b/packages/SystemUI/res-keyguard/values-kk/strings.xml
index c415bbb..b20cb05 100644
--- a/packages/SystemUI/res-keyguard/values-kk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-kk/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Зарядталуда"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Жылдам зарядталуда"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Баяу зарядталуда"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Батареяның жұмыс істеу қабілеті оңтайландырылуда"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Зарядтағышты қосыңыз."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Ашу үшін \"Мәзір\" пернесін басыңыз."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Желі құлыптаулы"</string>
diff --git a/packages/SystemUI/res-keyguard/values-km/strings.xml b/packages/SystemUI/res-keyguard/values-km/strings.xml
index 1a278e8..fb38bfd 100644
--- a/packages/SystemUI/res-keyguard/values-km/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-km/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • កំពុងសាកថ្ម"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • កំពុងសាកថ្មយ៉ាងឆាប់រហ័ស"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • កំពុងសាកថ្មយឺត"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • កំពុងបង្កើនប្រសិទ្ធភាពគុណភាពថ្ម"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"សូមសាកថ្មរបស់អ្នក។"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"ចុចម៉ឺនុយ ដើម្បីដោះសោ។"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"បណ្ដាញជាប់សោ"</string>
diff --git a/packages/SystemUI/res-keyguard/values-kn/strings.xml b/packages/SystemUI/res-keyguard/values-kn/strings.xml
index 961fcec..a527123 100644
--- a/packages/SystemUI/res-keyguard/values-kn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-kn/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ಚಾರ್ಜ್ ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ವೇಗವಾಗಿ ಚಾರ್ಜ್ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ನಿಧಾನವಾಗಿ ಚಾರ್ಜ್ ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ಬ್ಯಾಟರಿಯ ಆರೋಗ್ಯಕ್ಕಾಗಿ ಆಪ್ಟಿಮೈಸ್ ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"ನಿಮ್ಮ ಚಾರ್ಜರ್ ಸಂಪರ್ಕಗೊಳಿಸಿ."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"ಅನ್ಲಾಕ್ ಮಾಡಲು ಮೆನು ಒತ್ತಿರಿ."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ನೆಟ್ವರ್ಕ್ ಲಾಕ್ ಆಗಿದೆ"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ko/strings.xml b/packages/SystemUI/res-keyguard/values-ko/strings.xml
index 2f93af9..7149cdf 100644
--- a/packages/SystemUI/res-keyguard/values-ko/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ko/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 충전 중"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 고속 충전 중"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 저속 충전 중"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 배터리 상태 최적화 중"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"충전기를 연결하세요."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"잠금 해제하려면 메뉴를 누르세요."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"네트워크 잠김"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ky/strings.xml b/packages/SystemUI/res-keyguard/values-ky/strings.xml
index 7e92919..5327c01 100644
--- a/packages/SystemUI/res-keyguard/values-ky/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ky/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Кубатталууда"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Тез кубатталууда"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Жай кубатталууда"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Батареянын кубатын үнөмдөө иштетилди"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Кубаттагычка туташтырыңыз."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Кулпуну ачуу үчүн Менюну басыңыз."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Тармак кулпуланган"</string>
diff --git a/packages/SystemUI/res-keyguard/values-lo/strings.xml b/packages/SystemUI/res-keyguard/values-lo/strings.xml
index b96a2bb..0f662c3 100644
--- a/packages/SystemUI/res-keyguard/values-lo/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-lo/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ກຳລັງສາກ"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ກຳລັງສາກແບບດ່ວນ"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ກຳລັງສາກແບບຊ້າ"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ກຳລັງເພີ່ມປະສິດທິພາບເພື່ອສຸຂະພາບແບັດເຕີຣີ"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"ເຊື່ອມຕໍ່ສາຍສາກຂອງທ່ານ."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"ກົດ \"ເມນູ\" ເພື່ອປົດລັອກ."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ເຄືອຂ່າຍຖືກລັອກ"</string>
diff --git a/packages/SystemUI/res-keyguard/values-lt/strings.xml b/packages/SystemUI/res-keyguard/values-lt/strings.xml
index 773f7c4..cc8cdfd 100644
--- a/packages/SystemUI/res-keyguard/values-lt/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-lt/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Įkraunama"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Greitai įkraunama"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Lėtai įkraunama"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimizuojama siekiant apsaugoti akumuliatorių"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Prijunkite kroviklį."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Paspauskite meniu, jei norite atrakinti."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Tinklas užrakintas"</string>
diff --git a/packages/SystemUI/res-keyguard/values-lv/strings.xml b/packages/SystemUI/res-keyguard/values-lv/strings.xml
index 68bf4cd..d6fdfaf 100644
--- a/packages/SystemUI/res-keyguard/values-lv/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-lv/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Notiek uzlāde"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Notiek ātrā uzlāde"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Notiek lēnā uzlāde"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Akumulatora darbības optimizēšana"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Pievienojiet uzlādes ierīci."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Lai atbloķētu, nospiediet izvēlnes ikonu."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Tīkls ir bloķēts."</string>
diff --git a/packages/SystemUI/res-keyguard/values-mk/strings.xml b/packages/SystemUI/res-keyguard/values-mk/strings.xml
index e51f774..66744e7 100644
--- a/packages/SystemUI/res-keyguard/values-mk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-mk/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Се полни"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Брзо полнење"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Бавно полнење"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Се оптимизира за состојба на батерија"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Поврзете го полначот."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Притиснете „Мени“ за отклучување."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Мрежата е заклучена"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ml/strings.xml b/packages/SystemUI/res-keyguard/values-ml/strings.xml
index 4b43914..66d0ac7 100644
--- a/packages/SystemUI/res-keyguard/values-ml/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ml/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ചാർജ് ചെയ്യുന്നു"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • വേഗത്തിൽ ചാർജ് ചെയ്യുന്നു"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • പതുക്കെ ചാർജ് ചെയ്യുന്നു"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ബാറ്ററി നില ഒപ്റ്റിമൈസ് ചെയ്യുന്നു"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"നിങ്ങളുടെ ചാർജർ കണക്റ്റുചെയ്യുക."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"അൺലോക്കുചെയ്യാൻ മെനു അമർത്തുക."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"നെറ്റ്വർക്ക് ലോക്കുചെയ്തു"</string>
diff --git a/packages/SystemUI/res-keyguard/values-mn/strings.xml b/packages/SystemUI/res-keyguard/values-mn/strings.xml
index 4667252..2ff4a22 100644
--- a/packages/SystemUI/res-keyguard/values-mn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-mn/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Цэнэглэж байна"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Хурдан цэнэглэж байна"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Удаан цэнэглэж байна"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Батарейн чанарыг оновчилж байна"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Цэнэглэгчээ холбоно уу."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Түгжээг тайлах бол цэсийг дарна уу."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Сүлжээ түгжигдсэн"</string>
diff --git a/packages/SystemUI/res-keyguard/values-mr/strings.xml b/packages/SystemUI/res-keyguard/values-mr/strings.xml
index bdd3904..e2ffc62 100644
--- a/packages/SystemUI/res-keyguard/values-mr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-mr/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • चार्ज होत आहे"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • वेगाने चार्ज होत आहे"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • सावकाश चार्ज होत आहे"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • बॅटरीची क्षमता वाढवण्यासाठी ऑप्टिमाइझ करत आहे"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"तुमचा चार्जर कनेक्ट करा."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"अनलॉक करण्यासाठी मेनू दाबा."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"नेटवर्क लॉक केले"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ms/strings.xml b/packages/SystemUI/res-keyguard/values-ms/strings.xml
index a517988..dcd460b 100644
--- a/packages/SystemUI/res-keyguard/values-ms/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ms/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mengecas"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mengecas dengan cepat"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mengecas dengan perlahan"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Pengoptimuman untuk kesihatan bateri"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Sambungkan pengecas anda."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Tekan Menu untuk membuka kunci."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Rangkaian dikunci"</string>
diff --git a/packages/SystemUI/res-keyguard/values-my/strings.xml b/packages/SystemUI/res-keyguard/values-my/strings.xml
index 07f3d38..bbeadd0 100644
--- a/packages/SystemUI/res-keyguard/values-my/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-my/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • အားသွင်းနေသည်"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • အမြန်အားသွင်းနေသည်"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • နှေးကွေးစွာ အားသွင်းနေသည်"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ဘက်ထရီအခြေအနေကို အကောင်းဆုံးဖြစ်အောင် လုပ်နေသည်"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"အားသွင်းကိရိယာကို ချိတ်ဆက်ပါ။"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"မီနူးကို နှိပ်၍ လော့ခ်ဖွင့်ပါ။"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ကွန်ရက်ကို လော့ခ်ချထားသည်"</string>
diff --git a/packages/SystemUI/res-keyguard/values-nb/strings.xml b/packages/SystemUI/res-keyguard/values-nb/strings.xml
index a391b92..8a3045a 100644
--- a/packages/SystemUI/res-keyguard/values-nb/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-nb/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Lader"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Lader raskt"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Lader sakte"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimaliserer batteritilstanden"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Koble til en batterilader."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Trykk på menyknappen for å låse opp."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Nettverket er låst"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ne/strings.xml b/packages/SystemUI/res-keyguard/values-ne/strings.xml
index 812aa38..6f8a108 100644
--- a/packages/SystemUI/res-keyguard/values-ne/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ne/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • चार्ज गरिँदै"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • द्रुत गतिमा चार्ज गरिँदै"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • मन्द गतिमा चार्ज गरिँदै"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ब्याट्री लामो समयसम्म टिक्ने बनाउन अप्टिमाइज गरिँदै छ"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"तपाईंको चार्जर जोड्नुहोस्।"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"अनलक गर्न मेनु थिच्नुहोस्।"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"नेटवर्क लक भएको छ"</string>
diff --git a/packages/SystemUI/res-keyguard/values-nl/strings.xml b/packages/SystemUI/res-keyguard/values-nl/strings.xml
index f1c2033..a9fd827 100644
--- a/packages/SystemUI/res-keyguard/values-nl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-nl/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Opladen"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Snel opladen"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Langzaam opladen"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimaliseren voor batterijduur"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Sluit de oplader aan."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Druk op Menu om te ontgrendelen."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Netwerk vergrendeld"</string>
diff --git a/packages/SystemUI/res-keyguard/values-or/strings.xml b/packages/SystemUI/res-keyguard/values-or/strings.xml
index be6e285..385c13b 100644
--- a/packages/SystemUI/res-keyguard/values-or/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-or/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ଚାର୍ଜ ହେଉଛି"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ଦ୍ରୁତ ଭାବେ ଚାର୍ଜ ହେଉଛି"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ଧୀରେ ଚାର୍ଜ ହେଉଛି"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ବ୍ୟାଟେରୀ ହେଲ୍ଥ ପାଇଁ ଅପ୍ଟିମାଇଜ୍ ହେଉଛି"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"ଆପଣଙ୍କ ଚାର୍ଜର୍ ସଂଯୋଗ କରନ୍ତୁ।"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"ଅନଲକ୍ କରିବା ପାଇଁ ମେନୁକୁ ଦବାନ୍ତୁ।"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ନେଟୱର୍କକୁ ଲକ୍ କରାଯାଇଛି"</string>
diff --git a/packages/SystemUI/res-keyguard/values-pa/strings.xml b/packages/SystemUI/res-keyguard/values-pa/strings.xml
index a6ea6aa..43d549c 100644
--- a/packages/SystemUI/res-keyguard/values-pa/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pa/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ਚਾਰਜ ਹੋ ਰਿਹਾ ਹੈ"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ਤੇਜ਼ੀ ਨਾਲ ਚਾਰਜ ਹੋ ਰਿਹਾ ਹੈ"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ਹੌਲੀ-ਹੌਲੀ ਚਾਰਜ ਹੋ ਰਿਹਾ ਹੈ"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ਬੈਟਰੀ ਸਥਿਤੀ ਲਈ ਅਨੁਕੂਲ ਬਣਾਇਆ ਜਾ ਰਿਹਾ"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"ਆਪਣਾ ਚਾਰਜਰ ਕਨੈਕਟ ਕਰੋ।"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"ਅਣਲਾਕ ਕਰਨ ਲਈ \"ਮੀਨੂ\" ਦਬਾਓ।"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ਨੈੱਟਵਰਕ ਲਾਕ ਕੀਤਾ ਗਿਆ"</string>
diff --git a/packages/SystemUI/res-keyguard/values-pl/strings.xml b/packages/SystemUI/res-keyguard/values-pl/strings.xml
index 9c6f271..76f755c 100644
--- a/packages/SystemUI/res-keyguard/values-pl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pl/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ładowanie"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Szybkie ładowanie"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Wolne ładowanie"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optymalizuję, by utrzymać baterię w dobrym stanie"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Podłącz ładowarkę."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Naciśnij Menu, aby odblokować."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Sieć zablokowana"</string>
diff --git a/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml b/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml
index d2d5fb9..29c46f8 100644
--- a/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Carregando"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Carregando rapidamente"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Carregando lentamente"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Bateria limitada temporariamente"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Otimizando para integridade da bateria"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Conecte o seu carregador."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Pressione Menu para desbloquear."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Rede bloqueada"</string>
diff --git a/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml b/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml
index 7f0a4d88..b15c9dc 100644
--- a/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • A carregar…"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • A carregar rapidamente…"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • A carregar lentamente…"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Bateria limitada temporariamente."</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • A otimizar o estado da bateria"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Ligue o carregador."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Prima Menu para desbloquear."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Rede bloqueada"</string>
diff --git a/packages/SystemUI/res-keyguard/values-pt/strings.xml b/packages/SystemUI/res-keyguard/values-pt/strings.xml
index d2d5fb9..29c46f8 100644
--- a/packages/SystemUI/res-keyguard/values-pt/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pt/strings.xml
@@ -38,7 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Carregando"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Carregando rapidamente"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Carregando lentamente"</string>
- <string name="keyguard_plugged_in_charging_limited" msgid="8190982388514496109">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Bateria limitada temporariamente"</string>
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Otimizando para integridade da bateria"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Conecte o seu carregador."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Pressione Menu para desbloquear."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Rede bloqueada"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ro/strings.xml b/packages/SystemUI/res-keyguard/values-ro/strings.xml
index 572c1db..868d9f7 100644
--- a/packages/SystemUI/res-keyguard/values-ro/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ro/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Se încarcă"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Se încarcă rapid"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Se încarcă lent"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Se fac optimizări pentru buna funcționare a bateriei"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Conectați încărcătorul."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Apăsați pe Meniu pentru a debloca."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Rețea blocată"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ru/strings.xml b/packages/SystemUI/res-keyguard/values-ru/strings.xml
index 2c87608..24d762d 100644
--- a/packages/SystemUI/res-keyguard/values-ru/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ru/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"Идет зарядка (<xliff:g id="PERCENTAGE">%s</xliff:g>)"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"Идет быстрая зарядка (<xliff:g id="PERCENTAGE">%s</xliff:g>)"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"Идет медленная зарядка (<xliff:g id="PERCENTAGE">%s</xliff:g>)"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Оптимизация для увеличения срока службы батареи"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Подключите зарядное устройство."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Для разблокировки нажмите \"Меню\"."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Сеть заблокирована"</string>
diff --git a/packages/SystemUI/res-keyguard/values-si/strings.xml b/packages/SystemUI/res-keyguard/values-si/strings.xml
index 8682192..3a60782 100644
--- a/packages/SystemUI/res-keyguard/values-si/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-si/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ආරෝපණය වෙමින්"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • වේගයෙන් ආරෝපණය වෙමින්"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • සෙමින් ආරෝපණය වෙමින්"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • බැටරි සෞඛ්යය සඳහා ප්රශස්ත කරමින්"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"ඔබගේ ආරෝපකයට සම්බන්ධ කරන්න."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"අගුලු හැරීමට මෙනුව ඔබන්න."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"ජාලය අගුළු දමා ඇත"</string>
diff --git a/packages/SystemUI/res-keyguard/values-sk/strings.xml b/packages/SystemUI/res-keyguard/values-sk/strings.xml
index d5e6093..98aa79a 100644
--- a/packages/SystemUI/res-keyguard/values-sk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sk/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Nabíja sa"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Nabíja sa rýchlo"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Nabíja sa pomaly"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimalizuje sa na zaistenie dobrého stavu batérie"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Pripojte nabíjačku."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Odomknete stlačením tlačidla ponuky."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Sieť je zablokovaná"</string>
diff --git a/packages/SystemUI/res-keyguard/values-sl/strings.xml b/packages/SystemUI/res-keyguard/values-sl/strings.xml
index 82d5c54..cd41d9b 100644
--- a/packages/SystemUI/res-keyguard/values-sl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sl/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • polnjenje"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • hitro polnjenje"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • počasno polnjenje"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimizacija za ohranjanje zmogljivosti baterije"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Priključite napajalnik."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Če želite odkleniti, pritisnite meni."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Omrežje je zaklenjeno"</string>
diff --git a/packages/SystemUI/res-keyguard/values-sq/strings.xml b/packages/SystemUI/res-keyguard/values-sq/strings.xml
index a67413fd..0ad97a4 100644
--- a/packages/SystemUI/res-keyguard/values-sq/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sq/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Po karikohet"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Po karikohet me shpejtësi"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Po karikohet ngadalë"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Po optimizohet për integritetin e baterisë"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Lidh karikuesin."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Shtyp \"Meny\" për të shkyçur."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Rrjeti është i kyçur"</string>
diff --git a/packages/SystemUI/res-keyguard/values-sr/strings.xml b/packages/SystemUI/res-keyguard/values-sr/strings.xml
index dec3165..90b8a3e 100644
--- a/packages/SystemUI/res-keyguard/values-sr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sr/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Пуни се"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Брзо се пуни"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Споро се пуни"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Оптимизује се ради доброг стања батерије"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Прикључите пуњач."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Притисните Мени да бисте откључали."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Мрежа је закључана"</string>
diff --git a/packages/SystemUI/res-keyguard/values-sv/strings.xml b/packages/SystemUI/res-keyguard/values-sv/strings.xml
index 3ef2dfe..80323e6 100644
--- a/packages/SystemUI/res-keyguard/values-sv/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sv/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Laddas"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Laddas snabbt"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Laddas långsamt"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Optimerar batteriets livslängd"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Anslut laddaren."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Lås upp genom att trycka på Meny."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Nätverk låst"</string>
diff --git a/packages/SystemUI/res-keyguard/values-sw/strings.xml b/packages/SystemUI/res-keyguard/values-sw/strings.xml
index 5c5fc10..da35262 100644
--- a/packages/SystemUI/res-keyguard/values-sw/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sw/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Inachaji"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Inachaji kwa kasi"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Inachaji pole pole"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Inaboresha muda wa kutumia betri"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Unganisha chaja yako."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Bonyeza Menyu ili kufungua."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Mtandao umefungwa"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ta/strings.xml b/packages/SystemUI/res-keyguard/values-ta/strings.xml
index c188301..ca92577 100644
--- a/packages/SystemUI/res-keyguard/values-ta/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ta/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • சார்ஜாகிறது"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • வேகமாகச் சார்ஜாகிறது"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • மெதுவாகச் சார்ஜாகிறது"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • பேட்டரியின் ஆயுளை மேம்படுத்துகிறது"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"சார்ஜரை இணைக்கவும்."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"திறக்க, மெனுவை அழுத்தவும்."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"நெட்வொர்க் பூட்டப்பட்டது"</string>
diff --git a/packages/SystemUI/res-keyguard/values-te/strings.xml b/packages/SystemUI/res-keyguard/values-te/strings.xml
index 27a5b28..c69a8f5 100644
--- a/packages/SystemUI/res-keyguard/values-te/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-te/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • ఛార్జ్ అవుతోంది"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • వేగంగా ఛార్జ్ అవుతోంది"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • నెమ్మదిగా ఛార్జ్ అవుతోంది"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • బ్యాటరీ జీవితకాలాన్ని ఆప్టిమైజ్ చేయడం కోసం"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"మీ ఛార్జర్ను కనెక్ట్ చేయండి."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"అన్లాక్ చేయడానికి మెనుని నొక్కండి."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"నెట్వర్క్ లాక్ చేయబడింది"</string>
diff --git a/packages/SystemUI/res-keyguard/values-th/strings.xml b/packages/SystemUI/res-keyguard/values-th/strings.xml
index e506745..4fd3dd1 100644
--- a/packages/SystemUI/res-keyguard/values-th/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-th/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • กำลังชาร์จ"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • กำลังชาร์จอย่างเร็ว"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • กำลังชาร์จอย่างช้าๆ"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • กำลังเพิ่มประสิทธิภาพแบตเตอรี่"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"เสียบที่ชาร์จของคุณ"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"กด \"เมนู\" เพื่อปลดล็อก"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"เครือข่ายถูกล็อก"</string>
diff --git a/packages/SystemUI/res-keyguard/values-tl/strings.xml b/packages/SystemUI/res-keyguard/values-tl/strings.xml
index 912fd95..8f26ea9 100644
--- a/packages/SystemUI/res-keyguard/values-tl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-tl/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Nagcha-charge"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mabilis na nagcha-charge"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Mabagal na nagcha-charge"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ino-optimize para sa tagal ng baterya"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Ikonekta ang iyong charger."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Pindutin ang Menu upang i-unlock."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Naka-lock ang network"</string>
diff --git a/packages/SystemUI/res-keyguard/values-tr/strings.xml b/packages/SystemUI/res-keyguard/values-tr/strings.xml
index 5390c4c..53a1cc7 100644
--- a/packages/SystemUI/res-keyguard/values-tr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-tr/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Şarj oluyor"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Hızlı şarj oluyor"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Yavaş şarj oluyor"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Pil sağlığı için optimize ediliyor"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Şarj cihazınızı takın."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Kilidi açmak için Menü\'ye basın."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Ağ kilitli"</string>
diff --git a/packages/SystemUI/res-keyguard/values-uk/strings.xml b/packages/SystemUI/res-keyguard/values-uk/strings.xml
index 6263d79..a16576d 100644
--- a/packages/SystemUI/res-keyguard/values-uk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-uk/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Заряджання"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Швидке заряджання"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Повільне заряджання"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Стан акумулятора оптимізується"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Підключіть зарядний пристрій."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Натисніть меню, щоб розблокувати."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Мережу заблоковано"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ur/strings.xml b/packages/SystemUI/res-keyguard/values-ur/strings.xml
index bf936cb..a14f20d 100644
--- a/packages/SystemUI/res-keyguard/values-ur/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ur/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • چارج ہو رہا ہے"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • تیزی سے چارج ہو رہا ہے"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • آہستہ چارج ہو رہا ہے"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • بیٹری کی صحت کے لیے بہتر بنایا جا رہا ہے"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"اپنا چارجر منسلک کریں۔"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"غیر مقفل کرنے کیلئے مینو دبائیں۔"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"نیٹ ورک مقفل ہو گیا"</string>
diff --git a/packages/SystemUI/res-keyguard/values-uz/strings.xml b/packages/SystemUI/res-keyguard/values-uz/strings.xml
index 0b23e16..24a14c7 100644
--- a/packages/SystemUI/res-keyguard/values-uz/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-uz/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Quvvat olmoqda"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Tezkor quvvat olmoqda"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Sekin quvvat olmoqda"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Batareya quvvati muvozanatlanmoqda"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Quvvatlash moslamasini ulang."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Qulfdan chiqarish uchun Menyu tugmasini bosing."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Tarmoq qulflangan"</string>
diff --git a/packages/SystemUI/res-keyguard/values-vi/strings.xml b/packages/SystemUI/res-keyguard/values-vi/strings.xml
index 9357eba..3221066 100644
--- a/packages/SystemUI/res-keyguard/values-vi/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-vi/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Đang sạc"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Đang sạc nhanh"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Đang sạc chậm"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Đang tối ưu hóa để cải thiện độ bền của pin"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Kết nối bộ sạc của bạn."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Nhấn vào Menu để mở khóa."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Mạng đã bị khóa"</string>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
index 96728ab..a3921d0 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 正在充电"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 正在快速充电"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 正在慢速充电"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 正在针对电池状况进行优化"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"请连接充电器。"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"按“菜单”即可解锁。"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"网络已锁定"</string>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
index c683529..1054e36 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 正在充電"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 正在快速充電"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> •正在慢速充電"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 正在優化電池狀態"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"請連接充電器。"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"按下 [選單] 即可解鎖。"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"網絡已鎖定"</string>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
index 7a3b5c5..7efa2f9 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 充電中"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 快速充電中"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 慢速充電中"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • 針對電池狀態進行最佳化調整"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"請連接充電器。"</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"按選單鍵解鎖。"</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"網路已鎖定"</string>
diff --git a/packages/SystemUI/res-keyguard/values-zu/strings.xml b/packages/SystemUI/res-keyguard/values-zu/strings.xml
index ec38cbe..d87622a 100644
--- a/packages/SystemUI/res-keyguard/values-zu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zu/strings.xml
@@ -38,8 +38,7 @@
<string name="keyguard_plugged_in" msgid="8169926454348380863">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Iyashaja"</string>
<string name="keyguard_plugged_in_charging_fast" msgid="4386594091107340426">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ishaja kaningi"</string>
<string name="keyguard_plugged_in_charging_slowly" msgid="217655355424210">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ishaja kancane"</string>
- <!-- no translation found for keyguard_plugged_in_charging_limited (8190982388514496109) -->
- <skip />
+ <string name="keyguard_plugged_in_charging_limited" msgid="1158086783302116604">"<xliff:g id="PERCENTAGE">%s</xliff:g> • Ilungiselela impilo yebhethri"</string>
<string name="keyguard_low_battery" msgid="1868012396800230904">"Xhuma ishaja yakho."</string>
<string name="keyguard_instructions_when_pattern_disabled" msgid="8448804180089936954">"Chofoza Menyu ukuvula."</string>
<string name="keyguard_network_locked_message" msgid="407096292844868608">"Inethiwekhi ivaliwe"</string>
diff --git a/packages/SystemUI/res/color/camera_foreground.xml b/packages/SystemUI/res/color/camera_foreground.xml
new file mode 100644
index 0000000..6e039cc
--- /dev/null
+++ b/packages/SystemUI/res/color/camera_foreground.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright 2010, 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.
+ */
+-->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false"
+ android:color="@color/control_default_foreground" />
+ <item android:color="@color/GM2_grey_100" />
+</selector>
diff --git a/packages/SystemUI/res/color/qs_background_dark.xml b/packages/SystemUI/res/color/qs_background_dark.xml
deleted file mode 100644
index c47959a..0000000
--- a/packages/SystemUI/res/color/qs_background_dark.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:alpha="1"
- android:color="?android:attr/colorBackground"/>
-</selector>
diff --git a/packages/SystemUI/res/drawable/brightness_mirror_background.xml b/packages/SystemUI/res/drawable/brightness_mirror_background.xml
index 43c9b73..4b225b7 100644
--- a/packages/SystemUI/res/drawable/brightness_mirror_background.xml
+++ b/packages/SystemUI/res/drawable/brightness_mirror_background.xml
@@ -15,6 +15,6 @@
~ limitations under the License
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="@color/qs_background_dark" />
+ <solid android:color="?android:attr/colorBackgroundFloating" />
<corners android:radius="8dp" />
</shape>
diff --git a/packages/SystemUI/res/drawable/brightness_progress_drawable_thick.xml b/packages/SystemUI/res/drawable/brightness_progress_drawable_thick.xml
index ca56ec1..108591b 100644
--- a/packages/SystemUI/res/drawable/brightness_progress_drawable_thick.xml
+++ b/packages/SystemUI/res/drawable/brightness_progress_drawable_thick.xml
@@ -16,6 +16,27 @@
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingMode="stack">
+ <item android:id="@android:id/background"
+ android:gravity="center_vertical|fill_horizontal">
+ <layer-list >
+ <item>
+ <shape
+ android:tint="?android:attr/colorControlActivated"
+ android:alpha="?android:attr/disabledAlpha">
+ <size android:height="48dp" />
+ <solid android:color="@color/white_disabled" />
+ <corners android:radius="24dp" />
+ </shape>
+ </item>
+ <item
+ android:gravity="center_vertical|start"
+ android:start="32dp">
+ <com.android.systemui.util.AlphaTintDrawableWrapper
+ android:drawable="@drawable/ic_brightness"
+ android:tint="?android:attr/colorControlActivated" />
+ </item>
+ </layer-list>
+ </item>
<item android:id="@android:id/progress"
android:gravity="center_vertical|fill_horizontal">
<clip
@@ -24,13 +45,4 @@
android:gravity="left"
/>
</item>
- <item android:id="@android:id/background"
- android:gravity="center_vertical|fill_horizontal">
- <shape android:shape="rectangle"
- android:tint="?android:attr/colorControlNormal">
- <size android:height="48dp" />
- <solid android:color="@color/white_disabled" />
- <corners android:radius="24dp" />
- </shape>
- </item>
</layer-list>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml b/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml
index a38b8b4..b5def5e 100644
--- a/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml
+++ b/packages/SystemUI/res/drawable/brightness_progress_full_drawable.xml
@@ -15,10 +15,21 @@
~ limitations under the License.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle"
- android:tint="?android:attr/colorControlActivated">
- <size android:height="48dp" />
- <solid android:color="@android:color/white" />
- <corners android:radius="24dp"/>
-</shape>
\ No newline at end of file
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/slider_foreground">
+ <shape>
+ <size android:height="48dp" />
+ <solid android:color="?android:attr/colorControlActivated" />
+ <corners android:radius="24dp"/>
+ </shape>
+ </item>
+ <item
+ android:id="@+id/slider_icon"
+ android:gravity="center_vertical|start"
+ android:start="32dp">
+ <com.android.systemui.util.AlphaTintDrawableWrapper
+ android:drawable="@drawable/ic_brightness"
+ android:tint="?android:attr/colorBackground"
+ android:alpha="0.8"/>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/ic_open_in_new_fullscreen.xml b/packages/SystemUI/res/drawable/ic_open_in_new_fullscreen.xml
index 55116c6..9f66581 100644
--- a/packages/SystemUI/res/drawable/ic_open_in_new_fullscreen.xml
+++ b/packages/SystemUI/res/drawable/ic_open_in_new_fullscreen.xml
@@ -19,8 +19,8 @@
<shape android:shape="rectangle">
<solid android:color="@color/magnification_switch_button_color" />
<size
- android:width="40dp"
- android:height="40dp" />
+ android:width="48dp"
+ android:height="48dp" />
</shape>
</item>
diff --git a/packages/SystemUI/res/drawable/ic_open_in_new_window.xml b/packages/SystemUI/res/drawable/ic_open_in_new_window.xml
index 5f571cf..659b020 100644
--- a/packages/SystemUI/res/drawable/ic_open_in_new_window.xml
+++ b/packages/SystemUI/res/drawable/ic_open_in_new_window.xml
@@ -19,8 +19,8 @@
<shape android:shape="rectangle">
<solid android:color="@color/magnification_switch_button_color" />
<size
- android:width="40dp"
- android:height="40dp" />
+ android:width="48dp"
+ android:height="48dp" />
</shape>
</item>
diff --git a/packages/SystemUI/res/drawable/people_space_content_background.xml b/packages/SystemUI/res/drawable/people_space_content_background.xml
new file mode 100644
index 0000000..53108409
--- /dev/null
+++ b/packages/SystemUI/res/drawable/people_space_content_background.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+<shape xmlns:android="http://schemas.android.com/apk/res/android" >
+ <solid android:color="?android:attr/colorControlHighlight" />
+ <corners android:radius="@dimen/people_space_widget_radius" />
+</shape>
diff --git a/packages/SystemUI/res/drawable/people_space_round_tile_view_card.xml b/packages/SystemUI/res/drawable/people_space_round_tile_view_card.xml
new file mode 100644
index 0000000..59af775
--- /dev/null
+++ b/packages/SystemUI/res/drawable/people_space_round_tile_view_card.xml
@@ -0,0 +1,19 @@
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="?android:attr/colorBackground" />
+ <corners android:radius="@dimen/people_space_widget_round_radius" />
+</shape>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/people_space_rounded_border.xml b/packages/SystemUI/res/drawable/people_space_rounded_border.xml
new file mode 100644
index 0000000..9956bc2
--- /dev/null
+++ b/packages/SystemUI/res/drawable/people_space_rounded_border.xml
@@ -0,0 +1,19 @@
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval">
+ <solid android:color="?android:attr/colorBackground" />
+</shape>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/people_space_tile_view_card.xml b/packages/SystemUI/res/drawable/people_space_tile_view_card.xml
index 4772ae7..8fd4388 100644
--- a/packages/SystemUI/res/drawable/people_space_tile_view_card.xml
+++ b/packages/SystemUI/res/drawable/people_space_tile_view_card.xml
@@ -14,6 +14,6 @@
~ limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="@android:color/white" />
+ <solid android:color="?android:attr/colorBackground" />
<corners android:radius="@dimen/people_space_widget_radius" />
</shape>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/people_space_widget_background.xml b/packages/SystemUI/res/drawable/people_space_widget_background.xml
index b929359..fa45718 100644
--- a/packages/SystemUI/res/drawable/people_space_widget_background.xml
+++ b/packages/SystemUI/res/drawable/people_space_widget_background.xml
@@ -18,7 +18,7 @@
android:shape="rectangle" >
<solid
android:color="?android:attr/colorControlNormal" />
- <corners android:radius="@dimen/people_space_widget_radius" />
+ <corners android:radius="@dimen/people_space_widget_background_padding" />
<padding
android:left="@dimen/people_space_widget_background_padding"
android:top="@dimen/people_space_widget_background_padding"
diff --git a/packages/SystemUI/res/drawable/qs_background_primary.xml b/packages/SystemUI/res/drawable/qs_background_primary.xml
deleted file mode 100644
index dd74cadd..0000000
--- a/packages/SystemUI/res/drawable/qs_background_primary.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 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.
--->
-<inset xmlns:android="http://schemas.android.com/apk/res/android">
- <shape>
- <solid android:color="@color/qs_background_dark"/>
- <corners android:radius="?android:attr/dialogCornerRadius" />
- </shape>
-</inset>
diff --git a/packages/SystemUI/res/drawable/qs_customizer_background_primary.xml b/packages/SystemUI/res/drawable/qs_customizer_background_primary.xml
index 215dee4..c2d0841 100644
--- a/packages/SystemUI/res/drawable/qs_customizer_background_primary.xml
+++ b/packages/SystemUI/res/drawable/qs_customizer_background_primary.xml
@@ -15,7 +15,7 @@
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<shape>
- <solid android:color="@color/qs_customize_background"/>
+ <solid android:color="?android:attr/colorBackgroundFloating"/>
<corners android:radius="?android:attr/dialogCornerRadius" />
</shape>
</inset>
diff --git a/packages/SystemUI/res/drawable/qs_customizer_toolbar.xml b/packages/SystemUI/res/drawable/qs_customizer_toolbar.xml
index 648d45b..7cb44b3 100644
--- a/packages/SystemUI/res/drawable/qs_customizer_toolbar.xml
+++ b/packages/SystemUI/res/drawable/qs_customizer_toolbar.xml
@@ -15,7 +15,7 @@
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android">
<shape>
- <solid android:color="@color/qs_customize_background"/>
+ <solid android:color="?android:attr/colorBackgroundFloating"/>
<corners
android:topLeftRadius="?android:attr/dialogCornerRadius"
android:topRightRadius="?android:attr/dialogCornerRadius" />
diff --git a/packages/SystemUI/res/drawable/qs_detail_background.xml b/packages/SystemUI/res/drawable/qs_detail_background.xml
index 672abf1..76045e4 100644
--- a/packages/SystemUI/res/drawable/qs_detail_background.xml
+++ b/packages/SystemUI/res/drawable/qs_detail_background.xml
@@ -25,7 +25,7 @@
<item>
<inset>
<shape>
- <solid android:color="?android:attr/colorPrimary"/>
+ <solid android:color="?android:attr/colorBackgroundFloating"/>
<corners android:radius="?android:attr/dialogCornerRadius" />
</shape>
</inset>
diff --git a/packages/SystemUI/res/drawable/qs_footer_drag_handle.xml b/packages/SystemUI/res/drawable/qs_footer_drag_handle.xml
index 509cd1f..59dad0e 100644
--- a/packages/SystemUI/res/drawable/qs_footer_drag_handle.xml
+++ b/packages/SystemUI/res/drawable/qs_footer_drag_handle.xml
@@ -17,6 +17,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
- android:color="#e5e5e5" />
+ android:color="?android:attr/textColorPrimary" />
<corners android:radius="2dp" />
</shape>
diff --git a/packages/SystemUI/res/layout-sw600dp-land/global_actions_grid_v2.xml b/packages/SystemUI/res/layout-sw600dp-land/global_actions_grid_v2.xml
new file mode 100644
index 0000000..953a29e
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp-land/global_actions_grid_v2.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/global_actions_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:layout_width="0dp"
+ android:clipChildren="false"
+ android:orientation="vertical"
+ android:clipToPadding="false"
+ android:id="@+id/controls_pane"
+ >
+ <LinearLayout
+ android:id="@+id/global_actions_controls"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:layout_width="0dp"
+ android:orientation="vertical"
+ android:id="@+id/nfc_pane"
+ >
+ <include layout="@layout/global_actions_view" />
+
+ <include layout="@layout/global_actions_lock_view" />
+
+ <LinearLayout
+ android:id="@+id/global_actions_grid_root"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:clipChildren="false"
+ android:orientation="vertical"
+ android:clipToPadding="false">
+
+ <FrameLayout
+ android:id="@+id/global_actions_wallet"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+ </LinearLayout>
+
+ </LinearLayout>
+</LinearLayout>
diff --git a/packages/SystemUI/res/layout-sw600dp/global_actions_controls_list_view.xml b/packages/SystemUI/res/layout-sw600dp/global_actions_controls_list_view.xml
new file mode 100644
index 0000000..ef49b9c
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp/global_actions_controls_list_view.xml
@@ -0,0 +1,30 @@
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+
+<com.android.systemui.globalactions.MinHeightScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:scrollbars="none">
+ <LinearLayout
+ android:id="@+id/global_actions_controls_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginLeft="@dimen/global_actions_side_margin"
+ android:layout_marginRight="@dimen/global_actions_side_margin" />
+</com.android.systemui.globalactions.MinHeightScrollView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout-sw600dp/global_actions_grid_v2.xml b/packages/SystemUI/res/layout-sw600dp/global_actions_grid_v2.xml
new file mode 100644
index 0000000..6ffcef7
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp/global_actions_grid_v2.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/global_actions_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:id="@+id/nfc_pane"
+ >
+
+ <include layout="@layout/global_actions_view" />
+
+ <include layout="@layout/global_actions_lock_view" />
+
+
+ <com.android.systemui.globalactions.MinHeightScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:scrollbars="none">
+
+ <LinearLayout
+ android:id="@+id/global_actions_grid_root"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:clipChildren="false"
+ android:orientation="vertical"
+ android:clipToPadding="false">
+
+ <FrameLayout
+ android:id="@+id/global_actions_wallet"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+ </LinearLayout>
+ </com.android.systemui.globalactions.MinHeightScrollView>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:id="@+id/controls_pane"
+ android:clipToPadding="false"
+ android:clipChildren="false">
+ <LinearLayout
+ android:id="@+id/global_actions_controls"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"/>
+ </LinearLayout>
+</LinearLayout>
diff --git a/packages/SystemUI/res/layout/controls_with_favorites.xml b/packages/SystemUI/res/layout/controls_with_favorites.xml
index 065ff68..b060afd 100644
--- a/packages/SystemUI/res/layout/controls_with_favorites.xml
+++ b/packages/SystemUI/res/layout/controls_with_favorites.xml
@@ -58,11 +58,5 @@
android:background="?android:attr/selectableItemBackgroundBorderless" />
</LinearLayout>
- <LinearLayout
- android:id="@+id/global_actions_controls_list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginLeft="@dimen/global_actions_side_margin"
- android:layout_marginRight="@dimen/global_actions_side_margin" />
+ <include layout="@layout/global_actions_controls_list_view" />
</merge>
diff --git a/packages/SystemUI/res/layout/feedback_info.xml b/packages/SystemUI/res/layout/feedback_info.xml
index 7047c1b..753f56a 100644
--- a/packages/SystemUI/res/layout/feedback_info.xml
+++ b/packages/SystemUI/res/layout/feedback_info.xml
@@ -109,24 +109,4 @@
style="@style/TextAppearance.NotificationInfo.Button"/>
</LinearLayout>
- <!-- Done button -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/notification_guts_button_spacing"
- android:layout_marginBottom="@dimen/notification_guts_button_spacing"
- android:gravity="end"
- android:orientation="horizontal">
-
- <TextView
- android:id="@+id/ok"
- android:text="@string/feedback_ok"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:background="@drawable/ripple_drawable"
- android:minWidth="48dp"
- android:layout_marginStart="8dp"
- android:layout_marginEnd="-8dp"
- style="@style/TextAppearance.NotificationInfo.Button"/>
- </LinearLayout>
</com.android.systemui.statusbar.notification.row.FeedbackInfo>
diff --git a/packages/SystemUI/res/layout/global_actions_controls_list_view.xml b/packages/SystemUI/res/layout/global_actions_controls_list_view.xml
new file mode 100644
index 0000000..e1c2611
--- /dev/null
+++ b/packages/SystemUI/res/layout/global_actions_controls_list_view.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/global_actions_controls_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginLeft="@dimen/global_actions_side_margin"
+ android:layout_marginRight="@dimen/global_actions_side_margin" />
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml
index 99b9ced..14a5e58 100644
--- a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml
+++ b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml
@@ -18,7 +18,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_weight="1"
- android:layout_height="98dp"
+ android:layout_height="@dimen/global_actions_grid_item_layout_height"
android:gravity="bottom|center_horizontal"
android:orientation="vertical"
android:paddingTop="12dp"
diff --git a/packages/SystemUI/res/layout/people_space_large_avatar_tile.xml b/packages/SystemUI/res/layout/people_space_large_avatar_tile.xml
new file mode 100644
index 0000000..e9f3424
--- /dev/null
+++ b/packages/SystemUI/res/layout/people_space_large_avatar_tile.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <LinearLayout
+ android:background="@drawable/people_space_round_tile_view_card"
+ android:id="@+id/item"
+ android:paddingVertical="6dp"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:gravity="center_vertical"
+ android:paddingStart="12dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:id="@+id/person_icon"
+ android:layout_width="60dp"
+ android:layout_height="60dp" />
+
+ <LinearLayout
+ android:background="@drawable/people_space_rounded_border"
+ android:layout_marginStart="-12dp"
+ android:layout_marginTop="28dp"
+ android:layout_marginBottom="14dp"
+ android:layout_width="16dp"
+ android:layout_height="16dp">
+
+ <ImageView
+ android:id="@+id/package_icon"
+ android:layout_width="12dp"
+ android:layout_marginStart="2dp"
+ android:layout_marginEnd="2dp"
+ android:layout_marginBottom="2dp"
+ android:layout_marginTop="2dp"
+ android:layout_height="12dp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:paddingStart="8dp"
+ android:paddingEnd="12dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/name"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="16sp"
+ android:maxLines="1"
+ android:ellipsize="end"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <TextView
+ android:id="@+id/status"
+ android:textColor="?android:attr/textColorSecondary"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:paddingVertical="3dp"
+ android:textSize="12sp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="3"
+ android:ellipsize="end" />
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/people_space_small_avatar_tile.xml b/packages/SystemUI/res/layout/people_space_small_avatar_tile.xml
new file mode 100644
index 0000000..f474830
--- /dev/null
+++ b/packages/SystemUI/res/layout/people_space_small_avatar_tile.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 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.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <LinearLayout
+ android:background="@drawable/people_space_tile_view_card"
+ android:id="@+id/item"
+ android:orientation="vertical"
+ android:paddingTop="6dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:orientation="horizontal"
+ android:paddingHorizontal="12dp"
+ android:paddingBottom="4dp"
+ android:gravity="top"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ImageView
+ android:id="@+id/person_icon"
+ android:layout_width="34dp"
+ android:layout_height="34dp" />
+
+ <LinearLayout
+ android:background="@drawable/people_space_rounded_border"
+ android:layout_marginStart="-5dp"
+ android:layout_marginTop="18dp"
+ android:layout_width="8dp"
+ android:layout_height="8dp">
+
+ <ImageView
+ android:id="@+id/package_icon"
+ android:layout_width="6dp"
+ android:layout_marginEnd="1dp"
+ android:layout_marginStart="1dp"
+ android:layout_marginBottom="1dp"
+ android:layout_marginTop="1dp"
+ android:layout_height="6dp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:paddingStart="6dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/name"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="14sp"
+ android:maxLines="1"
+ android:ellipsize="end"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <TextView
+ android:id="@+id/time"
+ android:textColor="?android:attr/textColorSecondary"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:textSize="10sp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="1"
+ android:ellipsize="end" />
+ </LinearLayout>
+ </LinearLayout>
+ <TextView
+ android:id="@+id/content"
+ android:paddingVertical="3dp"
+ android:paddingHorizontal="12dp"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:background="@drawable/people_space_content_background"
+ android:textSize="14sp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:maxLines="2"
+ android:ellipsize="end" />
+ </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/people_space_widget_item.xml b/packages/SystemUI/res/layout/people_space_widget_item.xml
index 95de6d6..170386f 100644
--- a/packages/SystemUI/res/layout/people_space_widget_item.xml
+++ b/packages/SystemUI/res/layout/people_space_widget_item.xml
@@ -16,6 +16,7 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
+ android:padding="4dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
@@ -31,24 +32,37 @@
<LinearLayout
android:orientation="horizontal"
android:gravity="center_vertical"
+ android:paddingStart="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/person_icon"
- android:layout_width="42dp"
- android:layout_height="42dp" />
+ android:layout_width="60dp"
+ android:layout_height="60dp" />
- <ImageView
- android:id="@+id/package_icon"
- android:gravity="bottom|end"
- android:layout_width="14dp"
- android:layout_marginStart="-8dp"
- android:layout_height="14dp" />
+ <LinearLayout
+ android:background="@drawable/people_space_rounded_border"
+ android:layout_marginStart="-12dp"
+ android:layout_marginTop="28dp"
+ android:layout_marginBottom="14dp"
+ android:layout_width="16dp"
+ android:layout_height="16dp">
+
+ <ImageView
+ android:id="@+id/package_icon"
+ android:layout_width="12dp"
+ android:layout_marginStart="2dp"
+ android:layout_marginEnd="2dp"
+ android:layout_marginBottom="2dp"
+ android:layout_marginTop="2dp"
+ android:layout_height="12dp" />
+ </LinearLayout>
<LinearLayout
android:orientation="vertical"
- android:paddingStart="4dp"
+ android:paddingStart="8dp"
+ android:paddingEnd="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
diff --git a/packages/SystemUI/res/layout/qs_panel.xml b/packages/SystemUI/res/layout/qs_panel.xml
index 89bf12d..387f2f2 100644
--- a/packages/SystemUI/res/layout/qs_panel.xml
+++ b/packages/SystemUI/res/layout/qs_panel.xml
@@ -25,9 +25,7 @@
<View
android:id="@+id/quick_settings_background"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:elevation="4dp"
- android:background="@drawable/qs_background_primary" />
+ android:layout_height="0dp" />
<com.android.systemui.qs.NonInterceptingScrollView
android:id="@+id/expanded_qs_scroll_view"
diff --git a/packages/SystemUI/res/layout/quick_settings_brightness_dialog_thick.xml b/packages/SystemUI/res/layout/quick_settings_brightness_dialog_thick.xml
index e08b44a..4f4b2af 100644
--- a/packages/SystemUI/res/layout/quick_settings_brightness_dialog_thick.xml
+++ b/packages/SystemUI/res/layout/quick_settings_brightness_dialog_thick.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_gravity="center"
- style="@style/BrightnessDialogContainer">
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:layout_gravity="center"
+ style="@style/BrightnessDialogContainer">
<com.android.systemui.settings.brightness.BrightnessSliderView
android:id="@+id/brightness_slider"
@@ -38,16 +38,5 @@
android:progressDrawable="@drawable/brightness_progress_drawable_thick"
android:splitTrack="false"
/>
-
- <ImageView
- android:id="@+id/image"
- android:layout_width="24dp"
- android:layout_height="24dp"
- android:layout_marginLeft="48dp"
- android:layout_gravity="center_vertical"
- android:src="@drawable/ic_brightness"
- android:tint="?android:attr/textColorTertiary"
- android:visibility="visible"
- />
</com.android.systemui.settings.brightness.BrightnessSliderView>
</FrameLayout>
diff --git a/packages/SystemUI/res/layout/status_bar_expanded_plugin_frame.xml b/packages/SystemUI/res/layout/status_bar_expanded_plugin_frame.xml
index 69beffe..6f9d745 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded_plugin_frame.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded_plugin_frame.xml
@@ -25,5 +25,4 @@
android:layout_marginTop="@dimen/notification_side_paddings"
android:layout_marginLeft="@dimen/notification_side_paddings"
android:layout_marginRight="@dimen/notification_side_paddings"
- android:visibility="gone"
- android:background="@drawable/qs_background_primary"/>
+ android:visibility="gone"/>
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 1fab478..ce47ed8 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Skermkiekie is gestoor"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tik om jou skermkiekie te bekyk"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Kon nie skermkiekie stoor nie"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Toestel moet ontsluit word voordat skermkiekie gestoor kan word"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Probeer weer skermkiekie neem"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Kan weens beperkte bergingspasie nie skermkiekie stoor nie"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Die program of jou organisasie laat nie toe dat skermkiekies geneem word nie"</string>
diff --git a/packages/SystemUI/res/values-af/strings_tv.xml b/packages/SystemUI/res/values-af/strings_tv.xml
index eb63165..2e9400e 100644
--- a/packages/SystemUI/res/values-af/strings_tv.xml
+++ b/packages/SystemUI/res/values-af/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN is gekoppel"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN is ontkoppel"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Kennisgewings"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Geen kennisgewings nie"</string>
</resources>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index 5153904..2573175 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ቅጽበታዊ ገጽ እይታ ተቀምጧል"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"የእርስዎን ቅጽበታዊ ገጽ እይታ ለማየት መታ ያድርጉ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ቅጽበታዊ ገጽ ዕይታን ማስቀመጥ አልተቻለም"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ቅጽበታዊ ገጽ እይታ ከመቀመጡ በፊት መሳሪያ መከፈት አለበት"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ቅጽበታዊ ገጽ ዕይታን እንደገና ማንሳት ይሞክሩ"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"ባለው ውሱን የማከማቻ ቦታ ምክንያት ቅጽበታዊ ገጽ ዕይታን ማስቀመጥ አይችልም"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ቅጽበታዊ ገጽ እይታዎችን ማንሳት በመተግበሪያው ወይም በእርስዎ ድርጅት አይፈቀድም"</string>
diff --git a/packages/SystemUI/res/values-am/strings_tv.xml b/packages/SystemUI/res/values-am/strings_tv.xml
index 3ba5a62..71d887d 100644
--- a/packages/SystemUI/res/values-am/strings_tv.xml
+++ b/packages/SystemUI/res/values-am/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ተያይዟል"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ተቋርቷል"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"በ<xliff:g id="VPN_APP">%1$s</xliff:g> በኩል"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"ማሳወቂያዎች"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ምንም ማሳወቂያዎች የሉም"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index f6a1cf5..f0d0b84 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"تم حفظ لقطة الشاشة."</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"انقر لعرض لقطة الشاشة."</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"تعذّر حفظ لقطة الشاشة"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"يجب أن يتم فتح قفل الجهاز قبل حفظ لقطة الشاشة."</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"جرّب أخذ لقطة الشاشة مرة أخرى"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"يتعذر حفظ لقطة الشاشة لأن مساحة التخزين المتاحة محدودة."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"يحظر التطبيق أو تحظر مؤسستك التقاط لقطات شاشة"</string>
diff --git a/packages/SystemUI/res/values-ar/strings_tv.xml b/packages/SystemUI/res/values-ar/strings_tv.xml
index 15ccb94..7297c89 100644
--- a/packages/SystemUI/res/values-ar/strings_tv.xml
+++ b/packages/SystemUI/res/values-ar/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"الشبكة الافتراضية الخاصة (VPN) متصلة."</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"الشبكة الافتراضية الخاصة (VPN) غير متصلة."</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"عبر <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"الإشعارات"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ما من إشعارات"</string>
</resources>
diff --git a/packages/SystemUI/res/values-as/strings.xml b/packages/SystemUI/res/values-as/strings.xml
index b84f409..366a86f 100644
--- a/packages/SystemUI/res/values-as/strings.xml
+++ b/packages/SystemUI/res/values-as/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"স্ক্ৰীণশ্বট ছেভ কৰা হ’ল"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"আপোনাৰ স্ক্ৰীণশ্বট চাবলৈ টিপক"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"স্ক্ৰীণশ্বট ছেভ কৰিব পৰা নগ\'ল"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"স্ক্ৰীনশ্বট ছেভ কৰিবলৈ ডিভাইচটো আনলক কৰিবই লাগিব"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"স্ক্ৰীণশ্বট আকৌ ল\'বলৈ চেষ্টা কৰক"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"সঞ্চয়াগাৰত সীমিত খালী ঠাই থকাৰ বাবে স্ক্ৰীণশ্বট ছেভ কৰিব পৰা নগ\'ল"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"এপটোৱে বা আপোনাৰ প্ৰতিষ্ঠানে স্ক্ৰীণশ্বট ল\'বলৈ অনুমতি নিদিয়ে"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"সাধাৰণ বার্তাসমূহ"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"সঞ্চয়াগাৰ"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"ইংগিতবোৰ"</string>
- <string name="instant_apps" msgid="8337185853050247304">"তাৎক্ষণিক এপসমূহ"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> চলি আছে"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"ইনষ্ট\'ল নকৰাকৈয়েই এপটো খোলা হৈছে।"</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"ইনষ্ট\'ল নকৰাকৈয়েই এপটো খোলা হৈছে। অধিক জানিবলৈ টিপক।"</string>
diff --git a/packages/SystemUI/res/values-as/strings_tv.xml b/packages/SystemUI/res/values-as/strings_tv.xml
index f7afcfa..859ea2c 100644
--- a/packages/SystemUI/res/values-as/strings_tv.xml
+++ b/packages/SystemUI/res/values-as/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"ভিপিএন সংযোগ হৈ আছে"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"ভিপিএনৰ সংযোগ বিচ্ছিন্ন হৈছে"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>ৰ জৰিয়তে"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"জাননী"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"কোনো জাননী নাই"</string>
</resources>
diff --git a/packages/SystemUI/res/values-az/strings.xml b/packages/SystemUI/res/values-az/strings.xml
index a329288..d201926 100644
--- a/packages/SystemUI/res/values-az/strings.xml
+++ b/packages/SystemUI/res/values-az/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Skrinşot yadda saxlandı"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Skrinşotunuza baxmaq üçün klikləyin"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Skrinşotu yadda saxlamaq alınmadı"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Skrinşotu saxlamazdan əvvəl cihaz kiliddən çıxarılmalıdır"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Skrinşotu yenidən çəkin"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Yaddaş ehtiyatının az olması səbəbindən skrinşotu yadda saxlamaq olmur"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Skrinşot çəkməyə tətbiq və ya təşkilat tərəfindən icazə verilmir"</string>
diff --git a/packages/SystemUI/res/values-az/strings_tv.xml b/packages/SystemUI/res/values-az/strings_tv.xml
index cd9935f..1f1b649 100644
--- a/packages/SystemUI/res/values-az/strings_tv.xml
+++ b/packages/SystemUI/res/values-az/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN qoşulub"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ayrılıb"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> vasitəsilə"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Bildirişlər"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Bildiriş yoxdur"</string>
</resources>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index d800e8d..aa44b36 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Snimak ekrana je sačuvan"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Dodirnite da biste videli snimak ekrana"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Čuvanje snimka ekrana nije uspelo"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Uređaj mora da bude otključan da bi snimak ekrana mogao da se sačuva"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Probajte da ponovo napravite snimak ekrana"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Čuvanje snimka ekrana nije uspelo zbog ograničenog memorijskog prostora"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikacija ili organizacija ne dozvoljavaju pravljenje snimaka ekrana"</string>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml b/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml
index 8122e4d..2eaa499 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN je povezan"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Veza sa VPN-om je prekinuta"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Preko: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Obaveštenja"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nema obaveštenja"</string>
</resources>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index 9fd9a5e..bc28f9b 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Здымак экрана захаваны"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Дакраніцеся, каб прагледзець здымак экрана"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Не атрымалася зрабіць здымак экрана"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Перад захаваннем здымка экрана трэба разблакіраваць прыладу"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Паспрабуйце зрабіць здымак экрана яшчэ раз"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Немагчыма захаваць здымак экрана, бо мала месца ў сховішчы"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Рабіць здымкі экрана не дазваляе праграма ці ваша арганізацыя"</string>
diff --git a/packages/SystemUI/res/values-be/strings_tv.xml b/packages/SystemUI/res/values-be/strings_tv.xml
index 1016b8c..21a2e6e 100644
--- a/packages/SystemUI/res/values-be/strings_tv.xml
+++ b/packages/SystemUI/res/values-be/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN падключаны"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN адключаны"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Праз <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Апавяшчэнні"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Апавяшчэнняў няма"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 78a826b..faa7e56 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Екранната снимка е запазена"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Докоснете, за да видите екранната снимка"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Не можа да се запази екранна снимка"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"За да бъде запазена екранната снимка, устройството трябва да бъде отключено"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Опитайте да направите екранна снимка отново"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Екранната снимка не може да се запази поради ограничено място в хранилището"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Правенето на екранни снимки не е разрешено от приложението или организацията ви"</string>
diff --git a/packages/SystemUI/res/values-bg/strings_tv.xml b/packages/SystemUI/res/values-bg/strings_tv.xml
index 6f6b824..b7af7cb 100644
--- a/packages/SystemUI/res/values-bg/strings_tv.xml
+++ b/packages/SystemUI/res/values-bg/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN е свързана"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Връзката с VPN е прекратена"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Чрез <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Известия"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Няма известия"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index 92e0c1d..04fd1ca 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"স্ক্রিনশট সেভ করা হয়েছে"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"স্ক্রিনশটটি দেখতে ট্যাপ করুন"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"স্ক্রিনশট সেভ করা যায়নি"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"স্ক্রিনশট সেভ করার আগে ডিভাইসটি অবশ্যই আনলক করতে হবে"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"আবার স্ক্রিনশট নেওয়ার চেষ্টা করুন"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"বেশি জায়গা নেই তাই স্ক্রিনশটটি সেভ করা যাবে না৷"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"এই অ্যাপ বা আপনার প্রতিষ্ঠান স্ক্রিনশট নেওয়ার অনুমতি দেয়নি"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"সাধারণ বার্তাগুলি"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"স্টোরেজ"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"হিন্ট"</string>
- <string name="instant_apps" msgid="8337185853050247304">"ইনস্ট্যান্ট অ্যাপ"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> চলছে"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"অ্যাপটি ইনস্টল না করে চালু করা হয়েছে।"</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"অ্যাপটি ইনস্টল না করে চালু করা হয়েছে। আরও জানতে ট্যাপ করুন।"</string>
diff --git a/packages/SystemUI/res/values-bn/strings_tv.xml b/packages/SystemUI/res/values-bn/strings_tv.xml
index 1c26840..38c24ac 100644
--- a/packages/SystemUI/res/values-bn/strings_tv.xml
+++ b/packages/SystemUI/res/values-bn/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN কানেক্ট করা হয়েছে"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ডিসকানেক্ট করা হয়েছে"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-এর মাধ্যমে"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"বিজ্ঞপ্তি"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"কোনও বিজ্ঞপ্তি নেই"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bs/strings.xml b/packages/SystemUI/res/values-bs/strings.xml
index 1179a92..e2a623c 100644
--- a/packages/SystemUI/res/values-bs/strings.xml
+++ b/packages/SystemUI/res/values-bs/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Snimak ekrana je sačuvan"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Dodirnite za prikaz snimka ekrana"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Nije moguće sačuvati snimak ekrana"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Morate otključati uređaj da možete sačuvati snimak ekrana"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Pokušajte ponovo snimiti ekran"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Snimak ekrana se ne može sačuvati zbog manjka prostora za pohranu"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Ova aplikacija ili vaša organizacija ne dozvoljavaju snimanje ekrana"</string>
diff --git a/packages/SystemUI/res/values-bs/strings_tv.xml b/packages/SystemUI/res/values-bs/strings_tv.xml
index 7507746..01916a1 100644
--- a/packages/SystemUI/res/values-bs/strings_tv.xml
+++ b/packages/SystemUI/res/values-bs/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN je povezan"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Veza s VPN-om je prekinuta"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Putem: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Obavještenja"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nema obavještenja"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index ca63162..1fa0c9a 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"S\'ha desat la captura de pantalla"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Toca per veure la captura de pantalla"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"No s\'ha pogut desar la captura de pantalla"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"El dispositiu ha d\'estar desbloquejat abans que la captura de pantalla es pugui desar"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Prova de tornar a fer una captura de pantalla"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"La captura de pantalla no es pot desar perquè no hi ha prou espai d\'emmagatzematge"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"L\'aplicació o la teva organització no permeten fer captures de pantalla"</string>
diff --git a/packages/SystemUI/res/values-ca/strings_tv.xml b/packages/SystemUI/res/values-ca/strings_tv.xml
index 14bc947..a060785 100644
--- a/packages/SystemUI/res/values-ca/strings_tv.xml
+++ b/packages/SystemUI/res/values-ca/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"La VPN està connectada"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"La VPN està desconnectada"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Mitjançant <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificacions"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Cap notificació"</string>
</resources>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index aa6459e..e414fd0 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Snímek obrazovky byl uložen"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Klepnutím snímek obrazovky zobrazíte"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Snímek obrazovky se nepodařilo uložit"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Aby bylo možné uložit screenshot, zařízení musí být odemknuto"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Zkuste snímek pořídit znovu"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Snímek obrazovky kvůli nedostatku místa v úložišti nelze uložit"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikace nebo organizace zakazuje pořizování snímků obrazovky"</string>
diff --git a/packages/SystemUI/res/values-cs/strings_tv.xml b/packages/SystemUI/res/values-cs/strings_tv.xml
index ad869b1..0a9850c 100644
--- a/packages/SystemUI/res/values-cs/strings_tv.xml
+++ b/packages/SystemUI/res/values-cs/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Síť VPN je připojena"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Síť VPN je odpojena"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Prostřednictvím aplikace <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Oznámení"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Žádná oznámení"</string>
</resources>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index d20fc0c..4be2c26 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshottet blev gemt"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tryk for at se dit screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Screenshottet kunne ikke gemmes"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Enheden skal være låst op, før du kan gemme screenshots"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Prøv at tage et screenshot igen"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Screenshottet kan ikke gemmes, fordi der er begrænset lagerplads"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Appen eller din organisation tillader ikke, at du tager screenshots"</string>
diff --git a/packages/SystemUI/res/values-da/strings_tv.xml b/packages/SystemUI/res/values-da/strings_tv.xml
index 84926e0c..fb0bc2d 100644
--- a/packages/SystemUI/res/values-da/strings_tv.xml
+++ b/packages/SystemUI/res/values-da/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN er tilsluttet"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN er afbrudt"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifikationer"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ingen notifikationer"</string>
</resources>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index dcd6a53..0386240 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot gespeichert"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tippe, um deinen Screenshot anzusehen"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Screenshot konnte nicht gespeichert werden"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Damit Screenshots gespeichert werden können, muss das Gerät entsperrt sein"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Versuche noch einmal, den Screenshot zu erstellen"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Speichern des Screenshots aufgrund von zu wenig Speicher nicht möglich"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Die App oder deine Organisation lässt das Erstellen von Screenshots nicht zu"</string>
diff --git a/packages/SystemUI/res/values-de/strings_tv.xml b/packages/SystemUI/res/values-de/strings_tv.xml
index 34fc6aa..0345c80 100644
--- a/packages/SystemUI/res/values-de/strings_tv.xml
+++ b/packages/SystemUI/res/values-de/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ist verbunden"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ist nicht verbunden"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Über <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Benachrichtigungen"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Keine Benachrichtigungen"</string>
</resources>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 197cd17..2985064 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Το στιγμιότυπο οθόνης αποθηκεύτηκε"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Πατήστε για να δείτε το στιγμιότυπο οθόνης που δημιουργήσατε"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Μη δυνατή αποθήκευση του στιγμιότυπου οθόνης"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Η συσκευή πρέπει να ξεκλειδωθεί για να αποθηκευτεί το στιγμιότυπο οθόνης."</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Δοκιμάστε να κάνετε ξανά λήψη του στιγμιότυπου οθόνης"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Αδύνατη η αποθήκευση του στιγμιότυπου οθόνης λόγω περιορισμένου αποθηκευτικού χώρου"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Η λήψη στιγμιότυπων οθόνης δεν επιτρέπεται από την εφαρμογή ή τον οργανισμό σας"</string>
diff --git a/packages/SystemUI/res/values-el/strings_tv.xml b/packages/SystemUI/res/values-el/strings_tv.xml
index 21badf7..cd92772 100644
--- a/packages/SystemUI/res/values-el/strings_tv.xml
+++ b/packages/SystemUI/res/values-el/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Το VPN συνδέθηκε"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Το VPN αποσυνδέθηκε"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Μέσω <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Ειδοποιήσεις"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Δεν υπάρχουν ειδοποιήσεις."</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rAU/strings.xml b/packages/SystemUI/res/values-en-rAU/strings.xml
index 85d6276..fbc0396 100644
--- a/packages/SystemUI/res/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot saved"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tap to view your screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Couldn\'t save screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Device must be unlocked before screenshot can be saved"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Try taking screenshot again"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Can\'t save screenshot due to limited storage space"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
diff --git a/packages/SystemUI/res/values-en-rAU/strings_tv.xml b/packages/SystemUI/res/values-en-rAU/strings_tv.xml
index ab370b1..3b3e2d6 100644
--- a/packages/SystemUI/res/values-en-rAU/strings_tv.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN is connected"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN is disconnected"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"No notifications"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index 5db104c..a8eed15 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot saved"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tap to view your screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Couldn\'t save screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Device must be unlocked before screenshot can be saved"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Try taking screenshot again"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Can\'t save screenshot due to limited storage space"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
diff --git a/packages/SystemUI/res/values-en-rCA/strings_tv.xml b/packages/SystemUI/res/values-en-rCA/strings_tv.xml
index ab370b1..3b3e2d6 100644
--- a/packages/SystemUI/res/values-en-rCA/strings_tv.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN is connected"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN is disconnected"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"No notifications"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 85d6276..fbc0396 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot saved"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tap to view your screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Couldn\'t save screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Device must be unlocked before screenshot can be saved"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Try taking screenshot again"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Can\'t save screenshot due to limited storage space"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
diff --git a/packages/SystemUI/res/values-en-rGB/strings_tv.xml b/packages/SystemUI/res/values-en-rGB/strings_tv.xml
index ab370b1..3b3e2d6 100644
--- a/packages/SystemUI/res/values-en-rGB/strings_tv.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN is connected"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN is disconnected"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"No notifications"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index 85d6276..fbc0396 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot saved"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tap to view your screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Couldn\'t save screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Device must be unlocked before screenshot can be saved"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Try taking screenshot again"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Can\'t save screenshot due to limited storage space"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organisation"</string>
diff --git a/packages/SystemUI/res/values-en-rIN/strings_tv.xml b/packages/SystemUI/res/values-en-rIN/strings_tv.xml
index ab370b1..3b3e2d6 100644
--- a/packages/SystemUI/res/values-en-rIN/strings_tv.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN is connected"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN is disconnected"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"No notifications"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index 3719aa7..47bda8b 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot saved"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tap to view your screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Couldn\'t save screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Device must be unlocked before screenshot can be saved"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Try taking screenshot again"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Can\'t save screenshot due to limited storage space"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Taking screenshots isn\'t allowed by the app or your organization"</string>
diff --git a/packages/SystemUI/res/values-en-rXC/strings_tv.xml b/packages/SystemUI/res/values-en-rXC/strings_tv.xml
index 9fb2610..34882b3 100644
--- a/packages/SystemUI/res/values-en-rXC/strings_tv.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN is connected"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN is disconnected"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"No Notifications"</string>
</resources>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index bd64950..ab23eb6 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Se guardó la captura de pantalla"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Presiona para ver la captura de pantalla"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"No se pudo guardar la captura de pantalla"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"El dispositivo debe estar desbloqueado para poder guardar la captura de pantalla"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Vuelve a hacer una captura de pantalla"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"No se puede guardar la captura de pantalla debido a que no hay suficiente espacio de almacenamiento"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"La app o tu organización no permiten las capturas de pantalla"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings_tv.xml b/packages/SystemUI/res/values-es-rUS/strings_tv.xml
index 7aa9927..a0a355b 100644
--- a/packages/SystemUI/res/values-es-rUS/strings_tv.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"La VPN está conectada."</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"La VPN está desconectada"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"A través de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificaciones"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"No hay notificaciones"</string>
</resources>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 2ce2718..e589ce6 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Se ha guardado la captura de pantalla"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Toca para ver la captura de pantalla"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"No se ha podido guardar la captura de pantalla"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"El dispositivo debe desbloquearse para que se pueda guardar la captura de pantalla"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Vuelve a intentar hacer la captura de pantalla"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"No se puede guardar la captura de pantalla porque no hay espacio de almacenamiento suficiente"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"La aplicación o tu organización no permiten realizar capturas de pantalla"</string>
diff --git a/packages/SystemUI/res/values-es/strings_tv.xml b/packages/SystemUI/res/values-es/strings_tv.xml
index f3bab28..4607ad5 100644
--- a/packages/SystemUI/res/values-es/strings_tv.xml
+++ b/packages/SystemUI/res/values-es/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"La VPN está conectada"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"La VPN está desconectada"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"A través de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificaciones"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Sin notificaciones"</string>
</resources>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index c11f21c..cce8d83 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Ekraanipilt salvestati"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Puudutage ekraanipildi vaatamiseks"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Ekraanipilti ei õnnestunud salvestada"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Enne ekraanipildi salvestamist tuleb seade avada"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Proovige ekraanipilt uuesti jäädvustada"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Piiratud salvestusruumi tõttu ei saa ekraanipilti salvestada"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Rakendus või teie organisatsioon ei luba ekraanipilte jäädvustada"</string>
diff --git a/packages/SystemUI/res/values-et/strings_tv.xml b/packages/SystemUI/res/values-et/strings_tv.xml
index c59b5bc..b7039e3 100644
--- a/packages/SystemUI/res/values-et/strings_tv.xml
+++ b/packages/SystemUI/res/values-et/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN on ühendatud"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN-i ühendus on katkestatud"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"VPN-i <xliff:g id="VPN_APP">%1$s</xliff:g> kaudu"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Märguanded"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Märguandeid pole"</string>
</resources>
diff --git a/packages/SystemUI/res/values-eu/strings.xml b/packages/SystemUI/res/values-eu/strings.xml
index 835449f..ad64da2 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Gorde da pantaila-argazkia"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Sakatu pantaila-argazkia ikusteko"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Ezin izan da gorde pantaila-argazkia"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Pantaila-argazkia gordetzeko, gailuak desblokeatuta egon beharko du"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Saiatu berriro pantaila-argazkia ateratzen"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Ezin da gorde pantaila-argazkia ez delako gelditzen tokirik"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikazioak edo erakundeak ez du onartzen pantaila-argazkiak ateratzea"</string>
diff --git a/packages/SystemUI/res/values-eu/strings_tv.xml b/packages/SystemUI/res/values-eu/strings_tv.xml
index 67cb078..e1c4fcc 100644
--- a/packages/SystemUI/res/values-eu/strings_tv.xml
+++ b/packages/SystemUI/res/values-eu/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN sarera konektatuta dago"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ez dago sarera konektatuta"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> bidez"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Jakinarazpenak"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ez dago jakinarazpenik"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 55ca0f3..f5f9580 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"نماگرفت ذخیره شد"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"برای مشاهده عکس صفحهنمایشتان ضربه بزنید"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"نماگرفت ذخیره نشد"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"برای ذخیره کردن نماگرفت، قفل دستگاه باید باز باشد"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"دوباره نماگرفت بگیرید"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"به دلیل محدود بودن فضای ذخیرهسازی نمیتوان نماگرفت را ذخیره کرد"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"برنامه یا سازمان شما اجازه نمیدهند نماگرفت بگیرید."</string>
diff --git a/packages/SystemUI/res/values-fa/strings_tv.xml b/packages/SystemUI/res/values-fa/strings_tv.xml
index 37aaa64..5ad12df 100644
--- a/packages/SystemUI/res/values-fa/strings_tv.xml
+++ b/packages/SystemUI/res/values-fa/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN متصل است"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN قطع است"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"ازطریق <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"اعلانها"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"اعلانی ندارید"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index f5441a2..65db4ce 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Kuvakaappaus tallennettu"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Napauta katsoaksesi kuvakaappausta"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Kuvakaappauksen tallennus epäonnistui"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Laitteen lukitus täytyy avata ennen kuin kuvakaappaus voidaan tallentaa"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Yritä ottaa kuvakaappaus uudelleen."</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Kuvakaappauksen tallennus epäonnistui, sillä tallennustilaa ei ole riittävästi"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Sovellus tai organisaatio ei salli kuvakaappauksien tallentamista."</string>
diff --git a/packages/SystemUI/res/values-fi/strings_tv.xml b/packages/SystemUI/res/values-fi/strings_tv.xml
index 295780b..61cd5ab 100644
--- a/packages/SystemUI/res/values-fi/strings_tv.xml
+++ b/packages/SystemUI/res/values-fi/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN on yhdistetty"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ei ole yhdistettynä"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Palvelun <xliff:g id="VPN_APP">%1$s</xliff:g> kautta"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Ilmoitukset"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ei ilmoituksia"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 6b598da..0e8e315 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Capture d\'écran enregistrée"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Touchez pour afficher votre capture d\'écran"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Impossible d\'enregistrer la capture d\'écran"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"L\'appareil doit être déverrouillé avant qu\'une capture d\'écran puisse être enregistrée"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Essayez de faire une autre capture d\'écran"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Impossible d\'enregistrer la capture d\'écran, car l\'espace de stockage est limité"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"L\'application ou votre organisation n\'autorise pas les saisies d\'écran"</string>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings_tv.xml b/packages/SystemUI/res/values-fr-rCA/strings_tv.xml
index 696e959..a667d76 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings_tv.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"RPV connecté"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"RPV déconnecté"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Par <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Aucune notification"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index b9fa28c..28b9bbe 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Capture d\'écran enregistrée"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Appuyez pour voir la capture d\'écran"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Impossible d\'enregistrer la capture d\'écran"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Vous devez déverrouiller l\'appareil pour que la capture d\'écran soit enregistrée"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Essayez de nouveau de faire une capture d\'écran"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Impossible d\'enregistrer la capture d\'écran, car l\'espace de stockage est limité"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Les captures d\'écran ne sont pas autorisées par l\'application ni par votre organisation"</string>
diff --git a/packages/SystemUI/res/values-fr/strings_tv.xml b/packages/SystemUI/res/values-fr/strings_tv.xml
index f2c5d97..25fab4e 100644
--- a/packages/SystemUI/res/values-fr/strings_tv.xml
+++ b/packages/SystemUI/res/values-fr/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN connecté"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN déconnecté"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Aucune notification"</string>
</resources>
diff --git a/packages/SystemUI/res/values-gl/strings.xml b/packages/SystemUI/res/values-gl/strings.xml
index 6cf18b8..808048b 100644
--- a/packages/SystemUI/res/values-gl/strings.xml
+++ b/packages/SystemUI/res/values-gl/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Gardouse a captura de pantalla"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Toca para ver a captura de pantalla"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Non se puido gardar a captura de pantalla"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Para que se poida gardar a captura de pantalla, o dispositivo debe estar desbloqueado"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Volve tentar crear unha captura de pantalla"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Non se puido gardar a captura de pantalla porque o espazo de almacenamento é limitado"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"A aplicación ou a túa organización non permite realizar capturas de pantalla"</string>
diff --git a/packages/SystemUI/res/values-gl/strings_tv.xml b/packages/SystemUI/res/values-gl/strings_tv.xml
index 095386b..cd12b94 100644
--- a/packages/SystemUI/res/values-gl/strings_tv.xml
+++ b/packages/SystemUI/res/values-gl/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"A VPN está conectada"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"A VPN está desconectada"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"A través de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificacións"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Non hai notificacións"</string>
</resources>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index 35d4e1a..1ba649a 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"સ્ક્રીનશૉટ સાચવ્યો"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"તમારા સ્ક્રીનશૉટને જોવા માટે ટૅપ કરો"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"સ્ક્રીનશૉટ સાચવી શક્યાં નથી"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"સ્ક્રીનશૉટ સાચવવામાં આવે તે પહેલાં ડિવાઇસને અનલૉક કરવું જરૂરી છે"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ફરીથી સ્ક્રીનશૉટ લેવાનો પ્રયાસ કરો"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"મર્યાદિત સ્ટોરેજ સ્પેસને કારણે સ્ક્રીનશૉટ સાચવી શકાતો નથી"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ઍપ્લિકેશન કે તમારી સંસ્થા દ્વારા સ્ક્રીનશૉટ લેવાની મંજૂરી નથી"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"સામાન્ય સંદેશા"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"સ્ટોરેજ"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"હિન્ટ"</string>
- <string name="instant_apps" msgid="8337185853050247304">"ઝટપટ ઍપ્લિકેશન"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> ચાલી રહી છે"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"ઍપ ઇન્સ્ટૉલ કર્યા વિના ખુલી જાય છે."</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"ઍપ ઇન્સ્ટૉલ કર્યા વિના ખુલી જાય છે. વધુ જાણવા માટે ટૅપ કરો."</string>
diff --git a/packages/SystemUI/res/values-gu/strings_tv.xml b/packages/SystemUI/res/values-gu/strings_tv.xml
index 297b6e1a..a53e983 100644
--- a/packages/SystemUI/res/values-gu/strings_tv.xml
+++ b/packages/SystemUI/res/values-gu/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN કનેક્ટ કરેલું છે"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ડિસ્કનેક્ટ કરેલું છે"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> મારફતે"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"નોટિફિકેશન"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"કોઈ નોટિફિકેશન નથી"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 1d02fd0..330ff90 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"स्क्रीनशॉट सेव किया गया"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"अपना स्क्रीनशॉट देखने के लिए टैप करें"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"स्क्रीनशॉट सेव नहीं किया जा सका"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"स्क्रीनशॉट सेव करने के लिए डिवाइस का अनलॉक होना ज़रूरी है"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"स्क्रीनशॉट दोबारा लेने की कोशिश करें"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"मेमोरी कम होने की वजह से स्क्रीनशॉट सेव नहीं किया जा सका"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ऐप्लिकेशन या आपका संगठन स्क्रीनशॉट लेने की अनुमति नहीं देता"</string>
@@ -937,7 +938,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"सामान्य संदेश"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"जगह"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"संकेत"</string>
- <string name="instant_apps" msgid="8337185853050247304">"झटपट ऐप्लिकेशन"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> चल रहा है"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"ऐप्लिकेशन इंस्टॉल किए बिना ही खुल गया है."</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"ऐप्लिकेशन इंस्टॉल किए बिना ही खुल गया है. ज़्यादा जानने के लिए टैप करें."</string>
diff --git a/packages/SystemUI/res/values-hi/strings_tv.xml b/packages/SystemUI/res/values-hi/strings_tv.xml
index d2ce7a9..fedaae3 100644
--- a/packages/SystemUI/res/values-hi/strings_tv.xml
+++ b/packages/SystemUI/res/values-hi/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"वीपीएन कनेक्ट हो गया है"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"वीपीएन डिसकनेक्ट हो गया है"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> के ज़रिए"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"सूचनाएं"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"कोई सूचना नहीं है"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 9c4939c..6879259 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Snimka zaslona spremljena"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Dodirnite da biste vidjeli snimku zaslona"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Snimka zaslona nije spremljena"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Uređaj mora biti otključan da bi se snimka zaslona mogla spremiti"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Pokušajte ponovo napraviti snimku zaslona"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Zaslon nije snimljen zbog ograničenog prostora za pohranu"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikacija ili vaša organizacija ne dopuštaju snimanje zaslona"</string>
diff --git a/packages/SystemUI/res/values-hr/strings_tv.xml b/packages/SystemUI/res/values-hr/strings_tv.xml
index ee29a6c..3bfdf70 100644
--- a/packages/SystemUI/res/values-hr/strings_tv.xml
+++ b/packages/SystemUI/res/values-hr/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN je spojen"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN je isključen"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Putem mreže <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Obavijesti"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nema obavijesti"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 2feb1b2..90f42cb 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"A képernyőkép mentése sikerült"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Koppintson a képernyőkép megtekintéséhez"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Nem sikerült a képernyőkép mentése"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Az eszközt fel kell oldani a képernyőkép mentése előtt"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Próbálja meg újra elkészíteni a képernyőképet"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Nem menthet képernyőképet, mert kevés a tárhely"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Az alkalmazás vagy az Ön szervezete nem engedélyezi képernyőkép készítését"</string>
diff --git a/packages/SystemUI/res/values-hu/strings_tv.xml b/packages/SystemUI/res/values-hu/strings_tv.xml
index cbbebb0..78d6099 100644
--- a/packages/SystemUI/res/values-hu/strings_tv.xml
+++ b/packages/SystemUI/res/values-hu/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"A VPN-kapcsolat létrejött"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"A VPN-kapcsolat megszakadt"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"A következő szolgáltatás használatával: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Értesítések"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nincs értesítés"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index 0258e44..aaa2794 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Սքրինշոթը պահվեց"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Հպեք՝ սքրինշոթը տեսնելու համար"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Չհաջողվեց պահել սքրինշոթը"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Սքրինշոթը պահելու համար ապակողպեք սարքը։"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Փորձեք նորից"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Չհաջողվեց պահել սքրինշոթը անբավարար հիշողության պատճառով"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Հավելվածը կամ ձեր կազմակերպությունը չի թույլատրում սքրինշոթի ստացումը"</string>
diff --git a/packages/SystemUI/res/values-hy/strings_tv.xml b/packages/SystemUI/res/values-hy/strings_tv.xml
index 58c5149..cf4eb90 100644
--- a/packages/SystemUI/res/values-hy/strings_tv.xml
+++ b/packages/SystemUI/res/values-hy/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN-ը միացված է"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN-ն անջատված է"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-ի միջոցով"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Ծանուցումներ"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ծանուցումներ չկան"</string>
</resources>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index bea37ae..ff5d4ed 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot disimpan"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Ketuk untuk melihat screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Tidak dapat menyimpan screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Perangkat harus dibuka kuncinya agar screenshot dapat disimpan"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Coba ambil screenshot lagi"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Tidak dapat menyimpan screenshot karena ruang penyimpanan terbatas"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Mengambil screenshot tidak diizinkan oleh aplikasi atau organisasi"</string>
diff --git a/packages/SystemUI/res/values-in/strings_tv.xml b/packages/SystemUI/res/values-in/strings_tv.xml
index bdd6742..3b446ad 100644
--- a/packages/SystemUI/res/values-in/strings_tv.xml
+++ b/packages/SystemUI/res/values-in/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN tersambung"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN terputus"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Melalui <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifikasi"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Tidak Ada Notifikasi"</string>
</resources>
diff --git a/packages/SystemUI/res/values-is/strings.xml b/packages/SystemUI/res/values-is/strings.xml
index 7c7902f..20231b4 100644
--- a/packages/SystemUI/res/values-is/strings.xml
+++ b/packages/SystemUI/res/values-is/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Skjámynd vistuð"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Ýttu til skoða skjámyndina"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Ekki var hægt að vista skjámynd"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Taka verður tækið úr lás áður en hægt er að vista skjámynd"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Prófaðu að taka skjámynd aftur"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Ekki tókst að vista skjámynd vegna takmarkaðs geymslupláss"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Forritið eða fyrirtækið þitt leyfir ekki skjámyndatöku"</string>
diff --git a/packages/SystemUI/res/values-is/strings_tv.xml b/packages/SystemUI/res/values-is/strings_tv.xml
index 88a4315..7c23e62 100644
--- a/packages/SystemUI/res/values-is/strings_tv.xml
+++ b/packages/SystemUI/res/values-is/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN er tengt"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN er ekki tengt"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Í gegnum <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Tilkynningar"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Engar tilkynningar"</string>
</resources>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 026b5a9..a7952ba 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot salvato"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tocca per visualizzare lo screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Impossibile salvare lo screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"È necessario sbloccare il dispositivo per poter salvare lo screenshot"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Riprova ad acquisire lo screenshot"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Impossibile salvare lo screenshot a causa dello spazio di archiviazione limitato"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"L\'acquisizione di screenshot non è consentita dall\'app o dall\'organizzazione"</string>
diff --git a/packages/SystemUI/res/values-it/strings_tv.xml b/packages/SystemUI/res/values-it/strings_tv.xml
index 97badc1..57931b0 100644
--- a/packages/SystemUI/res/values-it/strings_tv.xml
+++ b/packages/SystemUI/res/values-it/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN connessa"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN disconnessa"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Tramite <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifiche"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nessuna notifica"</string>
</resources>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index b4df62b..cd07d77 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"צילום המסך נשמר"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"אפשר להקיש כדי להציג את צילום המסך"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"לא ניתן היה לשמור צילום מסך"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"כדי שצילום המסך יישמר, צריך לבטל את הנעילה של המכשיר"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"יש לנסות שוב לבצע צילום מסך"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"לא היה מספיק מקום לשמור את צילום המסך"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"האפליקציה או הארגון שלך אינם מתירים ליצור צילומי מסך"</string>
diff --git a/packages/SystemUI/res/values-iw/strings_tv.xml b/packages/SystemUI/res/values-iw/strings_tv.xml
index 45d744a..7483116 100644
--- a/packages/SystemUI/res/values-iw/strings_tv.xml
+++ b/packages/SystemUI/res/values-iw/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN מחובר"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN מנותק"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"באמצעות <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"התראות"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"אין התראות"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index be6f491..1b30a92 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"スクリーンショットを保存しました"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"タップしてスクリーンショットを表示します"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"スクリーンショット保存エラー"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"スクリーンショットを保存するには、デバイスのロックを解除する必要があります"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"スクリーンショットを撮り直してください"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"空き容量が足りないため、スクリーンショットを保存できません"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"スクリーンショットの作成はアプリまたは組織で許可されていません"</string>
diff --git a/packages/SystemUI/res/values-ja/strings_tv.xml b/packages/SystemUI/res/values-ja/strings_tv.xml
index 9d7a36a..7f676b5 100644
--- a/packages/SystemUI/res/values-ja/strings_tv.xml
+++ b/packages/SystemUI/res/values-ja/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN に接続しました"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN に接続していません"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> 経由"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"通知はありません"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ka/strings.xml b/packages/SystemUI/res/values-ka/strings.xml
index 6fdb8b8..f128dde 100644
--- a/packages/SystemUI/res/values-ka/strings.xml
+++ b/packages/SystemUI/res/values-ka/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ეკრანის ანაბეჭდი შენახულია"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"შეეხეთ ეკრანის ანაბეჭდის სანახავად"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ეკრანის ანაბეჭდის შენახვა ვერ მოხერხდა"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"მოწყობილობა უნდა განიბლოკოს ეკრანის ანაბეჭდის შენახვა რომ შეძლოთ"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ხელახლა ცადეთ ეკრანის ანაბეჭდის გაკეთება"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"ეკრანის ანაბეჭდის შენახვა ვერ მოხერხდა შეზღუდული მეხსიერების გამო"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ეკრანის ანაბეჭდების შექმნა არ არის ნებადართული აპის ან თქვენი ორგანიზაციის მიერ"</string>
diff --git a/packages/SystemUI/res/values-ka/strings_tv.xml b/packages/SystemUI/res/values-ka/strings_tv.xml
index 0dc1e10..0819781 100644
--- a/packages/SystemUI/res/values-ka/strings_tv.xml
+++ b/packages/SystemUI/res/values-ka/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN დაკავშირებულია"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN გათიშულია"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-ის მიერ"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"შეტყობინებები"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"შეტყობინებები არ არის"</string>
</resources>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index df86e8a..b9c54cc 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Скриншот сақталды"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Скриншотты көру үшін түртіңіз"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Скриншот сақталмады"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Скриншот сақталуы үшін, құрылғы құлпын ашу керек."</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Қайта скриншот жасап көріңіз"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Жадтағы шектеулі бос орынға байланысты скриншот сақталмайды"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Қолданба немесе ұйым скриншоттар түсіруге рұқсат етпейді"</string>
diff --git a/packages/SystemUI/res/values-kk/strings_tv.xml b/packages/SystemUI/res/values-kk/strings_tv.xml
index cc15978..768e3ac 100644
--- a/packages/SystemUI/res/values-kk/strings_tv.xml
+++ b/packages/SystemUI/res/values-kk/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN қосылған"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ажыратылған"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> арқылы жалғанған"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Хабарландырулар"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Хабарландырулар жоқ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index e559c19..d293c0d 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"បានរក្សាទុករូបថតអេក្រង់"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ចុចដើម្បីមើលរូបថតអេក្រង់របស់អ្នក"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"មិនអាចរក្សាទុករូបថតអេក្រង់បានទេ"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ត្រូវតែដោះសោឧបករណ៍ជាមុនសិន ទើបអាចរក្សាទុករូបថតអេក្រង់បាន"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"សាកល្បងថតរូបថតអេក្រង់ម្តងទៀត"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"មិនអាចរក្សាទុករូបថតអេក្រង់បានទេ ដោយសារទំហំផ្ទុកមានកម្រិតទាប"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ការថតរូបអេក្រង់មិនត្រូវបានអនុញ្ញាតដោយកម្មវិធីនេះ ឬស្ថាប័នរបស់អ្នក"</string>
diff --git a/packages/SystemUI/res/values-km/strings_tv.xml b/packages/SystemUI/res/values-km/strings_tv.xml
index f415a66..0dec2d6 100644
--- a/packages/SystemUI/res/values-km/strings_tv.xml
+++ b/packages/SystemUI/res/values-km/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ត្រូវបានភ្ជាប់"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ត្រូវបានផ្ដាច់"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"តាមរយៈ <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"ការជូនដំណឹង"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"គ្មានការជូនដំណឹងទេ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index f121080..a906a39 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಅನ್ನು ಉಳಿಸಲಾಗಿದೆ"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ನಿಮ್ಮ ಸ್ಕ್ರೀನ್ಶಾಟ್ ವೀಕ್ಷಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಅನ್ನು ಉಳಿಸಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಉಳಿಸುವ ಮೊದಲು ಸಾಧನವನ್ನು ಅನ್ಲಾಕ್ ಮಾಡಬೇಕು"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ಸ್ಕ್ರೀನ್ಶಾಟ್ ಅನ್ನು ಪುನಃ ತೆಗೆದುಕೊಳ್ಳಲು ಪ್ರಯತ್ನಿಸಿ"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"ಪರಿಮಿತ ಸಂಗ್ರಹಣೆ ಸ್ಥಳದ ಕಾರಣದಿಂದಾಗಿ ಸ್ಕ್ರೀನ್ಶಾಟ್ ಉಳಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ಅಪ್ಲಿಕೇಶನ್ ಅಥವಾ ಸಂಸ್ಥೆಯು ಸ್ಕ್ರೀನ್ಶಾಟ್ಗಳನ್ನು ತೆಗೆಯುವುದನ್ನು ಅನುಮತಿಸುವುದಿಲ್ಲ"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"ಸಾಮಾನ್ಯ ಸಂದೇಶಗಳು"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"ಸಂಗ್ರಹಣೆ"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"ಸುಳಿವುಗಳು"</string>
- <string name="instant_apps" msgid="8337185853050247304">"ಇನ್ಸ್ಟಂಟ್ ಆ್ಯಪ್ಗಳು"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> ರನ್ ಆಗುತ್ತಿದೆ"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"ಇನ್ಸ್ಟಾಲ್ ಮಾಡದೆ ಆ್ಯಪ್ ತೆರೆಯಲಾಗಿದೆ."</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"ಇನ್ಸ್ಟಾಲ್ ಮಾಡದೆ ಆ್ಯಪ್ ತೆರೆಯಲಾಗಿದೆ. ಇನ್ನಷ್ಟು ತಿಳಿಯಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
diff --git a/packages/SystemUI/res/values-kn/strings_tv.xml b/packages/SystemUI/res/values-kn/strings_tv.xml
index a935963..ef10e3a 100644
--- a/packages/SystemUI/res/values-kn/strings_tv.xml
+++ b/packages/SystemUI/res/values-kn/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ಕನೆಕ್ಟ್ ಮಾಡಲಾಗಿದೆ"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ಕನೆಕ್ಷನ್ ಕಡಿತಗೊಂಡಿದೆ"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ಮೂಲಕ"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"ಅಧಿಸೂಚನೆಗಳು"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ಯಾವುದೇ ಅಧಿಸೂಚನೆಗಳಿಲ್ಲ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 6db40c1..adedb88 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"스크린샷 저장됨"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"스크린샷을 확인하려면 탭하세요"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"스크린샷을 저장할 수 없음"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"스크린샷을 저장하려면 기기를 잠금 해제해야 합니다."</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"스크린샷을 다시 찍어 보세요."</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"저장용량이 부족하여 스크린샷을 저장할 수 없습니다"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"앱이나 조직에서 스크린샷 촬영을 허용하지 않습니다."</string>
diff --git a/packages/SystemUI/res/values-ko/strings_tv.xml b/packages/SystemUI/res/values-ko/strings_tv.xml
index 8c3a8ea..f9c723a 100644
--- a/packages/SystemUI/res/values-ko/strings_tv.xml
+++ b/packages/SystemUI/res/values-ko/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN에 연결됨"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN 연결이 해제됨"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>에 연결됨"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"알림"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"알림 없음"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 8a06ed6..92b98fb 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Скриншот сакталды"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Скриншотуңузду көрүү үчүн таптап коюңуз"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Скриншот сакталган жок"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Скриншотту сактоо үчүн түзмөктүн кулпусун ачуу керек"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Скриншотту кайра тартып көрүңүз"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Сактагычта бош орун аз болгондуктан, скриншот сакталбай жатат"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Скриншот тартууга колдонмо же ишканаңыз тыюу салган."</string>
diff --git a/packages/SystemUI/res/values-ky/strings_tv.xml b/packages/SystemUI/res/values-ky/strings_tv.xml
index 3be657c..1dba865 100644
--- a/packages/SystemUI/res/values-ky/strings_tv.xml
+++ b/packages/SystemUI/res/values-ky/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN туташтырылды"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ажыратылды"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> аркылуу"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Билдирмелер"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Билдирме жок"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lo/strings.xml b/packages/SystemUI/res/values-lo/strings.xml
index b92c2c1..aa3bc88 100644
--- a/packages/SystemUI/res/values-lo/strings.xml
+++ b/packages/SystemUI/res/values-lo/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ບັນທຶກຮູບໜ້າຈໍໄວ້ແລ້ວ"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ແຕະເພື່ອເບິ່ງພາບຖ່າຍໜ້າຈໍຂອງທ່ານ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ບໍ່ສາມາດບັນທຶກຮູບໜ້າຈໍໄດ້"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ຈະຕ້ອງປົດລັອກອຸປະກອນກ່ອນບັນທຶກຮູບໜ້າຈໍ"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ກະລຸນາລອງຖ່າຍຮູບໜ້າຈໍອີກຄັ້ງ"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"ບໍ່ສາມາດຖ່າຍຮູບໜ້າຈໍໄດ້ເນື່ອງຈາກພື້ນທີ່ຈັດເກັບຂໍ້ມູນມີຈຳກັດ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ແອັບ ຫຼື ອົງກອນຂອງທ່ານບໍ່ອະນຸຍາດໃຫ້ຖ່າຍຮູບໜ້າຈໍ"</string>
diff --git a/packages/SystemUI/res/values-lo/strings_tv.xml b/packages/SystemUI/res/values-lo/strings_tv.xml
index 445e562..a45fb45 100644
--- a/packages/SystemUI/res/values-lo/strings_tv.xml
+++ b/packages/SystemUI/res/values-lo/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"ເຊື່ອມຕໍ່ VPN ແລ້ວ"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"ຕັດການເຊື່ອມຕໍ່ VPN ແລ້ວ"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"ຜ່ານ <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"ການແຈ້ງເຕືອນ"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ບໍ່ມີການແຈ້ງເຕືອນ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index cac9cf1..c40c5c9 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Ekrano kopija išsaugota"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Palieskite, kad peržiūrėtumėte ekrano kopiją"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Ekrano kopijos išsaugoti nepavyko"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Įrenginys turi būti atrakintas, kad būtų galima išsaugoti ekrano kopiją"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Pabandykite padaryti ekrano kopiją dar kartą"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Negalima išsaugoti ekrano kopijos dėl ribotos saugyklos vietos"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Jūsų organizacijoje arba naudojant šią programą neleidžiama daryti ekrano kopijų"</string>
diff --git a/packages/SystemUI/res/values-lt/strings_tv.xml b/packages/SystemUI/res/values-lt/strings_tv.xml
index c749cdf..8c329f9 100644
--- a/packages/SystemUI/res/values-lt/strings_tv.xml
+++ b/packages/SystemUI/res/values-lt/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN prijungtas"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN atjungtas"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Per „<xliff:g id="VPN_APP">%1$s</xliff:g>“"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Pranešimai"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nėra jokių pranešimų"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index da8adb4..85b272a 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Ekrānuzņēmums saglabāts"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Pieskarieties, lai skatītu ekrānuzņēmumu."</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Ekrānuzņēmumu neizdevās saglabāt."</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Lai varētu saglabāt ekrānuzņēmumu, ierīcei ir jābūt atbloķētai."</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Mēģiniet izveidot jaunu ekrānuzņēmumu."</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Nevar saglabāt ekrānuzņēmumu, jo krātuvē nepietiek vietas."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Lietotne vai jūsu organizācija neatļauj veikt ekrānuzņēmumus."</string>
diff --git a/packages/SystemUI/res/values-lv/strings_tv.xml b/packages/SystemUI/res/values-lv/strings_tv.xml
index f752439..758d28c 100644
--- a/packages/SystemUI/res/values-lv/strings_tv.xml
+++ b/packages/SystemUI/res/values-lv/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Savienojums ar VPN ir izveidots."</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Savienojums ar VPN ir pārtraukts."</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Izmantojot: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Paziņojumi"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nav paziņojumu"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index 2416dbd..bbcf93c 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Сликата од екранот е зачувана"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Допрете за да ја видите сликата од екранот"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Не може да се зачува слика од екранот"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Уредот мора да биде отклучен за да може да се зачува слика од екранот"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Повторно обидете се да направите слика од екранот"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Сликата од екранот не може да се зачува поради ограничена меморија"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Апликацијата или вашата организација не дозволува снимање слики од екранот"</string>
diff --git a/packages/SystemUI/res/values-mk/strings_tv.xml b/packages/SystemUI/res/values-mk/strings_tv.xml
index 9472813..0dfbd79 100644
--- a/packages/SystemUI/res/values-mk/strings_tv.xml
+++ b/packages/SystemUI/res/values-mk/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN е поврзана"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN е исклучена"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Преку <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Известувања"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Нема известувања"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index 4d77fcd..b4db453 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"സ്ക്രീൻഷോട്ട് സംരക്ഷിച്ചു"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"സ്ക്രീൻഷോട്ട് കാണാൻ ടാപ്പ് ചെയ്യുക"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"സ്ക്രീൻഷോട്ട് സംരക്ഷിക്കാനായില്ല"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"സ്ക്രീൻഷോട്ട് സംരക്ഷിക്കുന്നതിന് മുമ്പ് ഉപകരണം അൺലോക്ക് ചെയ്തിരിക്കണം"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"സ്ക്രീൻഷോട്ട് എടുക്കാൻ വീണ്ടും ശ്രമിക്കുക"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"സ്റ്റോറേജ് ഇടം പരിമിതമായതിനാൽ സ്ക്രീൻഷോട്ട് സംരക്ഷിക്കാനാകുന്നില്ല"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"സ്ക്രീൻഷോട്ടുകൾ എടുക്കുന്നത് ആപ്പോ നിങ്ങളുടെ സ്ഥാപനമോ അനുവദിക്കുന്നില്ല"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"പൊതുവായ സന്ദേശങ്ങൾ"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"സ്റ്റോറേജ്"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"സൂചനകൾ"</string>
- <string name="instant_apps" msgid="8337185853050247304">"ഇൻസ്റ്റന്റ് ആപ്പ്"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> റണ് ചെയ്യുന്നു"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"ഇൻസ്റ്റാൾ ചെയ്യാതെ ആപ്പ് തുറന്നു."</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"ഇൻസ്റ്റാൾ ചെയ്യാതെ ആപ്പ് തുറന്നു. കൂടുതലറിയാൻ ടാപ്പ് ചെയ്യുക."</string>
diff --git a/packages/SystemUI/res/values-ml/strings_tv.xml b/packages/SystemUI/res/values-ml/strings_tv.xml
index fe79796..70cced8 100644
--- a/packages/SystemUI/res/values-ml/strings_tv.xml
+++ b/packages/SystemUI/res/values-ml/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN കണക്റ്റ് ചെയ്തു"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN വിച്ഛേദിച്ചു"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> വഴി"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"അറിയിപ്പുകൾ"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"അറിയിപ്പുകൾ ഒന്നുമില്ല"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mn/strings.xml b/packages/SystemUI/res/values-mn/strings.xml
index 0d605c1..6a96a50 100644
--- a/packages/SystemUI/res/values-mn/strings.xml
+++ b/packages/SystemUI/res/values-mn/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Дэлгэцээс дарсан зургийг хадгалсан"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Дэлгэцээс дарсан зургийг харах бол товшино уу"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Дэлгэцээс дарсан зургийг хадгалж чадсангүй"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Дэлгэцийн агшныг хадгалах боломжтой болохоос өмнө төхөөрөмжийн түгжээг тайлах ёстой"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Дэлгэцийн зургийг дахин дарж үзнэ үү"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Сангийн багтаамж бага байгаа тул дэлгэцээс дарсан зургийг хадгалах боломжгүй байна"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Таны апп, байгууллагад дэлгэцийн зураг авахыг зөвшөөрдөггүй"</string>
diff --git a/packages/SystemUI/res/values-mn/strings_tv.xml b/packages/SystemUI/res/values-mn/strings_tv.xml
index 9ec66d1..221d8ae 100644
--- a/packages/SystemUI/res/values-mn/strings_tv.xml
+++ b/packages/SystemUI/res/values-mn/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN холбогдсон"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN салсан"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-р"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Мэдэгдэл"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Мэдэгдэл байхгүй байна"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index a487a63..a667ab7 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"स्क्रीनशॉट सेव्ह केला"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"तुमचा स्क्रीनशॉट पाहण्यासाठी टॅप करा"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"स्क्रीनशॉट सेव्ह करू शकलो नाही"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"स्क्रीनशॉट सेव्ह करण्याआधी डिव्हाइस अनलॉक करणे आवश्यक आहे"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"स्क्रीनशॉट पुन्हा घेण्याचा प्रयत्न करा"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"मर्यादित स्टोरेज जागेमुळे स्क्रीनशॉट सेव्ह करू शकत नाही"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"अॅप किंवा आपल्या संस्थेद्वारे स्क्रीनशॉट घेण्याची अनुमती नाही"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"सर्वसाधारण मेसेज"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"स्टोरेज"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"सूचना"</string>
- <string name="instant_apps" msgid="8337185853050247304">"इन्सटंट अॅप्स"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> रन होत आहे"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"इंस्टॉल केल्याशिवाय अॅप उघडले."</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"इंस्टॉल केल्याशिवाय अॅप उघडले. अधिक जाणून घेण्यासाठी टॅप करा."</string>
diff --git a/packages/SystemUI/res/values-mr/strings_tv.xml b/packages/SystemUI/res/values-mr/strings_tv.xml
index 791a4fd..ac0cad1 100644
--- a/packages/SystemUI/res/values-mr/strings_tv.xml
+++ b/packages/SystemUI/res/values-mr/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN कनेक्ट केले"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN डिस्कनेक्ट केले"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> द्वारे"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"सूचना"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"सूचना नाहीत"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index 8f426ed..8656590 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Tangkapan skrin disimpan"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Ketik untuk melihat tangkapan skrin anda"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Tidak dapat menyimpan tangkapan skrin"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Peranti mesti dibuka kunci sebelum tangkapan skrin dapat disimpan"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Cuba ambil tangkapan skrin sekali lagi"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Tidak dapat menyimpan tangkapan skrin kerana ruang storan terhad"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Pengambilan tangkapan skrin tidak dibenarkan oleh apl atau organisasi anda"</string>
diff --git a/packages/SystemUI/res/values-ms/strings_tv.xml b/packages/SystemUI/res/values-ms/strings_tv.xml
index 65c8068..46e345e 100644
--- a/packages/SystemUI/res/values-ms/strings_tv.xml
+++ b/packages/SystemUI/res/values-ms/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN telah disambungkan"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN diputuskan sambungan"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Melalui <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Pemberitahuan"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Tiada Pemberitahuan"</string>
</resources>
diff --git a/packages/SystemUI/res/values-my/strings.xml b/packages/SystemUI/res/values-my/strings.xml
index 9d8ffc9..5b5531d0 100644
--- a/packages/SystemUI/res/values-my/strings.xml
+++ b/packages/SystemUI/res/values-my/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ဖန်သားပြင်ဓာတ်ပုံကို သိမ်းပြီးပါပြီ"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ဖန်သားပြင်ဓာတ်ပုံကို ကြည့်ရန် တို့ပါ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"မျက်နှာပြင်ပုံကို သိမ်း၍မရပါ"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ဖန်သားပြင်ဓာတ်ပုံကို မသိမ်းမီ စက်ပစ္စည်းကို လော့ခ်ဖွင့်ထားရမည်"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"မျက်နှာပြင်ပုံကို ထပ်ရိုက်ကြည့်ပါ"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"သိုလှောင်ခန်းနေရာ အကန့်အသတ်ရှိသောကြောင့် ဖန်သားပြင်ဓာတ်ပုံကို သိမ်းဆည်း၍မရပါ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ဖန်သားပြင်ဓာတ်ပုံရိုက်ကူးခြင်းကို ဤအက်ပ် သို့မဟုတ် သင်၏အဖွဲ့အစည်းက ခွင့်မပြုပါ"</string>
diff --git a/packages/SystemUI/res/values-my/strings_tv.xml b/packages/SystemUI/res/values-my/strings_tv.xml
index c07b9a5..268c554 100644
--- a/packages/SystemUI/res/values-my/strings_tv.xml
+++ b/packages/SystemUI/res/values-my/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ချိတ်ဆက်ထားသည်"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ချိတ်ဆက်မှုမရှိပါ"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> မှတစ်ဆင့်"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"အကြောင်းကြားချက်များ"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"အကြောင်းကြားချက်များ မရှိပါ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 1d30e2b..6b0568d 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Skjermdumpen er lagret"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Trykk for å se skjermdumpen"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Kunne ikke lagre skjermdump"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Enheten må være låst opp før skjermdumpen kan lagres"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Prøv å ta skjermdump på nytt"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Kan ikke lagre skjermdumpen på grunn av begrenset lagringsplass"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Appen eller organisasjonen din tillater ikke at du tar skjermdumper"</string>
diff --git a/packages/SystemUI/res/values-nb/strings_tv.xml b/packages/SystemUI/res/values-nb/strings_tv.xml
index 6346519..c5767dd 100644
--- a/packages/SystemUI/res/values-nb/strings_tv.xml
+++ b/packages/SystemUI/res/values-nb/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN er tilkoblet"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN er frakoblet"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Varsler"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ingen varsler"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index 881be66..f72808f 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"स्क्रिनसट सुरक्षित गरियो"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"आफ्नो स्क्रिनसट हेर्न ट्याप गर्नुहोस्"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"स्क्रिनसट सुरक्षित गर्न सकिएन"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"यन्त्र अनलक गरेपछि मात्र स्क्रिनसट सुरक्षित गर्न सकिन्छ"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"स्क्रिनसट फेरि लिएर हेर्नुहोस्"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"भण्डारण ठाउँ सीमित भएका कारण स्क्रिनसट सुरक्षित गर्न सकिएन"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"उक्त एप वा तपाईंको संगठनले स्क्रिनसटहरू लिन दिँदैन"</string>
diff --git a/packages/SystemUI/res/values-ne/strings_tv.xml b/packages/SystemUI/res/values-ne/strings_tv.xml
index 00cc10a..925f7b76 100644
--- a/packages/SystemUI/res/values-ne/strings_tv.xml
+++ b/packages/SystemUI/res/values-ne/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN कनेक्ट गरिएको छ"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN डिस्कनेक्ट गरिएको छ"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> मार्फत"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"सूचनाहरू"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"कुनै पनि सूचना छैन"</string>
</resources>
diff --git a/packages/SystemUI/res/values-night/colors.xml b/packages/SystemUI/res/values-night/colors.xml
index 8cc747b..d0aef6f 100644
--- a/packages/SystemUI/res/values-night/colors.xml
+++ b/packages/SystemUI/res/values-night/colors.xml
@@ -44,11 +44,8 @@
<color name="notification_section_clear_all_btn_color">@color/GM2_grey_500</color>
<color name="notification_channel_dialog_separator">@color/GM2_grey_700</color>
- <!-- The color of the background in the top part of QSCustomizer -->
- <color name="qs_customize_background">@color/GM2_grey_900</color>
-
<!-- The color of the background in the bottom part of QSCustomizer -->
- <color name="qs_customize_decoration">@color/GM2_grey_800</color>
+ <color name="qs_customize_decoration">@color/GM2_grey_900</color>
<!-- The color of the background in the separated list of the Global Actions menu -->
<color name="global_actions_separated_background">@color/GM2_grey_900</color>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 6bed66b..aa738c4 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Screenshot opgeslagen"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Tik om je screenshot te bekijken"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Kan screenshot niet opslaan"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Je moet het apparaat ontgrendelen voordat het screenshot kan worden opgeslagen"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Probeer opnieuw een screenshot te maken"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Kan screenshot niet opslaan vanwege beperkte opslagruimte"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Het maken van screenshots wordt niet toegestaan door de app of je organisatie"</string>
diff --git a/packages/SystemUI/res/values-nl/strings_tv.xml b/packages/SystemUI/res/values-nl/strings_tv.xml
index 11f70b4..22d3b88 100644
--- a/packages/SystemUI/res/values-nl/strings_tv.xml
+++ b/packages/SystemUI/res/values-nl/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Verbinding met VPN"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Geen verbinding met VPN"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Meldingen"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Geen meldingen"</string>
</resources>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index a809da3..7e34067 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ସ୍କ୍ରୀନଶଟ୍ ସେଭ୍ ହୋଇଛି"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ସ୍କ୍ରୀନଶଟ୍ ଦେଖିବା ପାଇଁ ଟାପ୍ କରନ୍ତୁ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ସ୍କ୍ରୀନ୍ଶଟ୍ ସେଭ୍ କରିହେବ ନାହିଁ"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ସ୍କ୍ରିନସଟ୍ ସେଭ୍ କରିବା ପୂର୍ବରୁ ଡିଭାଇସକୁ ଅନଲକ୍ କରାଯିବା ଆବଶ୍ୟକ"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ପୁଣିଥରେ ସ୍କ୍ରୀନ୍ଶଟ୍ ନେବାକୁ ଚେଷ୍ଟା କରନ୍ତୁ"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"ସୀମିତ ଷ୍ଟୋରେଜ୍ ସ୍ପେସ୍ ହେତୁ ସ୍କ୍ରୀନଶଟ୍ ସେଭ୍ ହୋଇପାରିବ ନାହିଁ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ଆପ୍ କିମ୍ବା ସଂସ୍ଥା ଦ୍ୱାରା ସ୍କ୍ରୀନଶଟ୍ ନେବାକୁ ଅନୁମତି ଦିଆଯାଇ ନାହିଁ"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"ସାଧାରଣ ମେସେଜ୍"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"ଷ୍ଟୋରେଜ୍"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"ହିଣ୍ଟ"</string>
- <string name="instant_apps" msgid="8337185853050247304">"ଇନଷ୍ଟାଣ୍ଟ ଆପ୍"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> ଚାଲୁଛି"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"ଇନ୍ଷ୍ଟଲ୍ ନହୋଇ ଆପ୍ ଖୋଲିଛି।"</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"ଇନ୍ଷ୍ଟଲ୍ ନହୋଇ ଆପ୍ ଖୋଲିଛି। ଅଧିକ ଜାଣିବା ପାଇଁ ଟାପ୍ କରନ୍ତୁ।"</string>
diff --git a/packages/SystemUI/res/values-or/strings_tv.xml b/packages/SystemUI/res/values-or/strings_tv.xml
index f436bab..707c49e 100644
--- a/packages/SystemUI/res/values-or/strings_tv.xml
+++ b/packages/SystemUI/res/values-or/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ସଂଯୋଗ କରାଯାଇଛି"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ବିଚ୍ଛିନ୍ନ କରାଯାଇଛି"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ମାଧ୍ୟମରେ"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକ"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"କୌଣସି ବିଜ୍ଞପ୍ତି ନାହିଁ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index d9a6828..ca4b6ad 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ਸਕ੍ਰੀਨਸ਼ਾਟ ਰੱਖਿਅਤ ਕੀਤਾ ਗਿਆ"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ਆਪਣਾ ਸਕ੍ਰੀਨਸ਼ਾਟ ਦੇਖਣ ਲਈ ਟੈਪ ਕਰੋ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ਸਕ੍ਰੀਨਸ਼ਾਟ ਰੱਖਿਅਤ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਿਆ"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ਸਕ੍ਰੀਨਸ਼ਾਟ ਨੂੰ ਰੱਖਿਅਤ ਕੀਤੇ ਜਾਣ ਤੋਂ ਪਹਿਲਾਂ ਡੀਵਾਈਸ ਨੂੰ ਅਣਲਾਕ ਕੀਤਾ ਹੋਣਾ ਲਾਜ਼ਮੀ ਹੈ"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ਸਕ੍ਰੀਨਸ਼ਾਟ ਦੁਬਾਰਾ ਲੈ ਕੇ ਦੇਖੋ"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"ਸੀਮਿਤ ਸਟੋਰੇਜ ਹੋਣ ਕਾਰਨ ਸਕ੍ਰੀਨਸ਼ਾਟ ਰੱਖਿਅਤ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ਐਪ ਜਾਂ ਤੁਹਾਡੀ ਸੰਸਥਾ ਵੱਲੋਂ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲੈਣ ਦੀ ਇਜਾਜ਼ਤ ਨਹੀਂ ਦਿੱਤੀ ਗਈ ਹੈ"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"ਆਮ ਸੁਨੇਹੇ"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"ਸਟੋਰੇਜ"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"ਸੰਕੇਤ"</string>
- <string name="instant_apps" msgid="8337185853050247304">"ਤਤਕਾਲ ਐਪਾਂ"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> ਚੱਲ ਰਹੀ ਹੈ"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"ਸਥਾਪਤ ਕੀਤੇ ਬਿਨਾਂ ਐਪ ਖੋਲ੍ਹੀ ਗਈ।"</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"ਸਥਾਪਤ ਕੀਤੇ ਬਿਨਾਂ ਐਪ ਖੋਲ੍ਹੀ ਗਈ। ਹੋਰ ਜਾਣਨ ਲਈ ਟੈਪ ਕਰੋ।"</string>
diff --git a/packages/SystemUI/res/values-pa/strings_tv.xml b/packages/SystemUI/res/values-pa/strings_tv.xml
index d10daa8..c076194 100644
--- a/packages/SystemUI/res/values-pa/strings_tv.xml
+++ b/packages/SystemUI/res/values-pa/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ਕਨੈਕਟ ਹੈ"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN ਡਿਸਕਨੈਕਟ ਹੈ"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ਰਾਹੀਂ"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"ਸੂਚਨਾਵਾਂ"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ਕੋਈ ਸੂਚਨਾ ਨਹੀਂ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 3e944b5..142a507 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Zrzut ekranu został zapisany"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Kliknij, by zobaczyć zrzut ekranu"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Nie udało się zapisać zrzutu ekranu"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Przed zapisaniem zrzutu ekranu musisz odblokować urządzenie"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Spróbuj jeszcze raz wykonać zrzut ekranu"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Nie można zapisać zrzutu ekranu, bo brakuje miejsca w pamięci"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Nie możesz wykonać zrzutu ekranu, bo nie zezwala na to aplikacja lub Twoja organizacja."</string>
diff --git a/packages/SystemUI/res/values-pl/strings_tv.xml b/packages/SystemUI/res/values-pl/strings_tv.xml
index d83391e..e63aade 100644
--- a/packages/SystemUI/res/values-pl/strings_tv.xml
+++ b/packages/SystemUI/res/values-pl/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Połączono z VPN"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Rozłączono z VPN"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Przez: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Powiadomienia"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Brak powiadomień"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings.xml b/packages/SystemUI/res/values-pt-rBR/strings.xml
index d058eddb..82139f5 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Captura de tela salva"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Toque para ver sua captura de tela"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Falha ao salvar a captura de tela"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Para que a captura de tela seja salva, o dispositivo precisa ser desbloqueado"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Tente fazer a captura de tela novamente"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Não é possível salvar a captura de tela, porque não há espaço suficiente"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"O app ou a organização não permitem capturas de tela"</string>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings_tv.xml b/packages/SystemUI/res/values-pt-rBR/strings_tv.xml
index 49b923d..2ea8152 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings_tv.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"A VPN está conectada"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"A VPN está desconectada"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificações"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nenhuma notificação"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index dcaf460..61cc913 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Captura de ecrã guardada"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Toque para ver a captura de ecrã."</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Não foi possível guardar a captura de ecrã"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"É necessário desbloquear o dispositivo para guardar a captura de ecrã"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Experimente voltar a efetuar a captura de ecrã."</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Não é possível guardar a captura de ecrã devido a espaço de armazenamento limitado."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"A app ou a sua entidade não permitem tirar capturas de ecrã"</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings_tv.xml b/packages/SystemUI/res/values-pt-rPT/strings_tv.xml
index a36a1a92..8ce3e30 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings_tv.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"A VPN está ligada"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"A VPN está desligada"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Através de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificações"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Sem notificações"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index d058eddb..82139f5 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Captura de tela salva"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Toque para ver sua captura de tela"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Falha ao salvar a captura de tela"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Para que a captura de tela seja salva, o dispositivo precisa ser desbloqueado"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Tente fazer a captura de tela novamente"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Não é possível salvar a captura de tela, porque não há espaço suficiente"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"O app ou a organização não permitem capturas de tela"</string>
diff --git a/packages/SystemUI/res/values-pt/strings_tv.xml b/packages/SystemUI/res/values-pt/strings_tv.xml
index 49b923d..2ea8152 100644
--- a/packages/SystemUI/res/values-pt/strings_tv.xml
+++ b/packages/SystemUI/res/values-pt/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"A VPN está conectada"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"A VPN está desconectada"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificações"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nenhuma notificação"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 81caf56..123d672 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Captură de ecran salvată"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Atingeți pentru a vedea captura de ecran"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Nu s-a putut salva captura de ecran"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Pentru a salva captura de ecran, trebuie să deblocați dispozitivul"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Încercați să faceți din nou o captură de ecran"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Captura de ecran nu poate fi salvată din cauza spațiului de stocare limitat"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Crearea capturilor de ecran nu este permisă de aplicație sau de organizația dvs."</string>
diff --git a/packages/SystemUI/res/values-ro/strings_tv.xml b/packages/SystemUI/res/values-ro/strings_tv.xml
index 69a3138..c64a492 100644
--- a/packages/SystemUI/res/values-ro/strings_tv.xml
+++ b/packages/SystemUI/res/values-ro/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN este conectat"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN este deconectat"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Prin <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificări"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nicio notificare"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index bf5e604..03f1dfc 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Скриншот сохранен"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Нажмите, чтобы увидеть скриншот."</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Не удалось сохранить скриншот"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Чтобы сохранить скриншот, разблокируйте устройство."</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Попробуйте сделать скриншот снова."</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Не удалось сохранить скриншот: недостаточно места."</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Не удалось сделать скриншот: нет разрешения от приложения или организации."</string>
diff --git a/packages/SystemUI/res/values-ru/strings_tv.xml b/packages/SystemUI/res/values-ru/strings_tv.xml
index bd8855b..e08ade3 100644
--- a/packages/SystemUI/res/values-ru/strings_tv.xml
+++ b/packages/SystemUI/res/values-ru/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN-подключение установлено"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN-подключение отключено"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Отправлено через <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Уведомления"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Уведомлений нет."</string>
</resources>
diff --git a/packages/SystemUI/res/values-si/strings.xml b/packages/SystemUI/res/values-si/strings.xml
index c855be3..f5e2e70 100644
--- a/packages/SystemUI/res/values-si/strings.xml
+++ b/packages/SystemUI/res/values-si/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"තිර රුව සුරකින ලදී"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ඔබගේ තිර රුව බැලීමට තට්ටු කරන්න"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"තිර රුව සුරැකිය නොහැකි විය"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"තිර රුව සුරැකීමට පෙර උපාංගය අගුලු හැරිය යුතුය"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"තිර රුව නැවත ගැනීමට උත්සාහ කරන්න"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"සීමිත ගබඩා ඉඩ නිසා තිර රුව සුරැකිය නොහැකිය"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"තිර රූ ගැනීමට යෙදුම හෝ ඔබගේ සංවිධානය ඉඩ නොදේ"</string>
diff --git a/packages/SystemUI/res/values-si/strings_tv.xml b/packages/SystemUI/res/values-si/strings_tv.xml
index a04d166..3067be3 100644
--- a/packages/SystemUI/res/values-si/strings_tv.xml
+++ b/packages/SystemUI/res/values-si/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN සම්බන්ධිතයි"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN විසන්ධි කර ඇත"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> හරහා"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"දැනුම්දීම්"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"දැනුම්දීම් නැත"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index c2a94be..22673b9 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Snímka obrazovky bola uložená"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Klepnutím zobrazíte snímku obrazovky"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Snímku obrazovky sa nepodarilo uložiť"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Pred uložením snímky obrazovky je potrebné zariadenie odomknúť"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Skúste snímku urobiť znova"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Snímka obrazovky sa nedá uložiť z dôvodu nedostatku miesta v úložisku"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Vytváranie snímok obrazovky je zakázané aplikáciou alebo vašou organizáciou"</string>
diff --git a/packages/SystemUI/res/values-sk/strings_tv.xml b/packages/SystemUI/res/values-sk/strings_tv.xml
index 3b8fcc8..b37648d 100644
--- a/packages/SystemUI/res/values-sk/strings_tv.xml
+++ b/packages/SystemUI/res/values-sk/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Sieť VPN je pripojená"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Sieť VPN je odpojená"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Cez: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Upozornenia"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Žiadne upozornenia"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 5828d65..42a961c 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Posnetek zaslona je shranjen"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Dotaknite se, če si želite ogledati posnetek zaslona"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Posnetka zaslona ni bilo mogoče shraniti"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Pred shranjevanjem posnetka zaslona morate odkleniti napravo"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Poskusite znova ustvariti posnetek zaslona"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Shranjevanje posnetka zaslona ni mogoče zaradi omejenega prostora za shranjevanje"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Aplikacija ali vaša organizacija ne dovoljuje posnetkov zaslona"</string>
diff --git a/packages/SystemUI/res/values-sl/strings_tv.xml b/packages/SystemUI/res/values-sl/strings_tv.xml
index af5d75d..57d70c0 100644
--- a/packages/SystemUI/res/values-sl/strings_tv.xml
+++ b/packages/SystemUI/res/values-sl/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Povezava z navideznim zasebnim omrežjem je vzpostavljena"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Povezava z navideznim zasebnim omrežjem je prekinjena"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Prek storitve <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Obvestila"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ni obvestil"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sq/strings.xml b/packages/SystemUI/res/values-sq/strings.xml
index 297ebc6..1943823 100644
--- a/packages/SystemUI/res/values-sq/strings.xml
+++ b/packages/SystemUI/res/values-sq/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Pamja e ekranit u ruajt"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Trokit për të parë pamjen e ekranit"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Pamja e ekranit nuk mund të ruhej"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Pajisja duhet të shkyçet para se të mund të ruhet pamja e ekranit"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Provo ta nxjerrësh përsëri pamjen e ekranit"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Pamja e ekranit nuk mund të ruhet për shkak të hapësirës ruajtëse të kufizuar"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Nxjerrja e pamjeve të ekranit nuk lejohet nga aplikacioni ose organizata jote."</string>
diff --git a/packages/SystemUI/res/values-sq/strings_tv.xml b/packages/SystemUI/res/values-sq/strings_tv.xml
index 713130f..fb74e38 100644
--- a/packages/SystemUI/res/values-sq/strings_tv.xml
+++ b/packages/SystemUI/res/values-sq/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN-ja është e lidhur"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN-ja është shkëputur"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Nëpërmjet <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Njoftimet"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Asnjë njoftim"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index f9262b0..50bbff2 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Снимак екрана је сачуван"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Додирните да бисте видели снимак екрана"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Чување снимка екрана није успело"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Уређај мора да буде откључан да би снимак екрана могао да се сачува"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Пробајте да поново направите снимак екрана"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Чување снимка екрана није успело због ограниченог меморијског простора"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Апликација или организација не дозвољавају прављење снимака екрана"</string>
diff --git a/packages/SystemUI/res/values-sr/strings_tv.xml b/packages/SystemUI/res/values-sr/strings_tv.xml
index 77f842c..59151da 100644
--- a/packages/SystemUI/res/values-sr/strings_tv.xml
+++ b/packages/SystemUI/res/values-sr/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN је повезан"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Веза са VPN-ом је прекинута"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Преко: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Обавештења"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Нема обавештења"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 3401294..1aba0e3 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Skärmdumpen har sparats"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Visa skärmdumpen genom att trycka här"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Det gick inte att spara skärmdumpen"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Skärmdumpen kan bara sparas om enheten är upplåst"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Testa att ta en skärmdump igen"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Det går inte att spara skärmdumpen eftersom lagringsutrymmet inte räcker"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Appen eller organisationen tillåter inte att du tar skärmdumpar"</string>
diff --git a/packages/SystemUI/res/values-sv/strings_tv.xml b/packages/SystemUI/res/values-sv/strings_tv.xml
index 141aabf..d7261e6b 100644
--- a/packages/SystemUI/res/values-sv/strings_tv.xml
+++ b/packages/SystemUI/res/values-sv/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN är anslutet"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN är frånkopplat"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Aviseringar"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Inga aviseringar"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 4cf09c7..f02cc91 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Imehifadhi picha ya skrini"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Gusa ili utazame picha ya skrini uliyohifadhi"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Imeshindwa kuhifadhi picha ya skrini"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Ni sharti ufungue kifaa kabla ya kuhifadhi picha ya skrini"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Jaribu kupiga picha ya skrini tena"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Imeshindwa kuhifadhi picha ya skrini kwa sababu nafasi haitoshi"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Programu au shirika lako halikuruhusu kupiga picha za skrini"</string>
diff --git a/packages/SystemUI/res/values-sw/strings_tv.xml b/packages/SystemUI/res/values-sw/strings_tv.xml
index 9dd37ce..8f6880d 100644
--- a/packages/SystemUI/res/values-sw/strings_tv.xml
+++ b/packages/SystemUI/res/values-sw/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN imeunganishwa"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN imeondolewa"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Kupitia <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Arifa"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Hakuna Arifa"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sw600dp/config.xml b/packages/SystemUI/res/values-sw600dp/config.xml
index be66320..d886f00 100644
--- a/packages/SystemUI/res/values-sw600dp/config.xml
+++ b/packages/SystemUI/res/values-sw600dp/config.xml
@@ -32,4 +32,7 @@
<!-- orientation of the dead zone when touches have recently occurred elsewhere on screen -->
<integer name="navigation_bar_deadzone_orientation">0</integer>
+ <!-- Whether wallet view is shown in landscape / seascape orientations -->
+ <bool name="global_actions_show_landscape_wallet_view">true</bool>
+
</resources>
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index fdf4e3b..3be73ba 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -94,4 +94,11 @@
<!-- Text size for user name in user switcher -->
<dimen name="kg_user_switcher_text_size">18sp</dimen>
+
+ <!-- TODO(himanshujaju) - add comments -->
+ <dimen name="global_actions_wallet_top_margin">5dp</dimen>
+ <dimen name="controls_header_bottom_margin">12dp</dimen>
+ <dimen name="controls_top_margin">24dp</dimen>
+
+ <dimen name="global_actions_grid_item_layout_height">80dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index 5d29c91..a9a3b07 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"ஸ்கிரீன்ஷாட் சேமிக்கப்பட்டது"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"ஸ்கிரீன்ஷாட்டைப் பார்க்க, தட்டவும்"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"ஸ்கிரீன் ஷாட்டைச் சேமிக்க முடியவில்லை"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ஸ்கிரீன்ஷாட் சேமிக்கப்படுவதற்கு முன்பு சாதனம் அன்லாக் செய்யப்பட வேண்டும்"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ஸ்கிரீன் ஷாட்டை மீண்டும் எடுக்க முயலவும்"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"போதுமான சேமிப்பிடம் இல்லாததால் ஸ்கிரீன்ஷாட்டைச் சேமிக்க முடியவில்லை"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ஸ்கிரீன் ஷாட்டுகளை எடுப்பதை, ஆப்ஸ் அல்லது உங்கள் நிறுவனம் அனுமதிக்கவில்லை"</string>
@@ -935,7 +936,7 @@
<string name="notification_channel_general" msgid="4384774889645929705">"பொதுச் செய்திகள்"</string>
<string name="notification_channel_storage" msgid="2720725707628094977">"சேமிப்பிடம்"</string>
<string name="notification_channel_hints" msgid="7703783206000346876">"குறிப்புகள்"</string>
- <string name="instant_apps" msgid="8337185853050247304">"இன்ஸ்டண்ட் ஆப்ஸ்"</string>
+ <string name="instant_apps" msgid="8337185853050247304">"Instant Apps"</string>
<string name="instant_apps_title" msgid="8942706782103036910">"<xliff:g id="APP">%1$s</xliff:g> இயங்குகிறது"</string>
<string name="instant_apps_message" msgid="6112428971833011754">"நிறுவ வேண்டிய தேவையில்லாமல் ஆப்ஸ் திறக்கப்பட்டது."</string>
<string name="instant_apps_message_with_help" msgid="1816952263531203932">"நிறுவ வேண்டிய தேவையில்லாமல் ஆப்ஸ் திறக்கப்பட்டது. மேலும் அறியத் தட்டவும்."</string>
diff --git a/packages/SystemUI/res/values-ta/strings_tv.xml b/packages/SystemUI/res/values-ta/strings_tv.xml
index 0483201..9c62d8cf 100644
--- a/packages/SystemUI/res/values-ta/strings_tv.xml
+++ b/packages/SystemUI/res/values-ta/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN இணைக்கப்பட்டது"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN துண்டிக்கப்பட்டது"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> வழியாக"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"அறிவிப்புகள்"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"அறிவிப்புகள் எதுவுமில்லை"</string>
</resources>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index 5fed052..7e7dc37 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"స్క్రీన్షాట్ సేవ్ చేయబడింది"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"మీ స్క్రీన్షాట్ను వీక్షించడానికి నొక్కండి"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"స్క్రీన్షాట్ని సేవ్ చేయడం సాధ్యం కాలేదు"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"స్క్రీన్షాట్ సేవ్ అవ్వకముందే పరికరం అన్లాక్ చేయబడాలి"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"స్క్రీన్షాట్ తీయడానికి మళ్లీ ప్రయత్నించండి"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"నిల్వ స్థలం పరిమితంగా ఉన్న కారణంగా స్క్రీన్షాట్ను సేవ్ చేయడం సాధ్యపడదు"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"స్క్రీన్షాట్లు తీయడానికి యాప్ లేదా మీ సంస్థ అనుమతించలేదు"</string>
diff --git a/packages/SystemUI/res/values-te/strings_tv.xml b/packages/SystemUI/res/values-te/strings_tv.xml
index 67fb678..50f4b45 100644
--- a/packages/SystemUI/res/values-te/strings_tv.xml
+++ b/packages/SystemUI/res/values-te/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN కనెక్ట్ చేయబడింది"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN డిస్కనెక్ట్ చేయబడింది"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ద్వారా"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"నోటిఫికేషన్లు"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"నోటిఫికేషన్లు లేవు"</string>
</resources>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index ffa84d3..a18ec8a 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"บันทึกภาพหน้าจอแล้ว"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"แตะเพื่อดูภาพหน้าจอ"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"บันทึกภาพหน้าจอไม่ได้"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"ต้องปลดล็อกอุปกรณ์ก่อนจึงจะบันทึกภาพหน้าจอได้"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"ลองบันทึกภาพหน้าจออีกครั้ง"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"บันทึกภาพหน้าจอไม่ได้เนื่องจากพื้นที่เก็บข้อมูลมีจำกัด"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"แอปหรือองค์กรของคุณไม่อนุญาตให้จับภาพหน้าจอ"</string>
diff --git a/packages/SystemUI/res/values-th/strings_tv.xml b/packages/SystemUI/res/values-th/strings_tv.xml
index 4a9144b..0724821 100644
--- a/packages/SystemUI/res/values-th/strings_tv.xml
+++ b/packages/SystemUI/res/values-th/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"เชื่อมต่อ VPN แล้ว"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"ยกเลิกการเชื่อมต่อ VPN แล้ว"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"ผ่าน <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"การแจ้งเตือน"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ไม่มีการแจ้งเตือน"</string>
</resources>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index b8cdef1..a68f5ad 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Na-save ang screenshot"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"I-tap upang tingnan ang iyong screenshot"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Hindi ma-save ang screenshot"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Dapat naka-unlock ang device bago ma-save ang screenshot"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Subukang kumuhang muli ng screenshot"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Hindi ma-save ang screenshot dahil sa limitadong espasyo ng storage"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Hindi pinahihintulutan ng app o ng iyong organisasyon ang pagkuha ng mga screenshot"</string>
diff --git a/packages/SystemUI/res/values-tl/strings_tv.xml b/packages/SystemUI/res/values-tl/strings_tv.xml
index 3489503..8dcc22f 100644
--- a/packages/SystemUI/res/values-tl/strings_tv.xml
+++ b/packages/SystemUI/res/values-tl/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Nakakonekta ang VPN"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Nakadiskonekta ang VPN"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Sa pamamagitan ng <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Mga Notification"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Walang Notification"</string>
</resources>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index 74666b2..d0d343c 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Ekran görüntüsü kaydedildi"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Ekran görüntünüzü görmek için dokunun"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Ekran görüntüsü kaydedilemedi"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Ekran görüntüsünün kaydedilebilmesi için cihazın kilidi açık olmalıdır"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Tekrar ekran görüntüsü almayı deneyin"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Depolama alanı sınırlı olduğundan ekran görüntüsü kaydedilemiyor"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Uygulama veya kuruluşunuz, ekran görüntüsü alınmasına izin vermiyor."</string>
diff --git a/packages/SystemUI/res/values-tr/strings_tv.xml b/packages/SystemUI/res/values-tr/strings_tv.xml
index bfb1ae2..babd460 100644
--- a/packages/SystemUI/res/values-tr/strings_tv.xml
+++ b/packages/SystemUI/res/values-tr/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN bağlandı"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN bağlantısı kesildi"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> yoluyla"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Bildirimler"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Bildirim Yok"</string>
</resources>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 2737ce8..26bc662 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -28,7 +28,7 @@
<string name="battery_low_percent_format" msgid="4276661262843170964">"Залишилося <xliff:g id="PERCENTAGE">%s</xliff:g>"</string>
<string name="battery_low_percent_format_hybrid" msgid="3985614339605686167">"На основі використання залишилося <xliff:g id="PERCENTAGE">%1$s</xliff:g> – близько <xliff:g id="TIME">%2$s</xliff:g>"</string>
<string name="battery_low_percent_format_hybrid_short" msgid="5917433188456218857">"Залишилося <xliff:g id="PERCENTAGE">%1$s</xliff:g> – близько <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="battery_low_percent_format_saver_started" msgid="4968468824040940688">"Залишилося <xliff:g id="PERCENTAGE">%s</xliff:g>. Увімкнено режим економії заряду акумулятора."</string>
+ <string name="battery_low_percent_format_saver_started" msgid="4968468824040940688">"Залишилося <xliff:g id="PERCENTAGE">%s</xliff:g>. Увімкнено режим енергозбереження."</string>
<string name="invalid_charger" msgid="4370074072117767416">"Не вдається зарядити через USB. Використовуйте зарядний пристрій, який входить у комплект пристрою."</string>
<string name="invalid_charger_title" msgid="938685362320735167">"Не вдається зарядити через USB"</string>
<string name="invalid_charger_text" msgid="2339310107232691577">"Використовуйте зарядний пристрій, який входить у комплект пристрою"</string>
@@ -36,7 +36,7 @@
<string name="battery_saver_confirmation_title" msgid="1234998463717398453">"Увімкнути режим енергозбереження?"</string>
<string name="battery_saver_confirmation_title_generic" msgid="2299231884234959849">"Про режим енергозбереження"</string>
<string name="battery_saver_confirmation_ok" msgid="5042136476802816494">"Увімкнути"</string>
- <string name="battery_saver_start_action" msgid="4553256017945469937">"Увімкнути режим економії заряду акумулятора"</string>
+ <string name="battery_saver_start_action" msgid="4553256017945469937">"Увімкнути режим енергозбереження"</string>
<string name="status_bar_settings_settings_button" msgid="534331565185171556">"Налаштування"</string>
<string name="status_bar_settings_wifi_button" msgid="7243072479837270946">"Wi-Fi"</string>
<string name="status_bar_settings_auto_rotation" msgid="8329080442278431708">"Автообертання екрана"</string>
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Знімок екрана збережено"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Торкніться, щоб переглянути знімок екрана"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Не вдалося зберегти знімок екрана"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Щоб зберегти знімок екрана, розблокуйте пристрій"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Спробуйте зробити знімок екрана ще раз"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Не вдалося зберегти знімок екрана через обмежений обсяг пам’яті"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Додаток або адміністратор вашої організації не дозволяють робити знімки екрана"</string>
@@ -509,7 +510,7 @@
<string name="user_remove_user_remove" msgid="8387386066949061256">"Видалити"</string>
<string name="battery_saver_notification_title" msgid="8419266546034372562">"Режим енергозбереження ввімкнено"</string>
<string name="battery_saver_notification_text" msgid="2617841636449016951">"Знижується продуктивність і обмежуються фонові дані"</string>
- <string name="battery_saver_notification_action_text" msgid="6022091913807026887">"Вимкнути режим економії заряду акумулятора"</string>
+ <string name="battery_saver_notification_action_text" msgid="6022091913807026887">"Вимкнути режим енергозбереження"</string>
<string name="media_projection_dialog_text" msgid="1755705274910034772">"Додаток <xliff:g id="APP_SEEKING_PERMISSION">%s</xliff:g> матиме доступ до всієї інформації, яка з\'являється на екрані або відтворюється на пристрої під час запису чи трансляції, зокрема до паролів, інформації про платежі, фотографій, повідомлень і аудіофайлів."</string>
<string name="media_projection_dialog_service_text" msgid="958000992162214611">"Сервіс, що надає цю функцію, матиме доступ до всієї інформації, яка з\'являється на екрані або відтворюється на пристрої під час запису чи трансляції, зокрема до паролів, інформації про платежі, фотографій, повідомлень і аудіофайлів."</string>
<string name="media_projection_dialog_service_title" msgid="2888507074107884040">"Почати запис або трансляцію?"</string>
@@ -975,11 +976,11 @@
<string name="slice_permission_checkbox" msgid="4242888137592298523">"Дозволити додатку <xliff:g id="APP">%1$s</xliff:g> показувати фрагменти будь-якого додатка"</string>
<string name="slice_permission_allow" msgid="6340449521277951123">"Дозволити"</string>
<string name="slice_permission_deny" msgid="6870256451658176895">"Заборонити"</string>
- <string name="auto_saver_title" msgid="6873691178754086596">"Торкніться, щоб увімкнути автоматичний режим економії заряду акумулятора"</string>
+ <string name="auto_saver_title" msgid="6873691178754086596">"Торкніться, щоб налаштувати режим енергозбереження"</string>
<string name="auto_saver_text" msgid="3214960308353838764">"Вмикати, коли заряд акумулятора закінчується"</string>
<string name="no_auto_saver_action" msgid="7467924389609773835">"Ні, дякую"</string>
<string name="auto_saver_enabled_title" msgid="4294726198280286333">"Автоматичний перехід у режим енергозбереження ввімкнено"</string>
- <string name="auto_saver_enabled_text" msgid="7889491183116752719">"Режим економії заряду акумулятора вмикається автоматично, коли рівень заряду нижчий за <xliff:g id="PERCENTAGE">%d</xliff:g>%%."</string>
+ <string name="auto_saver_enabled_text" msgid="7889491183116752719">"Режим енергозбереження вмикається автоматично, коли рівень заряду нижчий за <xliff:g id="PERCENTAGE">%d</xliff:g>%%."</string>
<string name="open_saver_setting_action" msgid="2111461909782935190">"Налаштування"</string>
<string name="auto_saver_okay_action" msgid="7815925750741935386">"OK"</string>
<string name="heap_dump_tile_name" msgid="2464189856478823046">"Dump SysUI Heap"</string>
diff --git a/packages/SystemUI/res/values-uk/strings_tv.xml b/packages/SystemUI/res/values-uk/strings_tv.xml
index 4a4cac9..170b068 100644
--- a/packages/SystemUI/res/values-uk/strings_tv.xml
+++ b/packages/SystemUI/res/values-uk/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"Мережу VPN під\'єднано"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"Мережу VPN від\'єднано"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Через <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Сповіщення"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Немає сповіщень"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ur/strings.xml b/packages/SystemUI/res/values-ur/strings.xml
index 7488323..5307249 100644
--- a/packages/SystemUI/res/values-ur/strings.xml
+++ b/packages/SystemUI/res/values-ur/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"اسکرین شاٹ محفوظ ہو گیا"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"اپنا اسکرین شاٹ دیکھنے کیلئے تھپتھپائیں"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"اسکرین شاٹ کو محفوظ نہیں کیا جا سکا"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"اسکرین شاٹ محفوظ کرنے سے پہلے آلے کو غیر مقفل کرنا ضروری ہے"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"دوبارہ اسکرین شاٹ لینے کی کوشش کریں"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"اسٹوریج کی محدود جگہ کی وجہ سے اسکرین شاٹ کو محفوظ نہیں کیا جا سکتا"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"ایپ یا آپ کی تنظیم کی جانب سے اسکرین شاٹس لینے کی اجازت نہیں ہے"</string>
diff --git a/packages/SystemUI/res/values-ur/strings_tv.xml b/packages/SystemUI/res/values-ur/strings_tv.xml
index 20d3a58..fbaa3f6 100644
--- a/packages/SystemUI/res/values-ur/strings_tv.xml
+++ b/packages/SystemUI/res/values-ur/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN منسلک ہے"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN غیر منسلک ہے"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"بذریعہ <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"اطلاعات"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"کوئی اطلاع نہیں ہے"</string>
</resources>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index 997197d..b2ba26d 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Skrinshot saqlandi"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Skrinshotni ochish uchun bosing"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Skrinshot saqlanmadi"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Skrinshotni saqlashdan oldin qurilma qulflanmagan boʻlishi lozim"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Qayta skrinshot olib ko‘ring"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Xotirada joy kamligi uchun skrinshot saqlanmadi"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Ilova yoki tashkilotingiz skrinshot olishni taqiqlagan"</string>
@@ -778,7 +779,7 @@
</plurals>
<string name="battery_panel_title" msgid="5931157246673665963">"Batareya sarfi"</string>
<string name="battery_detail_charging_summary" msgid="8821202155297559706">"Quvvat tejash rejimidan quvvatlash vaqtida foydalanib bo‘lmaydi"</string>
- <string name="battery_detail_switch_title" msgid="6940976502957380405">"Quvvat tejash rejimi"</string>
+ <string name="battery_detail_switch_title" msgid="6940976502957380405">"Quvvat tejash"</string>
<string name="battery_detail_switch_summary" msgid="3668748557848025990">"Unumdorlik pasayadi va fonda internetdan foydalanish cheklanadi"</string>
<string name="keyboard_key_button_template" msgid="8005673627272051429">"<xliff:g id="NAME">%1$s</xliff:g> tugmasi"</string>
<string name="keyboard_key_home" msgid="3734400625170020657">"Bosh ekran"</string>
diff --git a/packages/SystemUI/res/values-uz/strings_tv.xml b/packages/SystemUI/res/values-uz/strings_tv.xml
index fc4ecd3..f4b4b08 100644
--- a/packages/SystemUI/res/values-uz/strings_tv.xml
+++ b/packages/SystemUI/res/values-uz/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN ulandi"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN uzildi"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> orqali"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Bildirishnomalar"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Bildirishnomalar yoʻq"</string>
</resources>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 1acdbb5..a5d4900 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Đã lưu ảnh chụp màn hình"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Nhấn để xem ảnh chụp màn hình của bạn"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Không thể lưu ảnh chụp màn hình"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Bạn phải mở khóa thiết bị để chúng tôi có thể lưu ảnh chụp màn hình"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Hãy thử chụp lại màn hình"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Không thể lưu ảnh chụp màn hình do giới hạn dung lượng bộ nhớ"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Ứng dụng hoặc tổ chức của bạn không cho phép chụp ảnh màn hình"</string>
diff --git a/packages/SystemUI/res/values-vi/strings_tv.xml b/packages/SystemUI/res/values-vi/strings_tv.xml
index 98697fd..3dfc8c1 100644
--- a/packages/SystemUI/res/values-vi/strings_tv.xml
+++ b/packages/SystemUI/res/values-vi/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN đã được kết nối"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN đã bị ngắt kết nối"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Thông qua <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Thông báo"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Không có thông báo"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 68630bb..10873c5 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"已保存屏幕截图"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"点按即可查看您的屏幕截图"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"无法保存屏幕截图"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"必须先解锁设备,然后才能保存屏幕截图"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"请再次尝试截屏"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"由于存储空间有限,无法保存屏幕截图"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"此应用或您所在的单位不允许进行屏幕截图"</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings_tv.xml b/packages/SystemUI/res/values-zh-rCN/strings_tv.xml
index 169d98a..1e599ca 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings_tv.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN 已连接"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN 已断开连接"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"通过“<xliff:g id="VPN_APP">%1$s</xliff:g>”"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"没有通知"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index ddf60fb..9abcf10 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"螢幕擷取畫面已儲存"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"輕按即可查看螢幕擷取畫面"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"無法儲存螢幕擷取畫面"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"必須先解鎖裝置,才能儲存螢幕截圖"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"請再嘗試拍攝螢幕擷取畫面"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"由於儲存空間有限,因此無法儲存螢幕擷取畫面"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"應用程式或您的機構不允許擷取螢幕畫面"</string>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings_tv.xml b/packages/SystemUI/res/values-zh-rHK/strings_tv.xml
index 8581851..92b1762 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings_tv.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN 已連線"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN 已中斷連線"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"透過 <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"沒有通知"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 85aae2e..a33146b 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"螢幕截圖已儲存"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"輕觸即可查看螢幕截圖"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"無法儲存螢幕截圖"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"必須先解鎖裝置,才能儲存螢幕截圖"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"請再次嘗試拍攝螢幕截圖"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"由於儲存空間有限,因此無法儲存螢幕截圖"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"這個應用程式或貴機構不允許擷取螢幕畫面"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings_tv.xml b/packages/SystemUI/res/values-zh-rTW/strings_tv.xml
index fcb16b7..db0781a 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings_tv.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"VPN 已連線"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"VPN 連線已中斷"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"透過「<xliff:g id="VPN_APP">%1$s</xliff:g>」"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"沒有通知"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index ca87d97..5c8b6cd 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -83,6 +83,7 @@
<string name="screenshot_saved_title" msgid="8893267638659083153">"Isithombe-skrini silondoloziwe"</string>
<string name="screenshot_saved_text" msgid="7778833104901642442">"Thepha ukuze ubuke isithombe-skrini sakho"</string>
<string name="screenshot_failed_title" msgid="3259148215671936891">"Ayikwazanga ukulondoloza isithombe-skrini"</string>
+ <string name="screenshot_failed_to_save_user_locked_text" msgid="6156607948256936920">"Idivayisi kufanele ivulwe ngaphambi kokuthi isithombe-skrini singalondolozwa"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="1506621600548684129">"Zama ukuthatha isithombe-skrini futhi"</string>
<string name="screenshot_failed_to_save_text" msgid="8344173457344027501">"Ayikwazi ukulondoloza isithombe-skrini ngenxa yesikhala sesitoreji esikhawulelwe"</string>
<string name="screenshot_failed_to_capture_text" msgid="7818288545874407451">"Ukuthatha izithombe-skrini akuvunyelwe uhlelo lokusebenza noma inhlangano yakho"</string>
diff --git a/packages/SystemUI/res/values-zu/strings_tv.xml b/packages/SystemUI/res/values-zu/strings_tv.xml
index 5cb6c1d1..a9b7597 100644
--- a/packages/SystemUI/res/values-zu/strings_tv.xml
+++ b/packages/SystemUI/res/values-zu/strings_tv.xml
@@ -24,4 +24,6 @@
<string name="notification_vpn_connected" msgid="3891023882833274730">"I-VPN ixhunyiwe"</string>
<string name="notification_vpn_disconnected" msgid="7150747626448044843">"I-VPN inqanyuliwe"</string>
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Nge-<xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
+ <string name="tv_notification_panel_title" msgid="5311050946506276154">"Izaziso"</string>
+ <string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Azikho Izaziso"</string>
</resources>
diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml
index 78d92c4..897e390 100644
--- a/packages/SystemUI/res/values/attrs.xml
+++ b/packages/SystemUI/res/values/attrs.xml
@@ -161,5 +161,11 @@
<attr name="sensorPressureCoefficient" format="float"/>
<attr name="sensorTouchAreaCoefficient" format="float"/>
</declare-styleable>
+
+ <declare-styleable name="AlphaTintDrawableWrapper">
+ <attr name="android:tint" />
+ <attr name="android:drawable" />
+ <attr name="android:alpha" />
+ </declare-styleable>
</resources>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index c51e0bf..9731d78 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -35,8 +35,7 @@
<color name="status_bar_clock_color">#FFFFFFFF</color>
<color name="qs_user_detail_icon_muted">#FFFFFFFF</color> <!-- not so muted after all -->
<color name="qs_tile_disabled_color">#9E9E9E</color> <!-- 38% black -->
- <color name="qs_customize_background">@color/GM2_grey_50</color>
- <color name="qs_customize_decoration">@color/GM2_grey_100</color>
+ <color name="qs_customize_decoration">@color/GM2_grey_300</color>
<!-- The color of the background in the separated list of the Global Actions menu -->
<color name="global_actions_separated_background">#F5F5F5</color>
@@ -257,6 +256,8 @@
<color name="control_enabled_heat_foreground">#FF8B66</color>
<color name="control_enabled_default_foreground">@color/GM2_blue_300</color>
<color name="control_enabled_cool_foreground">@color/GM2_blue_300</color>
+ <color name="control_thumbnail_tint">#33000000</color>
+ <color name="control_thumbnail_shadow_color">@*android:color/black</color>
<!-- Docked misalignment message -->
<color name="misalignment_text_color">#F28B82</color>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 880dd378..2bf513c 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -570,4 +570,7 @@
<bool name="config_showNotificationForUnknownBatteryState">false</bool>
<!-- content URL in a notification when ACTION_BATTERY_CHANGED.EXTRA_PRESENT field is false -->
<string translatable="false" name="config_batteryStateUnknownUrl"></string>
+
+ <!-- Whether wallet view is shown in landscape / seascape orientations -->
+ <bool name="global_actions_show_landscape_wallet_view">false</bool>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 57e1d43..e1f7e7e 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1005,6 +1005,7 @@
<dimen name="global_actions_grid_vertical_padding">3dp</dimen>
<dimen name="global_actions_grid_horizontal_padding">3dp</dimen>
+ <dimen name="global_actions_grid_item_layout_height">98dp</dimen>
<dimen name="global_actions_grid_item_side_margin">5dp</dimen>
<dimen name="global_actions_grid_item_vertical_margin">4dp</dimen>
<dimen name="global_actions_grid_item_width">64dp</dimen>
@@ -1194,8 +1195,8 @@
<dimen name="magnification_frame_move_long">25dp</dimen>
<dimen name="magnification_drag_view_size">38dp</dimen>
<dimen name="magnification_controls_size">90dp</dimen>
- <dimen name="magnification_switch_button_size">32dp</dimen>
- <dimen name="magnification_switch_button_padding">8dp</dimen>
+ <dimen name="magnification_switch_button_size">60dp</dimen>
+ <dimen name="magnification_switch_button_padding">12dp</dimen>
<dimen name="magnifier_left_right_controls_width">35dp</dimen>
<dimen name="magnifier_left_right_controls_height">45dp</dimen>
<dimen name="magnifier_up_down_controls_width">45dp</dimen>
@@ -1269,6 +1270,10 @@
<dimen name="controls_app_divider_height">2dp</dimen>
<dimen name="controls_app_divider_side_margin">32dp</dimen>
+ <item name="controls_thumbnail_shadow_x" type="dimen" format="float">2.0</item>
+ <item name="controls_thumbnail_shadow_y" type="dimen" format="float">2.0</item>
+ <item name="controls_thumbnail_shadow_radius" type="dimen" format="float">2.0</item>
+
<dimen name="controls_card_margin">@dimen/control_base_item_margin</dimen>
<item name="control_card_elevation" type="dimen" format="float">15</item>
@@ -1303,6 +1308,7 @@
<dimen name="media_output_dialog_icon_corner_radius">16dp</dimen>
<dimen name="media_output_dialog_title_anim_y_delta">12.5dp</dimen>
- <dimen name="people_space_widget_radius">10dp</dimen>
+ <dimen name="people_space_widget_radius">24dp</dimen>
+ <dimen name="people_space_widget_round_radius">100dp</dimen>
<dimen name="people_space_widget_background_padding">6dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 0697c5c..6c0635a 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -489,7 +489,6 @@
<style name="TextAppearance.NotificationInfo">
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
- <item name="android:textColor">@color/notification_primary_text_color</item>
</style>
<style name="TextAppearance.NotificationInfo.Secondary">
@@ -498,7 +497,6 @@
</style>
<style name="TextAppearance.NotificationInfo.Title">
- <item name="android:textColor">@color/notification_primary_text_color</item>
<item name="android:textStyle">bold</item>
</style>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java
index b79fcbd..325bcfc 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java
@@ -81,6 +81,7 @@
HardwareBuffer buffer = bundle.getParcelable(KEY_BUFFER);
ParcelableColorSpace colorSpace = bundle.getParcelable(KEY_COLOR_SPACE);
- return Bitmap.wrapHardwareBuffer(Objects.requireNonNull(buffer), colorSpace);
+ return Bitmap.wrapHardwareBuffer(Objects.requireNonNull(buffer),
+ colorSpace.getColorSpace());
}
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
index 611c4b7..fa2f8b9 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
@@ -137,4 +137,15 @@
return false;
}
}
+
+ /**
+ * @see IRecentsAnimationController#detachNavigationBarFromApp
+ */
+ public void detachNavigationBarFromApp() {
+ try {
+ mAnimationController.detachNavigationBarFromApp();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to detach the navigation bar from app", e);
+ }
+ }
}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
index e40185c..edc3216 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
@@ -23,6 +23,7 @@
import android.content.pm.ActivityInfo;
import android.graphics.PixelFormat;
import android.graphics.PointF;
+import android.graphics.Rect;
import android.os.Bundle;
import android.os.UserHandle;
import android.provider.Settings;
@@ -41,6 +42,8 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.R;
+import java.util.Collections;
+
/**
* Shows/hides a {@link android.widget.ImageView} on the screen and changes the values of
* {@link Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE} when the UI is toggled.
@@ -52,7 +55,7 @@
@VisibleForTesting
static final long FADING_ANIMATION_DURATION_MS = 300;
@VisibleForTesting
- static final int DEFAULT_FADE_OUT_ANIMATION_DELAY_MS = 3000;
+ static final int DEFAULT_FADE_OUT_ANIMATION_DELAY_MS = 5000;
private int mUiTimeout;
private final Runnable mFadeInAnimationTask;
private final Runnable mFadeOutAnimationTask;
@@ -85,7 +88,6 @@
mImageView = imageView;
mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
applyResourcesValues();
- mImageView.setImageResource(getIconResId(mMagnificationMode));
mImageView.setOnTouchListener(this::onTouch);
mImageView.setAccessibilityDelegate(new View.AccessibilityDelegate() {
@Override
@@ -138,6 +140,7 @@
final int padding = mContext.getResources().getDimensionPixelSize(
R.dimen.magnification_switch_button_padding);
mImageView.setPadding(padding, padding, padding, padding);
+ mImageView.setImageResource(getIconResId(mMagnificationMode));
}
private boolean onTouch(View v, MotionEvent event) {
@@ -146,7 +149,7 @@
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
- mImageView.animate().cancel();
+ stopFadeOutAnimation();
mLastDown.set(event.getRawX(), event.getRawY());
mLastDrag.set(event.getRawX(), event.getRawY());
return true;
@@ -205,6 +208,8 @@
}
if (!mIsVisible) {
mWindowManager.addView(mImageView, mParams);
+ // Exclude magnification switch button from system gesture area.
+ setSystemGestureExclusion();
mIsVisible = true;
mImageView.postOnAnimation(mFadeInAnimationTask);
mUiTimeout = mAccessibilityManager.getRecommendedTimeoutMillis(
@@ -212,19 +217,28 @@
AccessibilityManager.FLAG_CONTENT_ICONS
| AccessibilityManager.FLAG_CONTENT_CONTROLS);
}
+ // Refresh the time slot of the fade-out task whenever this method is called.
+ stopFadeOutAnimation();
+ mImageView.postOnAnimationDelayed(mFadeOutAnimationTask, mUiTimeout);
+ }
+
+ private void stopFadeOutAnimation() {
+ mImageView.removeCallbacks(mFadeOutAnimationTask);
if (mIsFadeOutAnimating) {
mImageView.animate().cancel();
mImageView.setAlpha(1f);
+ mIsFadeOutAnimating = false;
}
- // Refresh the time slot of the fade-out task whenever this method is called.
- mImageView.removeCallbacks(mFadeOutAnimationTask);
- mImageView.postOnAnimationDelayed(mFadeOutAnimationTask, mUiTimeout);
}
void onConfigurationChanged(int configDiff) {
if ((configDiff & ActivityInfo.CONFIG_DENSITY) != 0) {
applyResourcesValues();
- mImageView.setImageResource(getIconResId(mMagnificationMode));
+ if (mIsVisible) {
+ mWindowManager.updateViewLayout(mImageView, mParams);
+ // Exclude magnification switch button from system gesture area.
+ setSystemGestureExclusion();
+ }
return;
}
if ((configDiff & ActivityInfo.CONFIG_LOCALE) != 0) {
@@ -261,7 +275,6 @@
ImageView imageView = new ImageView(context);
imageView.setClickable(true);
imageView.setFocusable(true);
- imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageView.setAlpha(0f);
return imageView;
}
@@ -288,4 +301,13 @@
private static String getAccessibilityWindowTitle(Context context) {
return context.getString(com.android.internal.R.string.android_system_label);
}
+
+ private void setSystemGestureExclusion() {
+ mImageView.post(() -> {
+ mImageView.setSystemGestureExclusionRects(
+ Collections.singletonList(
+ new Rect(0, 0, mImageView.getWidth(), mImageView.getHeight())));
+ });
+ }
+
}
diff --git a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
index 0fd4765..c289ca2 100644
--- a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
@@ -438,7 +438,8 @@
}
@Override
- public void onOpNoted(int code, int uid, String packageName, int result) {
+ public void onOpNoted(int code, int uid, String packageName,
+ @AppOpsManager.OpFlags int flags, @AppOpsManager.Mode int result) {
if (DEBUG) {
Log.w(TAG, "Noted op: " + code + " with result "
+ AppOpsManager.MODE_NAMES[result] + " for package " + packageName);
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
index e24a513..e78057f 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
@@ -23,7 +23,6 @@
import android.os.Build;
import android.util.IndentingPrintWriter;
import android.util.Log;
-import android.view.MotionEvent;
import androidx.annotation.NonNull;
@@ -33,10 +32,12 @@
import com.android.systemui.dock.DockManager;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.util.sensors.ThresholdSensor;
+import com.android.systemui.util.time.SystemClock;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayDeque;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
@@ -63,6 +64,8 @@
private final DockManager mDockManager;
private final SingleTapClassifier mSingleTapClassifier;
private final DoubleTapClassifier mDoubleTapClassifier;
+ private final HistoryTracker mHistoryTracker;
+ private final SystemClock mSystemClock;
private final boolean mTestHarness;
private final MetricsLogger mMetricsLogger;
private int mIsFalseTouchCalls;
@@ -85,6 +88,17 @@
}
};
+ private final FalsingDataProvider.GestureCompleteListener mGestureCompleteListener =
+ new FalsingDataProvider.GestureCompleteListener() {
+ @Override
+ public void onGestureComplete() {
+ mHistoryTracker.addResults(
+ mClassifiers.stream().map(FalsingClassifier::classifyGesture)
+ .collect(Collectors.toCollection(ArrayList::new)),
+ mSystemClock.uptimeMillis());
+ }
+ };
+
private boolean mPreviousResult = false;
@Inject
@@ -92,6 +106,7 @@
DockManager dockManager, MetricsLogger metricsLogger,
@Named(BRIGHT_LINE_GESTURE_CLASSIFERS) Set<FalsingClassifier> classifiers,
SingleTapClassifier singleTapClassifier, DoubleTapClassifier doubleTapClassifier,
+ HistoryTracker historyTracker, SystemClock systemClock,
@TestHarness boolean testHarness) {
mDataProvider = falsingDataProvider;
mDockManager = dockManager;
@@ -99,9 +114,12 @@
mClassifiers = classifiers;
mSingleTapClassifier = singleTapClassifier;
mDoubleTapClassifier = doubleTapClassifier;
+ mHistoryTracker = historyTracker;
+ mSystemClock = systemClock;
mTestHarness = testHarness;
mDataProvider.addSessionListener(mSessionListener);
+ mDataProvider.addGestureCompleteListener(mGestureCompleteListener);
}
@Override
@@ -119,21 +137,22 @@
mPreviousResult = !mTestHarness
&& !mDataProvider.isJustUnlockedWithFace() && !mDockManager.isDocked()
&& mClassifiers.stream().anyMatch(falsingClassifier -> {
- boolean result = falsingClassifier.isFalseTouch();
- if (result) {
+ FalsingClassifier.Result result = falsingClassifier.classifyGesture(
+ mHistoryTracker.falsePenalty(), mHistoryTracker.falseConfidence());
+ if (result.isFalse()) {
logInfo(String.format(
(Locale) null,
"{classifier=%s, interactionType=%d}",
falsingClassifier.getClass().getName(),
mDataProvider.getInteractionType()));
- String reason = falsingClassifier.getReason();
+ String reason = result.getReason();
if (reason != null) {
logInfo(reason);
}
} else {
logDebug(falsingClassifier.getClass().getName() + ": false");
}
- return result;
+ return result.isFalse();
});
logDebug("Is false touch? " + mPreviousResult);
@@ -159,10 +178,12 @@
@Override
public boolean isFalseTap(boolean robustCheck) {
- if (!mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents())) {
+ FalsingClassifier.Result singleTapResult =
+ mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents());
+ if (singleTapResult.isFalse()) {
logInfo(String.format(
(Locale) null, "{classifier=%s}", mSingleTapClassifier.getClass().getName()));
- String reason = mSingleTapClassifier.getReason();
+ String reason = singleTapResult.getReason();
if (reason != null) {
logInfo(reason);
}
@@ -179,23 +200,16 @@
@Override
public boolean isFalseDoubleTap() {
- boolean result = mDoubleTapClassifier.isFalseTouch();
- if (result) {
+ FalsingClassifier.Result result = mDoubleTapClassifier.classifyGesture();
+ if (result.isFalse()) {
logInfo(String.format(
(Locale) null, "{classifier=%s}", mDoubleTapClassifier.getClass().getName()));
- String reason = mDoubleTapClassifier.getReason();
+ String reason = result.getReason();
if (reason != null) {
logInfo(reason);
}
}
- return result;
- }
-
- @Override
- public void onTouchEvent(MotionEvent motionEvent, int width, int height) {
- // TODO: some of these classifiers might allow us to abort early, meaning we don't have to
- // make these calls.
- mClassifiers.forEach((classifier) -> classifier.onTouchEvent(motionEvent));
+ return result.isFalse();
}
@Override
@@ -271,6 +285,8 @@
@Override
public void cleanup() {
mDataProvider.removeSessionListener(mSessionListener);
+ mDataProvider.removeGestureCompleteListener(mGestureCompleteListener);
+ mClassifiers.forEach(FalsingClassifier::cleanup);
}
static void logDebug(String msg) {
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java
index 92dd8b7..bbb9371 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java
@@ -62,17 +62,16 @@
VERTICAL_ANGLE_RANGE);
}
- @Override
- boolean isFalseTouch() {
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
float angle = getAngle();
if (angle == Float.MAX_VALUE) { // Unknown angle
- return false;
+ return Result.passed(0);
}
if (getInteractionType() == LEFT_AFFORDANCE
|| getInteractionType() == RIGHT_AFFORDANCE) {
- return false;
+ return Result.passed(0);
}
float minAngle = DIAGONAL - mHorizontalAngleRange;
@@ -82,15 +81,15 @@
maxAngle = DIAGONAL + mVerticalAngleRange;
}
- return angleBetween(angle, minAngle, maxAngle)
+ boolean falsed = angleBetween(angle, minAngle, maxAngle)
|| angleBetween(angle, minAngle + NINETY_DEG, maxAngle + NINETY_DEG)
|| angleBetween(angle, minAngle - NINETY_DEG, maxAngle - NINETY_DEG)
|| angleBetween(angle, minAngle + ONE_HUNDRED_EIGHTY_DEG,
maxAngle + ONE_HUNDRED_EIGHTY_DEG);
+ return falsed ? Result.falsed(0.5f, getReason()) : Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason() {
return String.format(
(Locale) null,
"{angle=%f, vertical=%s}",
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java
index 50d55f6..4cb5aa2 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java
@@ -123,7 +123,6 @@
}
VelocityTracker velocityTracker = VelocityTracker.obtain();
-
for (MotionEvent motionEvent : motionEvents) {
velocityTracker.addMovement(motionEvent);
}
@@ -148,11 +147,11 @@
}
@Override
- public boolean isFalseTouch() {
- return !getPassedFlingThreshold();
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
+ return !getPassedFlingThreshold()
+ ? Result.falsed(0.5, getReason()) : Result.passed(0.5);
}
- @Override
String getReason() {
DistanceVectors distanceVectors = getDistances();
@@ -170,10 +169,10 @@
mVerticalSwipeThresholdPx);
}
- boolean isLongSwipe() {
+ Result isLongSwipe() {
boolean longSwipe = getPassedDistanceThreshold();
logDebug("Is longSwipe? " + longSwipe);
- return longSwipe;
+ return longSwipe ? Result.passed(0.5) : Result.falsed(0.5, getReason());
}
private boolean getPassedDistanceThreshold() {
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java
index 1c8f420..64576a9 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java
@@ -36,8 +36,6 @@
private final float mDoubleTapSlop;
private final long mDoubleTapTimeMs;
- private StringBuilder mReason = new StringBuilder();
-
@Inject
DoubleTapClassifier(FalsingDataProvider dataProvider, SingleTapClassifier singleTapClassifier,
@Named(DOUBLE_TAP_TOUCH_SLOP) float doubleTapSlop,
@@ -49,32 +47,34 @@
}
@Override
- boolean isFalseTouch() {
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
List<MotionEvent> secondTapEvents = getRecentMotionEvents();
Queue<? extends List<MotionEvent>> historicalEvents = getHistoricalEvents();
List<MotionEvent> firstTapEvents = historicalEvents.peek();
- mReason = new StringBuilder();
+ StringBuilder reason = new StringBuilder();
if (firstTapEvents == null) {
- mReason.append("Only one gesture recorded");
- return true;
+ return Result.falsed(1, "Only one gesture recorded");
}
- return !isDoubleTap(firstTapEvents, secondTapEvents, mReason);
+ return !isDoubleTap(firstTapEvents, secondTapEvents, reason)
+ ? Result.falsed(0.5, reason.toString()) : Result.passed(0.5);
}
/** Returns true if the two supplied lists of {@link MotionEvent}s look like a double-tap. */
public boolean isDoubleTap(List<MotionEvent> firstEvents, List<MotionEvent> secondEvents,
StringBuilder reason) {
- if (!mSingleTapClassifier.isTap(firstEvents)) {
- reason.append("First gesture is not a tap. ").append(mSingleTapClassifier.getReason());
+ Result firstTap = mSingleTapClassifier.isTap(firstEvents);
+ if (firstTap.isFalse()) {
+ reason.append("First gesture is not a tap. ").append(firstTap.getReason());
return false;
}
- if (!mSingleTapClassifier.isTap(secondEvents)) {
- reason.append("Second gesture is not a tap. ").append(mSingleTapClassifier.getReason());
+ Result secondTap = mSingleTapClassifier.isTap(secondEvents);
+ if (secondTap.isFalse()) {
+ reason.append("Second gesture is not a tap. ").append(secondTap.getReason());
return false;
}
@@ -106,9 +106,4 @@
return true;
}
-
- @Override
- String getReason() {
- return mReason.toString();
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java
index 82575c3..dbfeacf 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java
@@ -29,8 +29,11 @@
public abstract class FalsingClassifier {
private final FalsingDataProvider mDataProvider;
+ private final FalsingDataProvider.MotionEventListener mMotionEventListener = this::onTouchEvent;
+
FalsingClassifier(FalsingDataProvider dataProvider) {
mDataProvider = dataProvider;
+ mDataProvider.addMotionEventListener(mMotionEventListener);
}
List<MotionEvent> getRecentMotionEvents() {
@@ -89,6 +92,10 @@
return mDataProvider.getInteractionType();
}
+ void cleanup() {
+ mDataProvider.removeMotionEventListener(mMotionEventListener);
+ }
+
/**
* Called whenever a MotionEvent occurs.
*
@@ -113,17 +120,32 @@
void onSessionEnded() {};
/**
- * Returns true if the data captured so far looks like a false touch.
+ * Returns whether a gesture looks like a false touch.
+ *
+ * See also {@link #classifyGesture(double, double)}.
*/
- abstract boolean isFalseTouch();
+ Result classifyGesture() {
+ return calculateFalsingResult(0, 0);
+ }
/**
- * Give the classifier a chance to log more details about why it triggered.
+ * Returns whether a gesture looks like a false touch, with the option to consider history.
*
- * This should only be called after a call to {@link #isFalseTouch()}, and only if
- * {@link #isFalseTouch()} returns true;
+ * Unlike the parameter-less version of this method, this method allows the classifier to take
+ * history into account, penalizing or boosting confidence in a gesture based on recent results.
+ *
+ * See also {@link #classifyGesture()}.
*/
- abstract String getReason();
+ Result classifyGesture(double historyPenalty, double historyConfidence) {
+ return calculateFalsingResult(historyPenalty, historyConfidence);
+ }
+
+ /**
+ * Calculate a result based on available data.
+ *
+ * When passed a historyConfidence of 0, the history penalty should be wholly ignored.
+ */
+ abstract Result calculateFalsingResult(double historyPenalty, double historyConfidence);
/** */
public static void logDebug(String msg) {
@@ -139,4 +161,48 @@
public static void logError(String msg) {
BrightLineFalsingManager.logError(msg);
}
+
+ /**
+ * A Falsing result that encapsulates the boolean result along with confidence and a reason.
+ */
+ static class Result {
+ private final boolean mFalsed;
+ private final double mConfidence;
+ private final String mReason;
+
+ /**
+ * See {@link #falsed(double, String)} abd {@link #passed(double)}.
+ */
+ private Result(boolean falsed, double confidence, String reason) {
+ mFalsed = falsed;
+ mConfidence = confidence;
+ mReason = reason;
+ }
+
+ public boolean isFalse() {
+ return mFalsed;
+ }
+
+ public double getConfidence() {
+ return mConfidence;
+ }
+
+ public String getReason() {
+ return mReason;
+ }
+
+ /**
+ * Construct a "falsed" result indicating that a gesture should be treated as accidental.
+ */
+ static Result falsed(double confidence, String reason) {
+ return new Result(true, confidence, reason);
+ }
+
+ /**
+ * Construct a "passed" result indicating that a gesture should be allowed.
+ */
+ static Result passed(double confidence) {
+ return new Result(false, confidence, null);
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollector.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollector.java
index c05ce93..fe47162 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollector.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollector.java
@@ -113,7 +113,7 @@
void onBouncerHidden();
/** */
- void onTouchEvent(MotionEvent ev, int width, int height);
+ void onTouchEvent(MotionEvent ev);
/** */
void cleanup();
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java
index a569111..fd05989 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorFake.java
@@ -143,7 +143,7 @@
}
@Override
- public void onTouchEvent(MotionEvent ev, int width, int height) {
+ public void onTouchEvent(MotionEvent ev) {
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
index 3547392..4c11ecf 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
@@ -244,9 +244,8 @@
}
@Override
- public void onTouchEvent(MotionEvent ev, int width, int height) {
+ public void onTouchEvent(MotionEvent ev) {
mFalsingDataProvider.onMotionEvent(ev);
- mFalsingManager.onTouchEvent(ev, width, height);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java
index 009b311..deb9e6d 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingDataProvider.java
@@ -50,6 +50,8 @@
private final float mXdpi;
private final float mYdpi;
private final List<SessionListener> mSessionListeners = new ArrayList<>();
+ private final List<MotionEventListener> mMotionEventListeners = new ArrayList<>();
+ private final List<GestureCompleteListener> mGestuerCompleteListeners = new ArrayList<>();
private @Classifier.InteractionType int mInteractionType;
private final Deque<TimeLimitedMotionEventBuffer> mExtendedMotionEvents = new LinkedList<>();
@@ -97,6 +99,8 @@
FalsingClassifier.logDebug("Size: " + mRecentMotionEvents.size());
+ mMotionEventListeners.forEach(listener -> listener.onMotionEvent(motionEvent));
+
mDirty = true;
}
@@ -321,6 +325,26 @@
mSessionListeners.remove(listener);
}
+ /** Register a {@link MotionEventListener}. */
+ public void addMotionEventListener(MotionEventListener listener) {
+ mMotionEventListeners.add(listener);
+ }
+
+ /** Unegister a {@link MotionEventListener}. */
+ public void removeMotionEventListener(MotionEventListener listener) {
+ mMotionEventListeners.remove(listener);
+ }
+
+ /** Register a {@link GestureCompleteListener}. */
+ public void addGestureCompleteListener(GestureCompleteListener listener) {
+ mGestuerCompleteListeners.add(listener);
+ }
+
+ /** Unregister a {@link GestureCompleteListener}. */
+ public void removeGestureCompleteListener(GestureCompleteListener listener) {
+ mGestuerCompleteListeners.remove(listener);
+ }
+
void onSessionStarted() {
mSessionListeners.forEach(SessionListener::onSessionStarted);
}
@@ -353,4 +377,16 @@
/** Called when the lock screen exits and falsing-tracking ends. */
void onSessionEnded();
}
+
+ /** Callback for receiving {@link android.view.MotionEvent}s as they are reported. */
+ public interface MotionEventListener {
+ /** */
+ void onMotionEvent(MotionEvent ev);
+ }
+
+ /** Callback to be alerted when the current gesture ends. */
+ public interface GestureCompleteListener {
+ /** */
+ void onGestureComplete();
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerFake.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerFake.java
index 32d27bc..d4d8d06 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerFake.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerFake.java
@@ -17,7 +17,6 @@
package com.android.systemui.classifier;
import android.net.Uri;
-import android.view.MotionEvent;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.plugins.FalsingManager;
@@ -117,11 +116,6 @@
}
@Override
- public void onTouchEvent(MotionEvent ev, int width, int height) {
-
- }
-
- @Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerProxy.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerProxy.java
index d4f58c3..cbec057 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingManagerProxy.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.net.Uri;
import android.provider.DeviceConfig;
-import android.view.MotionEvent;
import androidx.annotation.NonNull;
@@ -162,11 +161,6 @@
}
@Override
- public void onTouchEvent(MotionEvent ev, int width, int height) {
- mInternalFalsingManager.onTouchEvent(ev, width, height);
- }
-
- @Override
public void onProximityEvent(ThresholdSensor.ThresholdSensorEvent proximityEvent) {
mInternalFalsingManager.onProximityEvent(proximityEvent);
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/HistoryTracker.java b/packages/SystemUI/src/com/android/systemui/classifier/HistoryTracker.java
new file mode 100644
index 0000000..8bd94a1
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/classifier/HistoryTracker.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2020 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.systemui.classifier;
+
+import com.android.systemui.dagger.SysUISingleton;
+import com.android.systemui.plugins.FalsingManager;
+import com.android.systemui.util.time.SystemClock;
+
+import java.util.Collection;
+import java.util.concurrent.DelayQueue;
+import java.util.concurrent.Delayed;
+import java.util.concurrent.TimeUnit;
+
+import javax.inject.Inject;
+
+/**
+ * A stateful class for tracking recent {@link FalsingManager} results.
+ *
+ * Can return a "penalty" based on recent gestures that may make it harder or easier to
+ * unlock a phone, as well as a "confidence" relating to how consistent recent falsing results
+ * have been.
+ */
+@SysUISingleton
+public class HistoryTracker {
+ private static final double HISTORY_DECAY = 0.8f;
+ private static final long DECAY_INTERVAL_MS = 100;
+ // We expire items once their decay factor is below 0.001.
+ private static final double MINIMUM_SCORE = 0.001;
+ private static final long TOTAL_DECAY_TIME_MS =
+ DECAY_INTERVAL_MS * (long) (Math.log(MINIMUM_SCORE) / Math.log(HISTORY_DECAY));
+ private final SystemClock mSystemClock;
+
+ DelayQueue<CombinedResult> mResults = new DelayQueue<>();
+
+ @Inject
+ HistoryTracker(SystemClock systemClock) {
+ mSystemClock = systemClock;
+ }
+
+ /**
+ * Returns how much the HistoryClassifier thinks the past events indicate pocket dialing.
+ *
+ * A result of 0 means that all prior gestures succeeded or there is no data to
+ * calculate a score with. Use {@link #falseConfidence()} to differentiate between the
+ * two cases.
+ *
+ * A result of 1 means that all prior gestures were very obviously false. The current gesture
+ * might be valid, but it should have a high-bar to be classified as such.
+ *
+ * See also {@link #falseConfidence()}.
+ */
+ double falsePenalty() {
+ //noinspection StatementWithEmptyBody
+ while (mResults.poll() != null) {
+ // Empty out the expired results.
+ }
+
+ if (mResults.isEmpty()) {
+ return 0;
+ }
+
+ long nowMs = mSystemClock.uptimeMillis();
+ return mResults.stream()
+ .map(result -> result.getDecayedScore(nowMs))
+ .reduce(0.0, Double::sum) / mResults.size();
+ }
+
+ /**
+ * Returns how confident the HistoryClassifier is in its own score.
+ *
+ * A result of 0.0 means that there are no data to make a calculation with. The HistoryTracker's
+ * results have nothing to add and should not be considered.
+ *
+ * A result of 0.5 means that the data are not consistent with each other, sometimes falsing
+ * sometimes not.
+ *
+ * A result of 1 means that there are ample, fresh data to act upon that is all consistent
+ * with each other.
+ *
+ * See als {@link #falsePenalty()}.
+ */
+ double falseConfidence() {
+ //noinspection StatementWithEmptyBody
+ while (mResults.poll() != null) {
+ // Empty out the expired results.
+ }
+
+ // Our confidence is 1 - the population stddev. Smaller stddev == higher confidence.
+ if (mResults.isEmpty()) {
+ return 0;
+ }
+
+ double mean = mResults.stream()
+ .map(CombinedResult::getScore)
+ .reduce(0.0, Double::sum) / mResults.size();
+
+ double stddev = Math.sqrt(
+ mResults.stream()
+ .map(result -> Math.pow(result.getScore() - mean, 2))
+ .reduce(0.0, Double::sum) / mResults.size());
+
+ return 1 - stddev;
+ }
+
+ void addResults(Collection<FalsingClassifier.Result> results, long uptimeMillis) {
+ double finalScore = 0;
+ for (FalsingClassifier.Result result : results) {
+ // A confidence of 1 adds either 0 for non-falsed or 1 for falsed.
+ // A confidence of 0 adds 0.5.
+ finalScore += (result.isFalse() ? .5 : -.5) * result.getConfidence() + 0.5;
+ }
+
+ finalScore /= results.size();
+
+ //noinspection StatementWithEmptyBody
+ while (mResults.poll() != null) {
+ // Empty out the expired results.
+ }
+
+ mResults.add(new CombinedResult(uptimeMillis, finalScore));
+ }
+
+ /**
+ * Represents a falsing score combing all the classifiers together.
+ *
+ * Can "decay" over time, such that older results contribute less. Once they drop below
+ * a certain threshold, the {@link #getDelay(TimeUnit)} method will return <= 0, indicating
+ * that this result can be discarded.
+ */
+ private class CombinedResult implements Delayed {
+
+ private final long mExpiryMs;
+ private final double mScore;
+
+ CombinedResult(long uptimeMillis, double score) {
+ mExpiryMs = uptimeMillis + TOTAL_DECAY_TIME_MS;
+ mScore = score;
+ }
+
+ double getDecayedScore(long nowMs) {
+ long remainingTimeMs = mExpiryMs - nowMs;
+ long decayedTimeMs = TOTAL_DECAY_TIME_MS - remainingTimeMs;
+ double timeIntervals = (double) decayedTimeMs / DECAY_INTERVAL_MS;
+ return mScore * Math.pow(HISTORY_DECAY, timeIntervals);
+ }
+
+ double getScore() {
+ return mScore;
+ }
+
+ @Override
+ public long getDelay(TimeUnit unit) {
+ return unit.convert(mExpiryMs - mSystemClock.uptimeMillis(), TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public int compareTo(Delayed o) {
+ long ourDelay = getDelay(TimeUnit.MILLISECONDS);
+ long otherDelay = o.getDelay(TimeUnit.MILLISECONDS);
+ return Long.compare(ourDelay, otherDelay);
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java
index 0565165..cd399fe 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java
@@ -56,20 +56,21 @@
}
@Override
- public boolean isFalseTouch() {
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
int interactionType = getInteractionType();
- if (interactionType == QUICK_SETTINGS || interactionType == NOTIFICATION_DRAG_DOWN) {
- return mMaxPointerCount > MAX_ALLOWED_POINTERS_SWIPE_DOWN;
- }
- return mMaxPointerCount > MAX_ALLOWED_POINTERS;
+ int allowedPointerCount =
+ (interactionType == QUICK_SETTINGS || interactionType == NOTIFICATION_DRAG_DOWN)
+ ? MAX_ALLOWED_POINTERS_SWIPE_DOWN : MAX_ALLOWED_POINTERS;
+
+ return mMaxPointerCount > allowedPointerCount
+ ? Result.falsed(1, getReason(allowedPointerCount)) : Result.passed(0);
}
- @Override
- String getReason() {
+ private String getReason(int allowedPointerCount) {
return String.format(
(Locale) null,
"{pointersObserved=%d, threshold=%d}",
mMaxPointerCount,
- MAX_ALLOWED_POINTERS);
+ allowedPointerCount);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java
index 6e73fc0..9ee8598 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java
@@ -33,7 +33,7 @@
/**
* False touch if proximity sensor is covered for more than a certain percentage of the gesture.
*
- * This classifer is essentially a no-op for QUICK_SETTINGS, as we assume the sensor may be
+ * This classifier is essentially a no-op for QUICK_SETTINGS, as we assume the sensor may be
* covered when swiping from the top.
*/
class ProximityClassifier extends FalsingClassifier {
@@ -112,28 +112,29 @@
}
@Override
- public boolean isFalseTouch() {
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
if (getInteractionType() == QUICK_SETTINGS) {
- return false;
+ return Result.passed(0);
}
logInfo("Percent of gesture in proximity: " + mPercentNear);
if (mPercentNear > mPercentCoveredThreshold) {
- return !mDistanceClassifier.isLongSwipe();
+ Result longSwipeResult = mDistanceClassifier.isLongSwipe();
+ return longSwipeResult.isFalse()
+ ? Result.falsed(0.5, getReason(longSwipeResult)) : Result.passed(0.5);
}
- return false;
+ return Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason(Result longSwipeResult) {
return String.format(
(Locale) null,
"{percentInProximity=%f, threshold=%f, distanceClassifier=%s}",
mPercentNear,
mPercentCoveredThreshold,
- mDistanceClassifier.getReason());
+ longSwipeResult.getReason());
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java
index 6b7a141..f2622ec 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java
@@ -30,7 +30,6 @@
*/
public class SingleTapClassifier extends FalsingClassifier {
private final float mTouchSlop;
- private String mReason;
@Inject
SingleTapClassifier(FalsingDataProvider dataProvider,
@@ -40,36 +39,31 @@
}
@Override
- boolean isFalseTouch() {
- return !isTap(getRecentMotionEvents());
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
+ return isTap(getRecentMotionEvents());
}
/** Given a list of {@link android.view.MotionEvent}'s, returns true if the look like a tap. */
- public boolean isTap(List<MotionEvent> motionEvents) {
+ public Result isTap(List<MotionEvent> motionEvents) {
float downX = motionEvents.get(0).getX();
float downY = motionEvents.get(0).getY();
for (MotionEvent event : motionEvents) {
+ String reason;
if (Math.abs(event.getX() - downX) >= mTouchSlop) {
- mReason = "dX too big for a tap: "
+ reason = "dX too big for a tap: "
+ Math.abs(event.getX() - downX)
+ "vs "
+ mTouchSlop;
- return false;
+ return Result.falsed(0.5, reason);
} else if (Math.abs(event.getY() - downY) >= mTouchSlop) {
- mReason = "dY too big for a tap: "
+ reason = "dY too big for a tap: "
+ Math.abs(event.getY() - downY)
+ "vs "
+ mTouchSlop;
- return false;
+ return Result.falsed(0.5, reason);
}
}
- mReason = "";
- return true;
- }
-
- @Override
- String getReason() {
- return mReason;
+ return Result.passed(0);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java
index 711a0fc..d470d62 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java
@@ -38,32 +38,40 @@
}
@Override
- public boolean isFalseTouch() {
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
boolean vertical = isVertical();
boolean up = isUp();
boolean right = isRight();
+ boolean wrongDirection = true;
switch (getInteractionType()) {
case QUICK_SETTINGS:
case PULSE_EXPAND:
case NOTIFICATION_DRAG_DOWN:
- return !vertical || up;
+ wrongDirection = !vertical || up;
+ break;
case NOTIFICATION_DISMISS:
- return vertical;
+ wrongDirection = vertical;
+ break;
case UNLOCK:
case BOUNCER_UNLOCK:
- return !vertical || !up;
+ wrongDirection = !vertical || !up;
+ break;
case LEFT_AFFORDANCE: // Swiping from the bottom left corner for camera or similar.
- return !right || !up;
+ wrongDirection = !right || !up;
+ break;
case RIGHT_AFFORDANCE: // Swiping from the bottom right corner for camera or similar.
- return right || !up;
+ wrongDirection = right || !up;
+ break;
default:
- return true;
+ wrongDirection = true;
+ break;
}
+
+ return wrongDirection ? Result.falsed(1, getReason()) : Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason() {
return String.format("{vertical=%s, up=%s, right=%s}", isVertical(), isUp(), isRight());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java
index 383dda4..2bfb218 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java
@@ -84,7 +84,7 @@
}
@Override
- boolean isFalseTouch() {
+ Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
List<MotionEvent> motionEvents = getRecentMotionEvents();
// Rotate horizontal gestures to be horizontal between their first and last point.
// Rotate vertical gestures to be vertical between their first and last point.
@@ -95,7 +95,7 @@
// For vertical lines, the difference in the y direction should be small.
if (motionEvents.size() < 3) {
- return false;
+ return Result.passed(0);
}
List<Point> rotatedPoints;
@@ -155,11 +155,11 @@
logDebug("Straightness Deviance: (" + devianceX + "," + devianceY + ") vs "
+ "(" + maxXDeviance + "," + maxYDeviance + ")");
- return devianceX > maxXDeviance || devianceY > maxYDeviance;
+ return devianceX > maxXDeviance || devianceY > maxYDeviance
+ ? Result.falsed(0.5, getReason()) : Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason() {
return String.format(
(Locale) null,
"{devianceX=%f, maxDevianceX=%s, devianceY=%s, maxDevianceY=%s}",
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt
index 0e4f684..9d92a40 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt
@@ -37,6 +37,7 @@
import android.service.controls.templates.RangeTemplate
import android.service.controls.templates.StatelessTemplate
import android.service.controls.templates.TemperatureControlTemplate
+import android.service.controls.templates.ThumbnailTemplate
import android.service.controls.templates.ToggleRangeTemplate
import android.service.controls.templates.ToggleTemplate
import android.util.MathUtils
@@ -87,8 +88,11 @@
): KClass<out Behavior> {
return when {
status != Control.STATUS_OK -> StatusBehavior::class
- deviceType == DeviceTypes.TYPE_CAMERA -> TouchBehavior::class
template == ControlTemplate.NO_TEMPLATE -> TouchBehavior::class
+ template is ThumbnailTemplate -> ThumbnailBehavior::class
+
+ // Required for legacy support, or where cameras do not use the new template
+ deviceType == DeviceTypes.TYPE_CAMERA -> TouchBehavior::class
template is ToggleTemplate -> ToggleBehavior::class
template is StatelessTemplate -> TouchBehavior::class
template is ToggleRangeTemplate -> ToggleRangeBehavior::class
@@ -105,7 +109,7 @@
private var statusAnimator: Animator? = null
private val baseLayer: GradientDrawable
val icon: ImageView = layout.requireViewById(R.id.icon)
- private val status: TextView = layout.requireViewById(R.id.status)
+ val status: TextView = layout.requireViewById(R.id.status)
private var nextStatusText: CharSequence = ""
val title: TextView = layout.requireViewById(R.id.title)
val subtitle: TextView = layout.requireViewById(R.id.subtitle)
@@ -132,7 +136,6 @@
val ld = layout.getBackground() as LayerDrawable
ld.mutate()
clipLayer = ld.findDrawableByLayerId(R.id.clip_layer) as ClipDrawable
- clipLayer.alpha = ALPHA_DISABLED
baseLayer = ld.findDrawableByLayerId(R.id.background) as GradientDrawable
// needed for marquee to start
status.setSelected(true)
@@ -315,7 +318,9 @@
)
}
- (clipLayer.getDrawable() as GradientDrawable).apply {
+ clipLayer.getDrawable().apply {
+ clipLayer.alpha = ALPHA_DISABLED
+
val newBaseColor = if (behavior is ToggleRangeBehavior) {
ColorUtils.blendARGB(bg, newClipColor, toggleBackgroundIntensity)
} else {
@@ -323,15 +328,25 @@
}
stateAnimator?.cancel()
if (animated) {
- val oldColor = color?.defaultColor ?: newClipColor
+ val oldColor = if (this is GradientDrawable) {
+ this.color?.defaultColor ?: newClipColor
+ } else {
+ newClipColor
+ }
val oldBaseColor = baseLayer.color?.defaultColor ?: newBaseColor
val oldAlpha = layout.alpha
+
+ // Animate both alpha and background colors. Only animate colors for
+ // GradientDrawables and not static images as used for the ThumbnailTemplate.
stateAnimator = ValueAnimator.ofInt(clipLayer.alpha, newAlpha).apply {
addUpdateListener {
alpha = it.animatedValue as Int
- setColor(ColorUtils.blendARGB(oldColor, newClipColor, it.animatedFraction))
- baseLayer.setColor(ColorUtils.blendARGB(oldBaseColor,
- newBaseColor, it.animatedFraction))
+ if (this is GradientDrawable) {
+ this.setColor(ColorUtils.blendARGB(oldColor, newClipColor,
+ it.animatedFraction))
+ }
+ baseLayer.setColor(ColorUtils.blendARGB(oldBaseColor, newBaseColor,
+ it.animatedFraction))
layout.alpha = MathUtils.lerp(oldAlpha, 1f, it.animatedFraction)
}
addListener(object : AnimatorListenerAdapter() {
@@ -345,7 +360,9 @@
}
} else {
alpha = newAlpha
- setColor(newClipColor)
+ if (this is GradientDrawable) {
+ this.setColor(newClipColor)
+ }
baseLayer.setColor(newBaseColor)
layout.alpha = 1f
}
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt
index 3f17a4f..ad2b785 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/RenderInfo.kt
@@ -92,7 +92,9 @@
(THERMOSTAT_RANGE + TemperatureControlTemplate.MODE_COOL) to
Pair(R.color.thermo_cool_foreground, R.color.control_enabled_thermo_cool_background),
DeviceTypes.TYPE_LIGHT
- to Pair(R.color.light_foreground, R.color.control_enabled_light_background)
+ to Pair(R.color.light_foreground, R.color.control_enabled_light_background),
+ DeviceTypes.TYPE_CAMERA
+ to Pair(R.color.camera_foreground, R.color.control_enabled_default_background)
).withDefault {
Pair(R.color.control_foreground, R.color.control_enabled_default_background)
}
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt
new file mode 100644
index 0000000..c2168aa
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ThumbnailBehavior.kt
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2020 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.systemui.controls.ui
+
+import android.graphics.BlendMode
+import android.graphics.BlendModeColorFilter
+import android.graphics.drawable.ClipDrawable
+import android.graphics.drawable.LayerDrawable
+import android.view.View
+import android.service.controls.Control
+import android.service.controls.templates.ThumbnailTemplate
+import android.util.TypedValue
+
+import com.android.systemui.R
+import com.android.systemui.controls.ui.ControlViewHolder.Companion.MAX_LEVEL
+import com.android.systemui.controls.ui.ControlViewHolder.Companion.MIN_LEVEL
+
+/**
+ * Supports display of static images on the background of the tile. When marked active, the title
+ * and subtitle will not be visible. To be used with {@link Thumbnailtemplate} only.
+ */
+class ThumbnailBehavior : Behavior {
+ lateinit var template: ThumbnailTemplate
+ lateinit var control: Control
+ lateinit var cvh: ControlViewHolder
+ private var shadowOffsetX: Float = 0f
+ private var shadowOffsetY: Float = 0f
+ private var shadowRadius: Float = 0f
+ private var shadowColor: Int = 0
+
+ private val enabled: Boolean
+ get() = template.isActive()
+
+ override fun initialize(cvh: ControlViewHolder) {
+ this.cvh = cvh
+
+ val outValue = TypedValue()
+ cvh.context.resources.getValue(R.dimen.controls_thumbnail_shadow_x, outValue, true)
+ shadowOffsetX = outValue.getFloat()
+
+ cvh.context.resources.getValue(R.dimen.controls_thumbnail_shadow_y, outValue, true)
+ shadowOffsetY = outValue.getFloat()
+
+ cvh.context.resources.getValue(R.dimen.controls_thumbnail_shadow_radius, outValue, true)
+ shadowRadius = outValue.getFloat()
+
+ shadowColor = cvh.context.resources.getColor(R.color.control_thumbnail_shadow_color)
+ cvh.layout.setOnClickListener(View.OnClickListener() {
+ cvh.controlActionCoordinator.touch(cvh, template.getTemplateId(), control)
+ })
+ }
+
+ override fun bind(cws: ControlWithState, colorOffset: Int) {
+ this.control = cws.control!!
+ cvh.setStatusText(control.getStatusText())
+ template = control.getControlTemplate() as ThumbnailTemplate
+
+ val ld = cvh.layout.getBackground() as LayerDrawable
+ val clipLayer = ld.findDrawableByLayerId(R.id.clip_layer) as ClipDrawable
+
+ clipLayer.setLevel(if (enabled) MAX_LEVEL else MIN_LEVEL)
+
+ if (template.isActive()) {
+ cvh.title.visibility = View.INVISIBLE
+ cvh.subtitle.visibility = View.INVISIBLE
+ cvh.status.setShadowLayer(shadowOffsetX, shadowOffsetY, shadowRadius, shadowColor)
+
+ cvh.bgExecutor.execute {
+ val drawable = template.getThumbnail().loadDrawable(cvh.context)
+ cvh.uiExecutor.execute {
+ val radius = cvh.context.getResources()
+ .getDimensionPixelSize(R.dimen.control_corner_radius).toFloat()
+ clipLayer.setDrawable(CornerDrawable(drawable, radius))
+ clipLayer.setColorFilter(BlendModeColorFilter(cvh.context.resources
+ .getColor(R.color.control_thumbnail_tint), BlendMode.LUMINOSITY))
+ cvh.applyRenderInfo(enabled, colorOffset)
+ }
+ }
+ } else {
+ cvh.title.visibility = View.VISIBLE
+ cvh.subtitle.visibility = View.VISIBLE
+ cvh.status.setShadowLayer(0f, 0f, 0f, shadowColor)
+ }
+
+ cvh.applyRenderInfo(enabled, colorOffset)
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
index f470a6b..c26cc44 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
@@ -298,6 +298,22 @@
mLogger.logDozeSuppressed(suppressedState);
}
+ /**
+ * Appends new AOD sreen brightness to logs
+ * @param brightness display brightness setting
+ */
+ public void traceDozeScreenBrightness(int brightness) {
+ mLogger.logDozeScreenBrightness(brightness);
+ }
+
+ /**
+ * Appends new AOD dimming scrim opacity to logs
+ * @param scrimOpacity
+ */
+ public void traceSetAodDimmingScrim(float scrimOpacity) {
+ mLogger.logSetAodDimmingScrim((long) scrimOpacity);
+ }
+
private class SummaryStats {
private int mCount;
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt b/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt
index 0c9e143..fddefae 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLogger.kt
@@ -226,6 +226,22 @@
"Doze state suppressed, state=$str1"
})
}
+
+ fun logDozeScreenBrightness(brightness: Int) {
+ buffer.log(TAG, INFO, {
+ int1 = brightness
+ }, {
+ "Doze screen brightness set, brightness=$int1"
+ })
+ }
+
+ fun logSetAodDimmingScrim(scrimOpacity: Long) {
+ buffer.log(TAG, INFO, {
+ long1 = scrimOpacity
+ }, {
+ "Doze aod dimming scrim opacity set, opacity=$long1"
+ })
+ }
}
private const val TAG = "DozeLog"
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java
index ebfce66..c542e5b 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java
@@ -34,6 +34,7 @@
import android.os.UserHandle;
import android.provider.Settings;
import android.text.TextUtils;
+import android.util.IndentingPrintWriter;
import android.util.Log;
import android.view.Display;
@@ -79,6 +80,7 @@
private long mDebounceFrom;
private boolean mSettingRegistered;
private boolean mListening;
+ private boolean mListeningTouchScreenSensors;
@VisibleForTesting
public enum DozeSensorsUiEvent implements UiEventLogger.UiEventEnum {
@@ -232,22 +234,25 @@
/**
* If sensors should be registered and sending signals.
*/
- public void setListening(boolean listen) {
- if (mListening == listen) {
+ public void setListening(boolean listen, boolean includeTouchScreenSensors) {
+ if (mListening == listen && mListeningTouchScreenSensors == includeTouchScreenSensors) {
return;
}
mListening = listen;
+ mListeningTouchScreenSensors = includeTouchScreenSensors;
updateListening();
}
/**
* Registers/unregisters sensors based on internal state.
*/
- public void updateListening() {
+ private void updateListening() {
boolean anyListening = false;
for (TriggerSensor s : mSensors) {
- s.setListening(mListening);
- if (mListening) {
+ boolean listen = mListening
+ && (!s.mRequiresTouchscreen || mListeningTouchScreenSensors);
+ s.setListening(listen);
+ if (listen) {
anyListening = true;
}
}
@@ -319,10 +324,14 @@
/** Dump current state */
public void dump(PrintWriter pw) {
+ pw.println("mListening=" + mListening);
+ pw.println("mListeningTouchScreenSensors=" + mListeningTouchScreenSensors);
+ IndentingPrintWriter idpw = new IndentingPrintWriter(pw);
+ idpw.increaseIndent();
for (TriggerSensor s : mSensors) {
- pw.println(" Sensor: " + s.toString());
+ idpw.println("Sensor: " + s.toString());
}
- pw.println(" ProxSensor: " + mProximitySensor.toString());
+ idpw.println("ProxSensor: " + mProximitySensor.toString());
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
index 6888d1ad..c617f3d 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
@@ -29,6 +29,7 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.text.format.Formatter;
+import android.util.IndentingPrintWriter;
import android.util.Log;
import android.view.Display;
@@ -434,15 +435,12 @@
break;
case DOZE_PULSE_DONE:
mDozeSensors.requestTemporaryDisable();
- // A pulse will temporarily disable sensors that require a touch screen.
- // Let's make sure that they are re-enabled when the pulse is over.
- mDozeSensors.updateListening();
break;
case FINISH:
mBroadcastReceiver.unregister(mBroadcastDispatcher);
mDozeHost.removeCallback(mHostCallback);
mDockManager.removeListener(mDockEventListener);
- mDozeSensors.setListening(false);
+ mDozeSensors.setListening(false, false);
mDozeSensors.setProxListening(false);
mWantSensors = false;
mWantProx = false;
@@ -450,20 +448,16 @@
break;
default:
}
+ mDozeSensors.setListening(mWantSensors, mWantTouchScreenSensors);
}
@Override
public void onScreenState(int state) {
mDozeSensors.onScreenState(state);
- if (state == Display.STATE_DOZE || state == Display.STATE_DOZE_SUSPEND
- || state == Display.STATE_OFF) {
- mDozeSensors.setProxListening(mWantProx);
- mDozeSensors.setListening(mWantSensors);
- mDozeSensors.setTouchscreenSensorsListening(mWantTouchScreenSensors);
- } else {
- mDozeSensors.setProxListening(false);
- mDozeSensors.setListening(mWantSensors);
- }
+ mDozeSensors.setProxListening(mWantProx && (state == Display.STATE_DOZE
+ || state == Display.STATE_DOZE_SUSPEND
+ || state == Display.STATE_OFF));
+ mDozeSensors.setListening(mWantSensors, mWantTouchScreenSensors);
}
private void checkTriggersAtInit() {
@@ -539,7 +533,9 @@
pw.println(" pulsePending=" + mPulsePending);
pw.println("DozeSensors:");
- mDozeSensors.dump(pw);
+ IndentingPrintWriter idpw = new IndentingPrintWriter(pw);
+ idpw.increaseIndent();
+ mDozeSensors.dump(idpw);
}
private class TriggerReceiver extends BroadcastReceiver {
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index 9c90510..ad4c447 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -50,6 +50,7 @@
import android.content.SharedPreferences;
import android.content.pm.UserInfo;
import android.content.res.ColorStateList;
+import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.Color;
@@ -256,6 +257,7 @@
private UserContextProvider mUserContextProvider;
@VisibleForTesting
boolean mShowLockScreenCardsAndControls = false;
+ private int mSmallestScreenWidthDp;
@VisibleForTesting
public enum GlobalActionsEvent implements UiEventLogger.UiEventEnum {
@@ -344,6 +346,7 @@
mSysUiState = sysUiState;
mMainHandler = handler;
mUserContextProvider = userContextProvider;
+ mSmallestScreenWidthDp = mContext.getResources().getConfiguration().smallestScreenWidthDp;
// receive broadcasts
IntentFilter filter = new IntentFilter();
@@ -760,6 +763,15 @@
}
}
+ @Override
+ public void onConfigChanged(Configuration newConfig) {
+ if (mDialog != null && mDialog.isShowing()
+ && (newConfig.smallestScreenWidthDp != mSmallestScreenWidthDp)) {
+ mSmallestScreenWidthDp = newConfig.smallestScreenWidthDp;
+ mDialog.refreshDialog();
+ }
+ }
+
public void destroy() {
mConfigurationController.removeCallback(this);
}
@@ -2230,6 +2242,9 @@
return;
}
+ boolean isLandscapeWalletViewShown = mContext.getResources().getBoolean(
+ com.android.systemui.R.bool.global_actions_show_landscape_wallet_view);
+
int rotation = RotationUtils.getRotation(mContext);
boolean rotationLocked = RotationPolicy.isRotationLocked(mContext);
if (rotation != RotationUtils.ROTATION_NONE) {
@@ -2246,6 +2261,10 @@
mGlobalActionsLayout.post(() ->
RotationPolicy.setRotationLockAtAngle(
mContext, false, RotationUtils.ROTATION_NONE));
+
+ if (!isLandscapeWalletViewShown) {
+ return;
+ }
}
} else {
if (!rotationLocked) {
@@ -2253,44 +2272,48 @@
mResetOrientationData = new ResetOrientationData();
mResetOrientationData.locked = false;
}
+ }
- // Lock to portrait, so the user doesn't accidentally hide the panel.
+ boolean shouldLockRotation = !isLandscapeWalletViewShown;
+ if (rotationLocked != shouldLockRotation) {
+ // Locks the screen to portrait if the landscape / seascape orientation does not
+ // show the wallet view, so the user doesn't accidentally hide the panel.
// This call is posted so that the rotation does not change until post-layout,
// otherwise onConfigurationChanged() may not get invoked.
mGlobalActionsLayout.post(() ->
RotationPolicy.setRotationLockAtAngle(
- mContext, true, RotationUtils.ROTATION_NONE));
+ mContext, shouldLockRotation, RotationUtils.ROTATION_NONE));
}
+ }
- // Disable rotation suggestions, if enabled
- setRotationSuggestionsEnabled(false);
+ // Disable rotation suggestions, if enabled
+ setRotationSuggestionsEnabled(false);
- FrameLayout panelContainer =
- findViewById(com.android.systemui.R.id.global_actions_wallet);
- FrameLayout.LayoutParams panelParams =
- new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT);
- if (!mControlsAvailable) {
- panelParams.topMargin = mContext.getResources().getDimensionPixelSize(
- com.android.systemui.R.dimen.global_actions_wallet_top_margin);
- }
- View walletView = mWalletViewController.getPanelContent();
- panelContainer.addView(walletView, panelParams);
- // Smooth transitions when wallet is resized, which can happen when a card is added
- ViewGroup root = findViewById(com.android.systemui.R.id.global_actions_grid_root);
- if (root != null) {
- walletView.addOnLayoutChangeListener((v, l, t, r, b, ol, ot, or, ob) -> {
- int oldHeight = ob - ot;
- int newHeight = b - t;
- if (oldHeight > 0 && oldHeight != newHeight) {
- TransitionSet transition = new AutoTransition()
- .setDuration(250)
- .setOrdering(TransitionSet.ORDERING_TOGETHER);
- TransitionManager.beginDelayedTransition(root, transition);
- }
- });
- }
+ FrameLayout panelContainer =
+ findViewById(com.android.systemui.R.id.global_actions_wallet);
+ FrameLayout.LayoutParams panelParams =
+ new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT);
+ if (!mControlsAvailable) {
+ panelParams.topMargin = mContext.getResources().getDimensionPixelSize(
+ com.android.systemui.R.dimen.global_actions_wallet_top_margin);
+ }
+ View walletView = mWalletViewController.getPanelContent();
+ panelContainer.addView(walletView, panelParams);
+ // Smooth transitions when wallet is resized, which can happen when a card is added
+ ViewGroup root = findViewById(com.android.systemui.R.id.global_actions_grid_root);
+ if (root != null) {
+ walletView.addOnLayoutChangeListener((v, l, t, r, b, ol, ot, or, ob) -> {
+ int oldHeight = ob - ot;
+ int newHeight = b - t;
+ if (oldHeight > 0 && oldHeight != newHeight) {
+ TransitionSet transition = new AutoTransition()
+ .setDuration(250)
+ .setOrdering(TransitionSet.ORDERING_TOGETHER);
+ TransitionManager.beginDelayedTransition(root, transition);
+ }
+ });
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
index a330be6..ce5795c 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
@@ -103,7 +103,7 @@
d.setOnShowListener(dialog -> {
if (mBlurUtils.supportsBlursOnWindows()) {
- background.setAlpha((int) (ScrimController.BLUR_SCRIM_ALPHA * 255));
+ background.setAlpha((int) (ScrimController.BUSY_SCRIM_ALPHA * 255));
mBlurUtils.applyBlur(d.getWindow().getDecorView().getViewRootImpl(),
mBlurUtils.blurRadiusOfRatio(1));
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
index 451bd42..9e25389 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
@@ -24,6 +24,7 @@
import android.graphics.drawable.Icon;
import android.media.MediaMetadata;
import android.media.MediaRoute2Info;
+import android.media.MediaRouter2Manager;
import android.media.RoutingSessionInfo;
import android.media.session.MediaController;
import android.media.session.MediaSessionManager;
@@ -37,6 +38,7 @@
import androidx.annotation.VisibleForTesting;
import androidx.core.graphics.drawable.IconCompat;
+import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.Utils;
import com.android.settingslib.bluetooth.BluetoothUtils;
@@ -75,6 +77,7 @@
private final List<MediaDevice> mGroupMediaDevices = new CopyOnWriteArrayList<>();
private final boolean mAboveStatusbar;
private final NotificationEntryManager mNotificationEntryManager;
+ private final MediaRouter2Manager mRouterManager;
@VisibleForTesting
final List<MediaDevice> mMediaDevices = new CopyOnWriteArrayList<>();
@@ -84,11 +87,14 @@
@VisibleForTesting
LocalMediaManager mLocalMediaManager;
+ private MediaOutputMetricLogger mMetricLogger;
+ private UiEventLogger mUiEventLogger;
+
@Inject
public MediaOutputController(@NonNull Context context, String packageName,
boolean aboveStatusbar, MediaSessionManager mediaSessionManager, LocalBluetoothManager
lbm, ShadeController shadeController, ActivityStarter starter,
- NotificationEntryManager notificationEntryManager) {
+ NotificationEntryManager notificationEntryManager, UiEventLogger uiEventLogger) {
mContext = context;
mPackageName = packageName;
mMediaSessionManager = mediaSessionManager;
@@ -98,6 +104,9 @@
mNotificationEntryManager = notificationEntryManager;
InfoMediaManager imm = new InfoMediaManager(mContext, packageName, null, lbm);
mLocalMediaManager = new LocalMediaManager(mContext, lbm, imm, packageName);
+ mMetricLogger = new MediaOutputMetricLogger(mContext, mPackageName);
+ mUiEventLogger = uiEventLogger;
+ mRouterManager = MediaRouter2Manager.getInstance(mContext);
}
void start(@NonNull Callback cb) {
@@ -128,6 +137,7 @@
mLocalMediaManager.stopScan();
mLocalMediaManager.registerCallback(this);
mLocalMediaManager.startScan();
+ mRouterManager.startScan();
}
void stop() {
@@ -138,6 +148,9 @@
mLocalMediaManager.unregisterCallback(this);
mLocalMediaManager.stopScan();
}
+ if (mRouterManager != null) {
+ mRouterManager.stopScan();
+ }
mMediaDevices.clear();
}
@@ -151,6 +164,7 @@
public void onSelectedDeviceStateChanged(MediaDevice device,
@LocalMediaManager.MediaDeviceState int state) {
mCallback.onRouteChanged();
+ mMetricLogger.logOutputSuccess(device.toString(), mMediaDevices);
}
@Override
@@ -161,6 +175,7 @@
@Override
public void onRequestFailed(int reason) {
mCallback.onRouteChanged();
+ mMetricLogger.logOutputFailure(mMediaDevices, reason);
}
CharSequence getHeaderTitle() {
@@ -311,6 +326,8 @@
}
void connectDevice(MediaDevice device) {
+ mMetricLogger.updateOutputEndPoints(getCurrentConnectedMediaDevice(), device);
+
ThreadUtils.postOnBackgroundThread(() -> {
mLocalMediaManager.connectDevice(device);
});
@@ -439,7 +456,7 @@
void launchMediaOutputDialog() {
mCallback.dismissDialog();
- new MediaOutputDialog(mContext, mAboveStatusbar, this);
+ new MediaOutputDialog(mContext, mAboveStatusbar, this, mUiEventLogger);
}
void launchMediaOutputGroupDialog() {
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java
index a892a12..53029bd0 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialog.java
@@ -23,6 +23,9 @@
import androidx.core.graphics.drawable.IconCompat;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.logging.UiEvent;
+import com.android.internal.logging.UiEventLogger;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
@@ -31,10 +34,12 @@
*/
@SysUISingleton
public class MediaOutputDialog extends MediaOutputBaseDialog {
+ final UiEventLogger mUiEventLogger;
MediaOutputDialog(Context context, boolean aboveStatusbar, MediaOutputController
- mediaOutputController) {
+ mediaOutputController, UiEventLogger uiEventLogger) {
super(context, mediaOutputController);
+ mUiEventLogger = uiEventLogger;
mAdapter = new MediaOutputAdapter(mMediaOutputController);
if (!aboveStatusbar) {
getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);
@@ -45,6 +50,7 @@
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ mUiEventLogger.log(MediaOutputEvent.MEDIA_OUTPUT_DIALOG_SHOW);
}
@Override
@@ -78,4 +84,21 @@
return mMediaOutputController.isActiveRemoteDevice(
mMediaOutputController.getCurrentConnectedMediaDevice()) ? View.VISIBLE : View.GONE;
}
+
+ @VisibleForTesting
+ public enum MediaOutputEvent implements UiEventLogger.UiEventEnum {
+ @UiEvent(doc = "The MediaOutput dialog became visible on the screen.")
+ MEDIA_OUTPUT_DIALOG_SHOW(655);
+
+ private final int mId;
+
+ MediaOutputEvent(int id) {
+ mId = id;
+ }
+
+ @Override
+ public int getId() {
+ return mId;
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt
index 7d1a7ce..0f340a5 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogFactory.kt
@@ -18,6 +18,7 @@
import android.content.Context
import android.media.session.MediaSessionManager
+import com.android.internal.logging.UiEventLogger
import com.android.settingslib.bluetooth.LocalBluetoothManager
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.statusbar.notification.NotificationEntryManager
@@ -33,7 +34,8 @@
private val lbm: LocalBluetoothManager?,
private val shadeController: ShadeController,
private val starter: ActivityStarter,
- private val notificationEntryManager: NotificationEntryManager
+ private val notificationEntryManager: NotificationEntryManager,
+ private val uiEventLogger: UiEventLogger
) {
companion object {
var mediaOutputDialog: MediaOutputDialog? = null
@@ -43,8 +45,10 @@
fun create(packageName: String, aboveStatusBar: Boolean) {
mediaOutputDialog?.dismiss()
mediaOutputDialog = MediaOutputController(context, packageName, aboveStatusBar,
- mediaSessionManager, lbm, shadeController, starter, notificationEntryManager).run {
- MediaOutputDialog(context, aboveStatusBar, this) }
+ mediaSessionManager, lbm, shadeController, starter, notificationEntryManager,
+ uiEventLogger).run {
+ MediaOutputDialog(context, aboveStatusBar, this, uiEventLogger)
+ }
}
/** dismiss [MediaOutputDialog] if exist. */
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
new file mode 100644
index 0000000..ac0295e
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2020 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.systemui.media.dialog;
+
+import static android.media.MediaRoute2ProviderService.REASON_INVALID_COMMAND;
+import static android.media.MediaRoute2ProviderService.REASON_NETWORK_ERROR;
+import static android.media.MediaRoute2ProviderService.REASON_REJECTED;
+import static android.media.MediaRoute2ProviderService.REASON_ROUTE_NOT_AVAILABLE;
+import static android.media.MediaRoute2ProviderService.REASON_UNKNOWN_ERROR;
+
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.util.Log;
+
+import com.android.settingslib.media.MediaDevice;
+import com.android.systemui.shared.system.SysUiStatsLog;
+
+import java.util.List;
+
+/**
+ * Metric logger for media output features
+ */
+public class MediaOutputMetricLogger {
+
+ private static final String TAG = "MediaOutputMetricLogger";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+
+ private final Context mContext;
+ private final String mPackageName;
+ private MediaDevice mSourceDevice, mTargetDevice;
+ private int mWiredDeviceCount;
+ private int mConnectedBluetoothDeviceCount;
+ private int mRemoteDeviceCount;
+ private int mAppliedDeviceCountWithinRemoteGroup;
+
+ public MediaOutputMetricLogger(Context context, String packageName) {
+ mContext = context;
+ mPackageName = packageName;
+ }
+
+ /**
+ * Update the endpoints of a content switching operation.
+ * This method should be called before a switching operation, so the metric logger can track
+ * source and target devices.
+ * @param source the current connected media device
+ * @param target the target media device for content switching to
+ */
+ public void updateOutputEndPoints(MediaDevice source, MediaDevice target) {
+ mSourceDevice = source;
+ mTargetDevice = target;
+
+ if (DEBUG) {
+ Log.d(TAG, "updateOutputEndPoints -"
+ + " source:" + mSourceDevice.toString()
+ + " target:" + mTargetDevice.toString());
+ }
+ }
+
+ /**
+ * Do the metric logging of content switching success.
+ * @param selectedDeviceType string representation of the target media device
+ * @param deviceList media device list for device count updating
+ */
+ public void logOutputSuccess(String selectedDeviceType, List<MediaDevice> deviceList) {
+ if (DEBUG) {
+ Log.d(TAG, "logOutputSuccess - selected device: " + selectedDeviceType);
+ }
+
+ updateLoggingDeviceCount(deviceList);
+
+ SysUiStatsLog.write(
+ SysUiStatsLog.MEDIAOUTPUT_OP_SWITCH_REPORTED,
+ getLoggingDeviceType(mSourceDevice, true),
+ getLoggingDeviceType(mTargetDevice, false),
+ SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__RESULT__OK,
+ SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SUBRESULT__NO_ERROR,
+ getLoggingPackageName(),
+ mWiredDeviceCount,
+ mConnectedBluetoothDeviceCount,
+ mRemoteDeviceCount,
+ mAppliedDeviceCountWithinRemoteGroup);
+ }
+
+ /**
+ * Do the metric logging of content switching failure.
+ * @param deviceList media device list for device count updating
+ * @param reason the reason of content switching failure
+ */
+ public void logOutputFailure(List<MediaDevice> deviceList, int reason) {
+ if (DEBUG) {
+ Log.e(TAG, "logRequestFailed - " + reason);
+ }
+
+ updateLoggingDeviceCount(deviceList);
+
+ SysUiStatsLog.write(
+ SysUiStatsLog.MEDIAOUTPUT_OP_SWITCH_REPORTED,
+ getLoggingDeviceType(mSourceDevice, true),
+ getLoggingDeviceType(mTargetDevice, false),
+ SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__RESULT__ERROR,
+ getLoggingSwitchOpSubResult(reason),
+ getLoggingPackageName(),
+ mWiredDeviceCount,
+ mConnectedBluetoothDeviceCount,
+ mRemoteDeviceCount,
+ mAppliedDeviceCountWithinRemoteGroup);
+ }
+
+ private void updateLoggingDeviceCount(List<MediaDevice> deviceList) {
+ mWiredDeviceCount = mConnectedBluetoothDeviceCount = mRemoteDeviceCount = 0;
+ mAppliedDeviceCountWithinRemoteGroup = 0;
+
+ for (MediaDevice mediaDevice : deviceList) {
+ if (mediaDevice.isConnected()) {
+ switch (mediaDevice.getDeviceType()) {
+ case MediaDevice.MediaDeviceType.TYPE_3POINT5_MM_AUDIO_DEVICE:
+ case MediaDevice.MediaDeviceType.TYPE_USB_C_AUDIO_DEVICE:
+ mWiredDeviceCount++;
+ break;
+ case MediaDevice.MediaDeviceType.TYPE_BLUETOOTH_DEVICE:
+ mConnectedBluetoothDeviceCount++;
+ break;
+ case MediaDevice.MediaDeviceType.TYPE_CAST_DEVICE:
+ case MediaDevice.MediaDeviceType.TYPE_CAST_GROUP_DEVICE:
+ mRemoteDeviceCount++;
+ break;
+ default:
+ }
+ }
+ }
+
+ if (DEBUG) {
+ Log.d(TAG, "connected devices:" + " wired: " + mWiredDeviceCount
+ + " bluetooth: " + mConnectedBluetoothDeviceCount
+ + " remote: " + mRemoteDeviceCount);
+ }
+ }
+
+ private int getLoggingDeviceType(MediaDevice device, boolean isSourceDevice) {
+ switch (device.getDeviceType()) {
+ case MediaDevice.MediaDeviceType.TYPE_PHONE_DEVICE:
+ return isSourceDevice
+ ? SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SOURCE__BUILTIN_SPEAKER
+ : SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__TARGET__BUILTIN_SPEAKER;
+ case MediaDevice.MediaDeviceType.TYPE_3POINT5_MM_AUDIO_DEVICE:
+ return isSourceDevice
+ ? SysUiStatsLog
+ .MEDIA_OUTPUT_OP_SWITCH_REPORTED__SOURCE__WIRED_3POINT5_MM_AUDIO
+ : SysUiStatsLog
+ .MEDIA_OUTPUT_OP_SWITCH_REPORTED__TARGET__WIRED_3POINT5_MM_AUDIO;
+ case MediaDevice.MediaDeviceType.TYPE_USB_C_AUDIO_DEVICE:
+ return isSourceDevice
+ ? SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SOURCE__USB_C_AUDIO
+ : SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__TARGET__USB_C_AUDIO;
+ case MediaDevice.MediaDeviceType.TYPE_BLUETOOTH_DEVICE:
+ return isSourceDevice
+ ? SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SOURCE__BLUETOOTH
+ : SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__TARGET__BLUETOOTH;
+ case MediaDevice.MediaDeviceType.TYPE_CAST_DEVICE:
+ return isSourceDevice
+ ? SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SOURCE__REMOTE_SINGLE
+ : SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__TARGET__REMOTE_SINGLE;
+ case MediaDevice.MediaDeviceType.TYPE_CAST_GROUP_DEVICE:
+ return isSourceDevice
+ ? SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SOURCE__REMOTE_GROUP
+ : SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__TARGET__REMOTE_GROUP;
+ default:
+ return isSourceDevice
+ ? SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SOURCE__UNKNOWN_TYPE
+ : SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__TARGET__UNKNOWN_TYPE;
+ }
+ }
+
+ private int getLoggingSwitchOpSubResult(int reason) {
+ switch (reason) {
+ case REASON_REJECTED:
+ return SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SUBRESULT__REJECTED;
+ case REASON_NETWORK_ERROR:
+ return SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SUBRESULT__NETWORK_ERROR;
+ case REASON_ROUTE_NOT_AVAILABLE:
+ return SysUiStatsLog
+ .MEDIA_OUTPUT_OP_SWITCH_REPORTED__SUBRESULT__ROUTE_NOT_AVAILABLE;
+ case REASON_INVALID_COMMAND:
+ return SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SUBRESULT__INVALID_COMMAND;
+ case REASON_UNKNOWN_ERROR:
+ default:
+ return SysUiStatsLog.MEDIA_OUTPUT_OP_SWITCH_REPORTED__SUBRESULT__UNKNOWN_ERROR;
+ }
+ }
+
+ private String getLoggingPackageName() {
+ if (mPackageName != null && !mPackageName.isEmpty()) {
+ try {
+ final ApplicationInfo applicationInfo = mContext.getPackageManager()
+ .getApplicationInfo(mPackageName, /* default flag */ 0);
+ if ((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
+ || (applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
+ return mPackageName;
+ }
+ } catch (Exception ex) {
+ Log.e(TAG, mPackageName + " is invalid.");
+ }
+ }
+
+ return "";
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java
index 5f3ceb1..bc9500a 100644
--- a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java
+++ b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java
@@ -21,7 +21,6 @@
import android.app.people.ConversationChannel;
import android.app.people.IPeopleManager;
import android.app.people.PeopleSpaceTile;
-import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
@@ -111,8 +110,6 @@
context, notificationManager,
mPeopleManager, mLauncherApps);
for (int appWidgetId : appWidgetIds) {
- RemoteViews views = new RemoteViews(context.getPackageName(),
- R.layout.people_space_widget_item);
String shortcutId = sp.getString(String.valueOf(appWidgetId), null);
if (DEBUG) {
Log.d(TAG, "Set widget: " + appWidgetId + " with shortcut ID: " + shortcutId);
@@ -122,11 +119,12 @@
e -> e.getValue().getId().equals(shortcutId)).findFirst();
if (!entry.isPresent() || shortcutId == null) {
if (DEBUG) Log.d(TAG, "Matching conversation not found for shortcut ID");
- AppWidgetHost host = new AppWidgetHost(context, 0);
- host.deleteAppWidgetId(appWidgetId);
+ //TODO: Delete app widget id when crash is fixed (b/175486868)
continue;
}
PeopleSpaceTile tile = entry.get().getValue();
+ RemoteViews views = new RemoteViews(context.getPackageName(),
+ getLayout(tile));
String status = PeopleSpaceUtils.getLastInteractionString(context,
entry.get().getKey());
@@ -158,6 +156,12 @@
}
}
+ /** Returns the layout ID for the {@code tile}. */
+ private static int getLayout(PeopleSpaceTile tile) {
+ return tile.getNotification() == null ? R.layout.people_space_large_avatar_tile :
+ R.layout.people_space_small_avatar_tile;
+ }
+
/** Returns a list sorted by ascending last interaction time from {@code stream}. */
private static List<Map.Entry<Long, PeopleSpaceTile>> getSortedTiles(
IPeopleManager peopleManager, Stream<PeopleSpaceTile> stream) {
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
index 87ffbd4..b2c2aa3 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyItemController.kt
@@ -262,8 +262,11 @@
privacyList = emptyList()
return
}
- val list = currentUserIds.flatMap { appOpsController.getActiveAppOpsForUser(it) }
- .mapNotNull { toPrivacyItem(it) }.distinct()
+ val list = appOpsController.getActiveAppOpsForUser(UserHandle.USER_ALL).filter {
+ UserHandle.getUserId(it.uid) in currentUserIds ||
+ it.code == AppOpsManager.OP_PHONE_CALL_MICROPHONE ||
+ it.code == AppOpsManager.OP_PHONE_CALL_CAMERA
+ }.mapNotNull { toPrivacyItem(it) }.distinct()
logger.logUpdatedPrivacyItemsList(
list.joinToString(separator = ", ", transform = PrivacyItem::toLog))
privacyList = list
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooter.java b/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooter.java
index 5afe526..3866382 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooter.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooter.java
@@ -143,8 +143,6 @@
}
public void showDeviceMonitoringDialog() {
- mHost.collapsePanels();
- // TODO: Delay dialog creation until after panels are collapsed.
createDialog();
}
@@ -291,6 +289,7 @@
if (which == DialogInterface.BUTTON_NEGATIVE) {
final Intent intent = new Intent(Settings.ACTION_ENTERPRISE_PRIVACY_SETTINGS);
mDialog.dismiss();
+ // This dismisses the shade on opening the activity
mActivityStarter.postStartActivityDismissingKeyguard(intent, 0);
}
}
@@ -605,6 +604,7 @@
public void onClick(View widget) {
final Intent intent = new Intent(Settings.ACTION_VPN_SETTINGS);
mDialog.dismiss();
+ // This dismisses the shade on opening the activity
mActivityStarter.postStartActivityDismissingKeyguard(intent, 0);
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
index c89f8e5..6074ef61 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
@@ -252,11 +252,9 @@
final int availableWidth = getMeasuredWidth() - getPaddingStart() - getPaddingEnd();
final int leftoverWhitespace = availableWidth - maxTiles * mCellWidth;
- final int smallestHorizontalMarginNeeded;
- smallestHorizontalMarginNeeded = leftoverWhitespace / Math.max(1, maxTiles - 1);
- if (smallestHorizontalMarginNeeded > 0){
- mCellMarginHorizontal = smallestHorizontalMarginNeeded;
+ if (leftoverWhitespace > 0) {
+ mCellMarginHorizontal = leftoverWhitespace / Math.max(1, maxTiles);
mColumns = maxTiles;
} else{
mColumns = mCellWidth == 0 ? 1 :
@@ -266,7 +264,7 @@
mCellMarginHorizontal = (availableWidth - mCellWidth) / 2;
} else {
mCellMarginHorizontal =
- (availableWidth - mColumns * mCellWidth) / (mColumns - 1);
+ (availableWidth - mColumns * mCellWidth) / mColumns;
}
}
@@ -310,7 +308,8 @@
// Only one column/tile. Use the margin to center the tile.
return getPaddingStart() + mCellMarginHorizontal;
}
- return getPaddingStart() + column * (mCellWidth + mCellMarginHorizontal);
+ return getPaddingStart() + mCellMarginHorizontal / 2
+ + column * (mCellWidth + mCellMarginHorizontal);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java
index 5c683f2..ef501c8 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java
@@ -133,7 +133,7 @@
mColorActive = Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent);
mColorDisabled = Utils.getDisabled(context,
- Utils.getColorAttrDefaultColor(context, android.R.attr.textColorTertiary));
+ Utils.getColorAttrDefaultColor(context, android.R.attr.colorControlActivated));
mColorInactive = Utils.getColorAttrDefaultColor(context, android.R.attr.textColorSecondary);
setPadding(0, 0, 0, 0);
diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSlider.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSlider.java
index 6c4f808..53ff1df 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSlider.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessSlider.java
@@ -17,6 +17,9 @@
package com.android.systemui.settings.brightness;
import android.content.Context;
+import android.graphics.drawable.ClipDrawable;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@@ -27,6 +30,7 @@
import androidx.annotation.Nullable;
import com.android.settingslib.RestrictedLockUtils;
+import com.android.settingslib.Utils;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
import com.android.systemui.util.ViewController;
@@ -269,14 +273,45 @@
private BrightnessSlider fromTree(ViewGroup root, boolean useMirror) {
BrightnessSliderView v = root.requireViewById(R.id.brightness_slider);
+
+ // TODO(175026098) Workaround. Remove when b/175026098 is fixed
+ applyTheme(v);
+
return new BrightnessSlider(root, v, useMirror);
}
/** Get the layout to inflate based on what slider to use */
- public int getLayout() {
+ private int getLayout() {
return mSettings.useThickSlider()
? R.layout.quick_settings_brightness_dialog_thick
: R.layout.quick_settings_brightness_dialog;
}
+
+ private LayerDrawable findProgressClippableDrawable(BrightnessSliderView v) {
+ SeekBar b = v.requireViewById(R.id.slider);
+ if (b.getProgressDrawable() instanceof LayerDrawable) {
+ Drawable progress = ((LayerDrawable) b.getProgressDrawable())
+ .findDrawableByLayerId(com.android.internal.R.id.progress);
+ if (progress instanceof ClipDrawable) {
+ Drawable inner = ((ClipDrawable) progress).getDrawable();
+ if (inner instanceof LayerDrawable) {
+ return (LayerDrawable) inner;
+ }
+ }
+ }
+ return null;
+ }
+
+ private void applyTheme(BrightnessSliderView v) {
+ LayerDrawable layer = findProgressClippableDrawable(v);
+ if (layer != null) {
+ layer.findDrawableByLayerId(R.id.slider_foreground).setTintList(
+ Utils.getColorAttr(v.getContext(),
+ com.android.internal.R.attr.colorControlActivated));
+ layer.findDrawableByLayerId(R.id.slider_icon).setTintList(
+ Utils.getColorAttr(v.getContext(),
+ com.android.internal.R.attr.colorBackground));
+ }
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FeedbackInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FeedbackInfo.java
index 4c78e62..149ee8c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FeedbackInfo.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FeedbackInfo.java
@@ -19,7 +19,6 @@
import static android.app.NotificationManager.IMPORTANCE_DEFAULT;
import static android.service.notification.NotificationListenerService.Ranking.RANKING_DEMOTED;
import static android.service.notification.NotificationListenerService.Ranking.RANKING_PROMOTED;
-import static android.service.notification.NotificationListenerService.Ranking.RANKING_UNCHANGED;
import android.annotation.SuppressLint;
import android.app.Notification;
@@ -43,6 +42,7 @@
import com.android.internal.statusbar.NotificationVisibility;
import com.android.systemui.Dependency;
import com.android.systemui.R;
+import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -64,6 +64,9 @@
private NotificationEntryManager mNotificationEntryManager;
private IStatusBarService mStatusBarService;
private AssistantFeedbackController mFeedbackController;
+ private NotificationGutsManager mNotificationGutsManager;
+ private NotificationMenuRowPlugin mMenuRowPlugin;
+ private ExpandableNotificationRow mExpandableNotificationRow;
public FeedbackInfo(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -73,19 +76,21 @@
final PackageManager pm,
final StatusBarNotification sbn,
final NotificationEntry entry,
+ final ExpandableNotificationRow row,
final AssistantFeedbackController controller) {
mPkg = sbn.getPackageName();
mPm = pm;
mEntry = entry;
+ mExpandableNotificationRow = row;
mRanking = entry.getRanking();
mFeedbackController = controller;
mAppName = mPkg;
mNotificationEntryManager = Dependency.get(NotificationEntryManager.class);
mStatusBarService = Dependency.get(IStatusBarService.class);
+ mNotificationGutsManager = Dependency.get(NotificationGutsManager.class);
bindHeader();
bindPrompt();
- bindButton();
}
private void bindHeader() {
@@ -161,27 +166,24 @@
return sb.toString();
}
- private void bindButton() {
- TextView ok = findViewById(R.id.ok);
- ok.setOnClickListener(this::closeControls);
- }
-
private void positiveFeedback(View v) {
+ mGutsContainer.closeControls(v, false);
handleFeedback(true);
}
private void negativeFeedback(View v) {
+ mMenuRowPlugin = mExpandableNotificationRow.getProvider();
+ NotificationMenuRowPlugin.MenuItem menuItem = null;
+ if (mMenuRowPlugin != null) {
+ menuItem = mMenuRowPlugin.getLongpressMenuItem(mContext);
+ }
+
+ mGutsContainer.closeControls(v, false);
+ mNotificationGutsManager.openGuts(mExpandableNotificationRow, 0, 0, menuItem);
handleFeedback(false);
}
private void handleFeedback(boolean positive) {
- TextView prompt = findViewById(R.id.prompt);
- prompt.setText(mContext.getString(R.string.feedback_response));
- TextView yes = findViewById(R.id.yes);
- yes.setVisibility(View.GONE);
- TextView no = findViewById(R.id.no);
- no.setVisibility(View.GONE);
-
Bundle feedback = new Bundle();
feedback.putBoolean(FEEDBACK_KEY, positive);
sendFeedbackToAssistant(feedback);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
index d2cfb29..c4f0098 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
@@ -324,7 +324,7 @@
userHandle.getIdentifier());
if (mAssistantFeedbackController.showFeedbackIndicator(row.getEntry())) {
- feedbackInfo.bindGuts(pmUser, sbn, row.getEntry(), mAssistantFeedbackController);
+ feedbackInfo.bindGuts(pmUser, sbn, row.getEntry(), row, mAssistantFeedbackController);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapper.java
index 4c9c2f9..414d620 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapper.java
@@ -47,6 +47,10 @@
public void onContentUpdated(ExpandableNotificationRow row) {
super.onContentUpdated(row);
+ // Custom views will most likely use just white or black as their text color.
+ // We need to scan through and replace these colors by Material NEXT colors.
+ ensureThemeOnChildren();
+
// Let's invert the notification colors when we're in night mode and
// the notification background isn't colorized.
if (needsInversion(mBackgroundColor, mView)) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationDecoratedCustomViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationDecoratedCustomViewWrapper.java
index 49a8d56..7964845 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationDecoratedCustomViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationDecoratedCustomViewWrapper.java
@@ -43,6 +43,11 @@
if (childIndex != null && childIndex != -1) {
mWrappedView = container.getChildAt(childIndex);
}
+
+ // Custom views will most likely use just white or black as their text color.
+ // We need to scan through and replace these colors by Material NEXT colors.
+ ensureThemeOnChildren();
+
if (needsInversion(resolveBackgroundColor(), mWrappedView)) {
invertViewLuminosity(mWrappedView);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
index 416c5af..2d706a4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
@@ -29,11 +29,13 @@
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
+import android.view.ContextThemeWrapper;
import android.view.NotificationHeaderView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
import com.android.internal.util.ContrastColorUtil;
@@ -55,6 +57,9 @@
private final Rect mTmpRect = new Rect();
protected int mBackgroundColor = 0;
+ private int mLightTextColor;
+ private int mDarkTextColor;
+ private int mDefaultTextColor;
public static NotificationViewWrapper wrap(Context ctx, View v, ExpandableNotificationRow row) {
if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
@@ -110,6 +115,15 @@
mBackgroundColor = backgroundColor;
mView.setBackground(new ColorDrawable(Color.TRANSPARENT));
}
+ mLightTextColor = mView.getContext().getColor(
+ com.android.internal.R.color.notification_primary_text_color_light);
+ mDarkTextColor = mView.getContext().getColor(
+ R.color.notification_primary_text_color_dark);
+
+ Context themedContext = new ContextThemeWrapper(mView.getContext(),
+ R.style.Theme_DeviceDefault_DayNight);
+ mDefaultTextColor = Utils.getColorAttr(themedContext, R.attr.textColorPrimary)
+ .getDefaultColor();
}
protected boolean needsInversion(int defaultBackgroundColor, View view) {
@@ -187,6 +201,42 @@
return false;
}
+ protected void ensureThemeOnChildren() {
+ if (mView == null) {
+ return;
+ }
+
+ // Notifications with custom backgrounds should not be adjusted
+ if (mBackgroundColor != Color.TRANSPARENT
+ || getBackgroundColor(mView) != Color.TRANSPARENT) {
+ return;
+ }
+
+ // Now let's check if there's unprotected text somewhere, and apply the theme if we find it.
+ if (!(mView instanceof ViewGroup)) {
+ return;
+ }
+ processChildrenTextColor((ViewGroup) mView);
+ }
+
+ private void processChildrenTextColor(ViewGroup viewGroup) {
+ if (viewGroup == null) {
+ return;
+ }
+
+ for (int i = 0; i < viewGroup.getChildCount(); i++) {
+ View child = viewGroup.getChildAt(i);
+ if (child instanceof TextView) {
+ int foreground = ((TextView) child).getCurrentTextColor();
+ if (foreground == mLightTextColor || foreground == mDarkTextColor) {
+ ((TextView) child).setTextColor(mDefaultTextColor);
+ }
+ } else if (child instanceof ViewGroup) {
+ processChildrenTextColor((ViewGroup) child);
+ }
+ }
+ }
+
protected int getBackgroundColor(View view) {
if (view == null) {
return Color.TRANSPARENT;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
index a5667bb..e1eaf3c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeServiceHost.java
@@ -390,17 +390,17 @@
}
@Override
- public void setDozeScreenBrightness(int value) {
- mNotificationShadeWindowController.setDozeScreenBrightness(value);
+ public void setDozeScreenBrightness(int brightness) {
+ mDozeLog.traceDozeScreenBrightness(brightness);
+ mNotificationShadeWindowController.setDozeScreenBrightness(brightness);
}
@Override
public void setAodDimmingScrim(float scrimOpacity) {
+ mDozeLog.traceSetAodDimmingScrim(scrimOpacity);
mScrimController.setAodFrontScrimAlpha(scrimOpacity);
}
-
-
@Override
public void prepareForGentleSleep(Runnable onDisplayOffCallback) {
if (mPendingScreenOffCallback != null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
index 1a2d1cf..b9e8d74 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -116,6 +116,11 @@
*/
private float mDarkAmount;
+ /**
+ * How visible the quick settings panel is.
+ */
+ private float mQsExpansion;
+
private float mEmptyDragAmount;
/**
@@ -159,7 +164,8 @@
public void setup(int statusBarMinHeight, int maxShadeBottom, int notificationStackHeight,
float panelExpansion, int parentHeight, int keyguardStatusHeight, int clockPreferredY,
boolean hasCustomClock, boolean hasVisibleNotifs, float dark, float emptyDragAmount,
- boolean bypassEnabled, int unlockedStackScrollerPadding, boolean udfpsEnrolled) {
+ boolean bypassEnabled, int unlockedStackScrollerPadding, boolean udfpsEnrolled,
+ float qsExpansion) {
mMinTopMargin = statusBarMinHeight + (udfpsEnrolled ? mContainerTopPaddingWithoutLockIcon :
mContainerTopPaddingWithLockIcon);
mMaxShadeBottom = maxShadeBottom;
@@ -174,6 +180,7 @@
mEmptyDragAmount = emptyDragAmount;
mBypassEnabled = bypassEnabled;
mUnlockedStackScrollerPadding = unlockedStackScrollerPadding;
+ mQsExpansion = qsExpansion;
}
public void run(Result result) {
@@ -274,6 +281,7 @@
*/
private float getClockAlpha(int y) {
float alphaKeyguard = Math.max(0, y / Math.max(1f, getClockY(1f)));
+ alphaKeyguard *= (1f - mQsExpansion);
alphaKeyguard = Interpolators.ACCELERATE.getInterpolation(alphaKeyguard);
return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
index 547a370..6bdc303 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
@@ -37,6 +37,7 @@
import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardSecurityModel;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.settingslib.Utils;
@@ -78,6 +79,7 @@
private final KeyguardStateController mKeyguardStateController;
private final Resources mResources;
private final HeadsUpManagerPhone mHeadsUpManagerPhone;
+ private final KeyguardSecurityModel mKeyguardSecurityModel;
private boolean mKeyguardShowing;
private boolean mKeyguardJustShown;
private boolean mBlockUpdates;
@@ -326,7 +328,8 @@
@Nullable DockManager dockManager,
KeyguardStateController keyguardStateController,
@Main Resources resources,
- HeadsUpManagerPhone headsUpManagerPhone) {
+ HeadsUpManagerPhone headsUpManagerPhone,
+ KeyguardSecurityModel keyguardSecurityModel) {
mLockscreenGestureLogger = lockscreenGestureLogger;
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mLockPatternUtils = lockPatternUtils;
@@ -341,6 +344,7 @@
mKeyguardStateController = keyguardStateController;
mResources = resources;
mHeadsUpManagerPhone = headsUpManagerPhone;
+ mKeyguardSecurityModel = keyguardSecurityModel;
mKeyguardIndicationController.setLockIconController(this);
}
@@ -541,13 +545,20 @@
* @return true if the visibility changed
*/
private boolean updateIconVisibility() {
+ if (mLockIcon == null) {
+ return false;
+ }
+
if (mKeyguardUpdateMonitor.isUdfpsEnrolled()) {
boolean changed = mLockIcon.getVisibility() == GONE;
mLockIcon.setVisibility(GONE);
return changed;
}
+
boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked;
- boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance;
+ boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance
+ || (mKeyguardSecurityModel.getSecurityMode(KeyguardUpdateMonitor.getCurrentUser())
+ == KeyguardSecurityModel.SecurityMode.None);
boolean fingerprintOrBypass = mFingerprintUnlock
|| mKeyguardBypassController.getBypassEnabled();
if (fingerprintOrBypass && !mBouncerShowingScrimmed) {
@@ -559,11 +570,6 @@
invisible = true;
}
}
-
- if (mLockIcon == null) {
- return false;
- }
-
return mLockIcon.updateIconVisibility(!invisible);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 84eacdc..8d3b128 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -292,6 +292,7 @@
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory;
private final QSDetailDisplayer mQSDetailDisplayer;
+ private final ScrimController mScrimController;
// Maximum # notifications to show on Keyguard; extras will be collapsed in an overflow card.
// If there are exactly 1 + mMaxKeyguardNotifications, then still shows all notifications
private final int mMaxKeyguardNotifications;
@@ -549,6 +550,7 @@
NotificationIconAreaController notificationIconAreaController,
AuthController authController,
QSDetailDisplayer qsDetailDisplayer,
+ ScrimController scrimController,
MediaDataManager mediaDataManager) {
super(view, falsingManager, dozeLog, keyguardStateController,
(SysuiStatusBarStateController) statusBarStateController, vibratorHelper,
@@ -579,6 +581,7 @@
mPulseExpansionHandler = pulseExpansionHandler;
mDozeParameters = dozeParameters;
mBiometricUnlockController = biometricUnlockController;
+ mScrimController = scrimController;
mMediaDataManager = mediaDataManager;
pulseExpansionHandler.setPulseExpandAbortListener(() -> {
if (mQs != null) {
@@ -909,7 +912,7 @@
clockPreferredY, hasCustomClock(),
hasVisibleNotifications, mInterpolatedDarkAmount, mEmptyDragAmount,
bypassEnabled, getUnlockedStackScrollerPadding(),
- mUpdateMonitor.isUdfpsEnrolled());
+ mUpdateMonitor.isUdfpsEnrolled(), getQsExpansionFraction());
mClockPositionAlgorithm.run(mClockPositionResult);
mKeyguardStatusViewController.updatePosition(
mClockPositionResult.clockX, mClockPositionResult.clockY,
@@ -1137,6 +1140,7 @@
if (isFullyCollapsed()) {
expand(true /* animate */);
} else {
+ traceQsJank(true /* startTracing */, false /* wasCancelled */);
flingSettings(0 /* velocity */, FLING_EXPAND);
}
}
@@ -1756,6 +1760,7 @@
updateHeaderKeyguardAlpha();
if (mBarState == StatusBarState.SHADE_LOCKED || mBarState == KEYGUARD) {
updateKeyguardBottomAreaAlpha();
+ positionClockAndNotifications();
updateBigClockAlpha();
}
@@ -1782,6 +1787,7 @@
float qsExpansionFraction = getQsExpansionFraction();
mQs.setQsExpansion(qsExpansionFraction, getHeaderTranslation());
mMediaHierarchyManager.setQsExpansion(qsExpansionFraction);
+ mScrimController.setQsExpansion(qsExpansionFraction);
mNotificationStackScrollLayoutController.setQsExpansionFraction(qsExpansionFraction);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java
index ba4fbb8..2ac9f30 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowViewController.java
@@ -238,7 +238,7 @@
if (mTouchCancelled || mExpandAnimationRunning || mExpandAnimationPending) {
return false;
}
- mFalsingCollector.onTouchEvent(ev, mView.getWidth(), mView.getHeight());
+ mFalsingCollector.onTouchEvent(ev);
mGestureDetector.onTouchEvent(ev);
if (mBrightnessMirror != null
&& mBrightnessMirror.getVisibility() == View.VISIBLE) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
index 5a01f47..8ed9710 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
@@ -862,6 +862,8 @@
mView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
if (mAnimateAfterExpanding) {
notifyExpandingStarted();
+ InteractionJankMonitor.getInstance().begin(
+ CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE);
fling(0, true /* expand */);
} else {
setExpandedFraction(1f);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 9e7efc1..f8e361f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -125,11 +125,6 @@
*/
public static final float BUSY_SCRIM_ALPHA = 1f;
- /**
- * Same as above, but when blur is supported.
- */
- public static final float BLUR_SCRIM_ALPHA = 0.80f;
-
static final int TAG_KEY_ANIM = R.id.scrim;
private static final int TAG_START_ALPHA = R.id.scrim_alpha_start;
private static final int TAG_END_ALPHA = R.id.scrim_alpha_end;
@@ -161,6 +156,7 @@
// Assuming the shade is expanded during initialization
private float mExpansionFraction = 1f;
+ private float mQsExpansion;
private boolean mDarkenWhileDragging;
private boolean mExpansionAffectsAlpha = true;
@@ -206,8 +202,7 @@
BlurUtils blurUtils, ConfigurationController configurationController) {
mScrimStateListener = lightBarController::setScrimState;
- mDefaultScrimAlpha = blurUtils.supportsBlursOnWindows()
- ? BLUR_SCRIM_ALPHA : BUSY_SCRIM_ALPHA;
+ mDefaultScrimAlpha = BUSY_SCRIM_ALPHA;
mBlurUtils = blurUtils;
mKeyguardStateController = keyguardStateController;
@@ -464,6 +459,31 @@
boolean relevantState = (mState == ScrimState.UNLOCKED
|| mState == ScrimState.KEYGUARD
+ || mState == ScrimState.SHADE_LOCKED
+ || mState == ScrimState.PULSING
+ || mState == ScrimState.BUBBLE_EXPANDED);
+ if (!(relevantState && mExpansionAffectsAlpha)) {
+ return;
+ }
+ applyAndDispatchExpansion();
+ }
+ }
+
+ /**
+ * Current state of the QuickSettings expansion when pulling it from the top.
+ *
+ * @param fraction From 0 to 1 where 0 means collapsed and 1 expanded.
+ */
+ public void setQsExpansion(float fraction) {
+ if (isNaN(fraction)) {
+ return;
+ }
+ if (mQsExpansion != fraction) {
+ mQsExpansion = fraction;
+ Log.d(TAG, "set qs fraction");
+
+ boolean relevantState = (mState == ScrimState.SHADE_LOCKED
+ || mState == ScrimState.KEYGUARD
|| mState == ScrimState.PULSING
|| mState == ScrimState.BUBBLE_EXPANDED);
if (!(relevantState && mExpansionAffectsAlpha)) {
@@ -506,7 +526,8 @@
behindFraction = (float) Math.pow(behindFraction, 0.8f);
mBehindAlpha = behindFraction * mDefaultScrimAlpha;
mInFrontAlpha = 0;
- } else if (mState == ScrimState.KEYGUARD || mState == ScrimState.PULSING) {
+ } else if (mState == ScrimState.KEYGUARD || mState == ScrimState.SHADE_LOCKED
+ || mState == ScrimState.PULSING) {
// Either darken of make the scrim transparent when you
// pull down the shade
float interpolatedFract = getInterpolatedFraction();
@@ -522,6 +543,11 @@
}
mBehindTint = ColorUtils.blendARGB(ScrimState.BOUNCER.getBehindTint(),
mState.getBehindTint(), interpolatedFract);
+ if (mQsExpansion > 0) {
+ mBehindAlpha = MathUtils.lerp(mBehindAlpha, mDefaultScrimAlpha, mQsExpansion);
+ mBehindTint = ColorUtils.blendARGB(mBehindTint,
+ ScrimState.SHADE_LOCKED.getBehindTint(), mQsExpansion);
+ }
}
if (isNaN(mBehindAlpha) || isNaN(mInFrontAlpha)) {
throw new IllegalStateException("Scrim opacity is NaN for state: " + mState
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
index fc91c16..994da79 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
@@ -112,6 +112,15 @@
}
},
+ SHADE_LOCKED {
+ @Override
+ public void prepare(ScrimState previousState) {
+ mBehindAlpha = mDefaultScrimAlpha;
+ mBubbleAlpha = 0f;
+ mFrontAlpha = 0f;
+ }
+ },
+
/**
* Changing screen brightness from quick settings.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 981f9a6..9ebde53 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -4099,6 +4099,8 @@
mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback);
} else if (mBrightnessMirrorVisible) {
mScrimController.transitionTo(ScrimState.BRIGHTNESS_MIRROR);
+ } else if (mState == StatusBarState.SHADE_LOCKED) {
+ mScrimController.transitionTo(ScrimState.SHADE_LOCKED);
} else if (mDozeServiceHost.isPulsing()) {
mScrimController.transitionTo(ScrimState.PULSING,
mDozeScrimController.getScrimCallback());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryControllerImpl.java
index d8710bf..8c67072 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryControllerImpl.java
@@ -37,7 +37,6 @@
import com.android.settingslib.fuelgauge.Estimate;
import com.android.settingslib.utils.PowerUtil;
import com.android.systemui.broadcast.BroadcastDispatcher;
-import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.demomode.DemoMode;
@@ -49,13 +48,10 @@
import java.util.ArrayList;
import java.util.List;
-import javax.inject.Inject;
-
/**
* Default implementation of a {@link BatteryController}. This controller monitors for battery
* level change events that are broadcasted by the system.
*/
-@SysUISingleton
public class BatteryControllerImpl extends BroadcastReceiver implements BatteryController {
private static final String TAG = "BatteryController";
@@ -89,7 +85,6 @@
private boolean mFetchingEstimate = false;
@VisibleForTesting
- @Inject
public BatteryControllerImpl(
Context context,
EnhancedEstimates enhancedEstimates,
@@ -155,8 +150,11 @@
mChangeCallbacks.add(cb);
}
if (!mHasReceivedBattery) return;
+
+ // Make sure new callbacks get the correct initial state
cb.onBatteryLevelChanged(mLevel, mPluggedIn, mCharging);
cb.onPowerSaveChanged(mPowerSave);
+ cb.onBatteryUnknownStateChanged(mStateUnknown);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryStateNotifier.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryStateNotifier.kt
index 92e5b78..27e40e0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryStateNotifier.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryStateNotifier.kt
@@ -56,7 +56,8 @@
val intent = Intent(Intent.ACTION_VIEW,
Uri.parse(context.getString(R.string.config_batteryStateUnknownUrl)))
- val pi = PendingIntent.getActivity(context, 0, intent, 0)
+ val pi = PendingIntent.getActivity(context, 0, intent,
+ PendingIntent.FLAG_IMMUTABLE)
val builder = Notification.Builder(context, channel.id)
.setAutoCancel(false)
@@ -87,4 +88,4 @@
private const val TAG = "BatteryStateNotifier"
private const val ID = 666
-private const val DELAY_MILLIS: Long = 4 * 60 * 60 * 1000
\ No newline at end of file
+private const val DELAY_MILLIS: Long = 4 * 60 * 60 * 1000
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index 49be648..dd9165d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -15,6 +15,10 @@
*/
package com.android.systemui.statusbar.policy;
+import static com.android.settingslib.mobile.MobileMappings.getIconKey;
+import static com.android.settingslib.mobile.MobileMappings.toDisplayIconKey;
+import static com.android.settingslib.mobile.MobileMappings.toIconKey;
+
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
@@ -22,10 +26,8 @@
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings.Global;
-import android.telephony.Annotation;
import android.telephony.CellSignalStrength;
import android.telephony.CellSignalStrengthCdma;
-import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
@@ -39,12 +41,13 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.settingslib.Utils;
import com.android.settingslib.graph.SignalDrawable;
+import com.android.settingslib.mobile.MobileStatusTracker;
+import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
import com.android.settingslib.net.SignalStrengthUtil;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.NetworkController.IconState;
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
import com.android.systemui.statusbar.policy.NetworkControllerImpl.Config;
-import com.android.systemui.statusbar.policy.NetworkControllerImpl.SubscriptionDefaults;
import java.io.PrintWriter;
import java.util.BitSet;
@@ -52,8 +55,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.concurrent.Executor;
-
public class MobileSignalController extends SignalController<
MobileSignalController.MobileState, MobileSignalController.MobileIconGroup> {
@@ -62,14 +63,10 @@
private final String mNetworkNameDefault;
private final String mNetworkNameSeparator;
private final ContentObserver mObserver;
- @VisibleForTesting
- final PhoneStateListener mPhoneStateListener;
// Save entire info for logging, we only use the id.
final SubscriptionInfo mSubscriptionInfo;
-
// @VisibleForDemoMode
final Map<String, MobileIconGroup> mNetworkToIconLookup;
-
// Since some pieces of the phone state are interdependent we store it locally,
// this could potentially become part of MobileState for simplification/complication
// of code.
@@ -83,6 +80,9 @@
private Config mConfig;
@VisibleForTesting
boolean mInflateSignalStrengths = false;
+ private MobileStatusTracker.Callback mCallback;
+ @VisibleForTesting
+ MobileStatusTracker mMobileStatusTracker;
// TODO: Reduce number of vars passed in, if we have the NetworkController, probably don't
// need listener lists anymore.
@@ -98,28 +98,42 @@
mPhone = phone;
mDefaults = defaults;
mSubscriptionInfo = info;
- mPhoneStateListener = new MobilePhoneStateListener((new Handler(receiverLooper))::post);
mNetworkNameSeparator = getTextIfExists(R.string.status_bar_network_name_separator)
.toString();
mNetworkNameDefault = getTextIfExists(
com.android.internal.R.string.lockscreen_carrier_default).toString();
-
mapIconSets();
-
String networkName = info.getCarrierName() != null ? info.getCarrierName().toString()
: mNetworkNameDefault;
mLastState.networkName = mCurrentState.networkName = networkName;
mLastState.networkNameData = mCurrentState.networkNameData = networkName;
mLastState.enabled = mCurrentState.enabled = hasMobileData;
mLastState.iconGroup = mCurrentState.iconGroup = mDefaultIcons;
- // Get initial data sim state.
- updateDataSim();
mObserver = new ContentObserver(new Handler(receiverLooper)) {
@Override
public void onChange(boolean selfChange) {
updateTelephony();
}
};
+ mCallback = new MobileStatusTracker.Callback() {
+ @Override
+ public void onMobileStatusChanged(boolean updateTelephony,
+ MobileStatusTracker.MobileStatus mobileStatus) {
+ if (Log.isLoggable(mTag, Log.DEBUG)) {
+ Log.d(mTag, "onMobileStatusChanged="
+ + " updateTelephony=" + updateTelephony
+ + " mobileStatus=" + mobileStatus.toString());
+ }
+ updateMobileStatus(mobileStatus);
+ if (updateTelephony) {
+ updateTelephony();
+ } else {
+ notifyListenersIfNecessary();
+ }
+ }
+ };
+ mMobileStatusTracker = new MobileStatusTracker(mPhone, receiverLooper,
+ info, mDefaults, mCallback);
}
public void setConfiguration(Config config) {
@@ -157,15 +171,7 @@
* Start listening for phone state changes.
*/
public void registerListener() {
- mPhone.listen(mPhoneStateListener,
- PhoneStateListener.LISTEN_SERVICE_STATE
- | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
- | PhoneStateListener.LISTEN_CALL_STATE
- | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
- | PhoneStateListener.LISTEN_DATA_ACTIVITY
- | PhoneStateListener.LISTEN_CARRIER_NETWORK_CHANGE
- | PhoneStateListener.LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE
- | PhoneStateListener.LISTEN_DISPLAY_INFO_CHANGED);
+ mMobileStatusTracker.setListening(true);
mContext.getContentResolver().registerContentObserver(Global.getUriFor(Global.MOBILE_DATA),
true, mObserver);
mContext.getContentResolver().registerContentObserver(Global.getUriFor(
@@ -177,7 +183,7 @@
* Stop listening for phone state changes.
*/
public void unregisterListener() {
- mPhone.listen(mPhoneStateListener, 0);
+ mMobileStatusTracker.setListening(false);
mContext.getContentResolver().unregisterContentObserver(mObserver);
}
@@ -288,34 +294,6 @@
TelephonyIcons.NR_5G);
}
- private String getIconKey() {
- if (mTelephonyDisplayInfo.getOverrideNetworkType()
- == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) {
- return toIconKey(mTelephonyDisplayInfo.getNetworkType());
- } else {
- return toDisplayIconKey(mTelephonyDisplayInfo.getOverrideNetworkType());
- }
- }
-
- private String toIconKey(@Annotation.NetworkType int networkType) {
- return Integer.toString(networkType);
- }
-
- private String toDisplayIconKey(@Annotation.OverrideNetworkType int displayNetworkType) {
- switch (displayNetworkType) {
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA:
- return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA";
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO:
- return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA_Plus";
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA:
- return toIconKey(TelephonyManager.NETWORK_TYPE_NR);
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE:
- return toIconKey(TelephonyManager.NETWORK_TYPE_NR) + "_Plus";
- default:
- return "unsupported";
- }
- }
-
private void updateInflateSignalStrength() {
mInflateSignalStrengths = SignalStrengthUtil.shouldInflateSignalStrength(mContext,
mSubscriptionInfo.getSubscriptionId());
@@ -521,13 +499,24 @@
return CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
}
+ private void updateMobileStatus(MobileStatusTracker.MobileStatus mobileStatus) {
+ mCurrentState.activityIn = mobileStatus.activityIn;
+ mCurrentState.activityOut = mobileStatus.activityOut;
+ mCurrentState.dataSim = mobileStatus.dataSim;
+ mCurrentState.carrierNetworkChangeMode = mobileStatus.carrierNetworkChangeMode;
+ mDataState = mobileStatus.dataState;
+ mServiceState = mobileStatus.serviceState;
+ mSignalStrength = mobileStatus.signalStrength;
+ mTelephonyDisplayInfo = mobileStatus.telephonyDisplayInfo;
+ }
+
/**
* Updates the current state based on mServiceState, mSignalStrength, mDataState,
* mTelephonyDisplayInfo, and mSimState. It should be called any time one of these is updated.
* This will call listeners if necessary.
*/
private final void updateTelephony() {
- if (DEBUG) {
+ if (Log.isLoggable(mTag, Log.DEBUG)) {
Log.d(mTag, "updateTelephonySignalStrength: hasService=" +
Utils.isInService(mServiceState) + " ss=" + mSignalStrength
+ " displayInfo=" + mTelephonyDisplayInfo);
@@ -542,7 +531,7 @@
}
}
- String iconKey = getIconKey();
+ String iconKey = getIconKey(mTelephonyDisplayInfo);
if (mNetworkToIconLookup.get(iconKey) != null) {
mCurrentState.iconGroup = mNetworkToIconLookup.get(iconKey);
} else {
@@ -622,75 +611,6 @@
pw.println(" isDataDisabled=" + isDataDisabled() + ",");
}
- class MobilePhoneStateListener extends PhoneStateListener {
- public MobilePhoneStateListener(Executor executor) {
- super(executor);
- }
-
- @Override
- public void onSignalStrengthsChanged(SignalStrength signalStrength) {
- if (DEBUG) {
- Log.d(mTag, "onSignalStrengthsChanged signalStrength=" + signalStrength +
- ((signalStrength == null) ? "" : (" level=" + signalStrength.getLevel())));
- }
- mSignalStrength = signalStrength;
- updateTelephony();
- }
-
- @Override
- public void onServiceStateChanged(ServiceState state) {
- if (DEBUG) {
- Log.d(mTag, "onServiceStateChanged voiceState=" + state.getState()
- + " dataState=" + state.getDataRegistrationState());
- }
- mServiceState = state;
- updateTelephony();
- }
-
- @Override
- public void onDataConnectionStateChanged(int state, int networkType) {
- if (DEBUG) {
- Log.d(mTag, "onDataConnectionStateChanged: state=" + state
- + " type=" + networkType);
- }
- mDataState = state;
- updateTelephony();
- }
-
- @Override
- public void onDataActivity(int direction) {
- if (DEBUG) {
- Log.d(mTag, "onDataActivity: direction=" + direction);
- }
- setActivity(direction);
- }
-
- @Override
- public void onCarrierNetworkChange(boolean active) {
- if (DEBUG) {
- Log.d(mTag, "onCarrierNetworkChange: active=" + active);
- }
- mCurrentState.carrierNetworkChangeMode = active;
- updateTelephony();
- }
-
- @Override
- public void onActiveDataSubscriptionIdChanged(int subId) {
- if (DEBUG) Log.d(mTag, "onActiveDataSubscriptionIdChanged: subId=" + subId);
- updateDataSim();
- updateTelephony();
- }
-
- @Override
- public void onDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) {
- if (DEBUG) {
- Log.d(mTag, "onDisplayInfoChanged: telephonyDisplayInfo=" + telephonyDisplayInfo);
- }
- mTelephonyDisplayInfo = telephonyDisplayInfo;
- updateTelephony();
- }
- }
-
static class MobileIconGroup extends SignalController.IconGroup {
final int mDataContentDescription; // mContentDescriptionDataType
final int mDataType;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 62b922e..a3abb31 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -59,6 +59,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
import com.android.settingslib.net.DataUsageController;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
@@ -391,7 +392,6 @@
}
}
});
-
updateMobileControllers();
// Initial setup of emergency information. Handled as if we had received a sticky broadcast
@@ -1202,20 +1202,6 @@
}
};
- public static class SubscriptionDefaults {
- public int getDefaultVoiceSubId() {
- return SubscriptionManager.getDefaultVoiceSubscriptionId();
- }
-
- public int getDefaultDataSubId() {
- return SubscriptionManager.getDefaultDataSubscriptionId();
- }
-
- public int getActiveDataSubId() {
- return SubscriptionManager.getActiveDataSubscriptionId();
- }
- }
-
@VisibleForTesting
static class Config {
boolean showAtLeast3G = false;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
index e7f84a5..34c7881 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
@@ -102,8 +102,7 @@
mHeightUpperLimit = NotificationUtils.getFontScaledHeight(mContext,
R.dimen.smart_reply_button_max_height);
- mCurrentBackgroundColor = context.getColor(R.color.smart_reply_button_background);
- mDefaultBackgroundColor = mCurrentBackgroundColor;
+ mDefaultBackgroundColor = context.getColor(R.color.smart_reply_button_background);
mDefaultTextColor = mContext.getColor(R.color.smart_reply_button_text);
mDefaultTextColorDarkBg = mContext.getColor(R.color.smart_reply_button_text_dark_bg);
mDefaultStrokeColor = mContext.getColor(R.color.smart_reply_button_stroke);
@@ -142,8 +141,9 @@
mSingleToDoubleLineButtonWidthIncrease =
2 * (doubleLineButtonPaddingHorizontal - singleLineButtonPaddingHorizontal);
-
mBreakIterator = BreakIterator.getLineInstance();
+
+ setBackgroundTintColor(mDefaultBackgroundColor);
reallocateCandidateButtonQueueForSqueezing();
}
@@ -182,7 +182,7 @@
public void resetSmartSuggestions(View newSmartReplyContainer) {
mSmartReplyContainer = newSmartReplyContainer;
removeAllViews();
- mCurrentBackgroundColor = mDefaultBackgroundColor;
+ setBackgroundTintColor(mDefaultBackgroundColor);
}
/** Add buttons to the {@link SmartReplyView} */
diff --git a/packages/SystemUI/src/com/android/systemui/util/AlphaTintDrawableWrapper.java b/packages/SystemUI/src/com/android/systemui/util/AlphaTintDrawableWrapper.java
new file mode 100644
index 0000000..79a197d
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/util/AlphaTintDrawableWrapper.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2020 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.systemui.util;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.res.ColorStateList;
+import android.content.res.Resources;
+import android.content.res.Resources.Theme;
+import android.content.res.TypedArray;
+import android.graphics.drawable.DrawableWrapper;
+import android.util.AttributeSet;
+
+import com.android.systemui.R;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+
+/**
+ * An extension of {@link DrawableWrapper} that supports alpha and tint XML properties.
+ *
+ * {@link DrawableWrapper} supports setting these properties programmatically, but doesn't expose
+ * corresponding XML properties for some reason. This class allows to set these values in the XML,
+ * supporting theming.
+ *
+ * This class should only be used in XML.
+ *
+ * @attr ref android.R.styleable#DrawableWrapper_drawable
+ * @attr ref R.styleable#AlphaTintDrawableWrapper_tint
+ * @attr ref R.styleable#AlphaTintDrawableWrapper_alpha
+ */
+public class AlphaTintDrawableWrapper extends DrawableWrapper {
+ private ColorStateList mTint;
+ private int[] mThemeAttrs;
+
+ /** No-arg constructor used by drawable inflation. */
+ public AlphaTintDrawableWrapper() {
+ super(null);
+ }
+
+ @Override
+ public void inflate(@NonNull Resources r, @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs, @Nullable Theme theme)
+ throws XmlPullParserException, IOException {
+ final TypedArray a = obtainAttributes(r, theme, attrs,
+ R.styleable.AlphaTintDrawableWrapper);
+
+ super.inflate(r, parser, attrs, theme);
+
+ mThemeAttrs = a.extractThemeAttrs();
+ updateStateFromTypedArray(a);
+ a.recycle();
+
+ applyTint();
+ }
+
+ @Override
+ public void applyTheme(Theme t) {
+ super.applyTheme(t);
+
+ if (mThemeAttrs != null) {
+ final TypedArray a = t.resolveAttributes(mThemeAttrs,
+ R.styleable.AlphaTintDrawableWrapper);
+ updateStateFromTypedArray(a);
+ a.recycle();
+ }
+
+ // Ensure tint is reapplied after applying the theme to ensure this drawables'
+ // tint overrides the underlying drawables' tint.
+ applyTint();
+ }
+
+ @Override
+ public boolean canApplyTheme() {
+ return (mThemeAttrs != null && mThemeAttrs.length > 0) || super.canApplyTheme();
+ }
+
+ private void updateStateFromTypedArray(@NonNull TypedArray a) {
+ if (a.hasValue(R.styleable.AlphaTintDrawableWrapper_android_drawable)) {
+ setDrawable(a.getDrawable(R.styleable.AlphaTintDrawableWrapper_android_drawable));
+ }
+ if (a.hasValue(R.styleable.AlphaTintDrawableWrapper_android_tint)) {
+ mTint = a.getColorStateList(R.styleable.AlphaTintDrawableWrapper_android_tint);
+ }
+ if (a.hasValue(R.styleable.AlphaTintDrawableWrapper_android_alpha)) {
+ float alpha = a.getFloat(R.styleable.AlphaTintDrawableWrapper_android_alpha, 1);
+ setAlpha(Math.round(alpha * 255));
+ }
+ }
+
+ private void applyTint() {
+ if (getDrawable() != null && mTint != null) {
+ getDrawable().mutate().setTintList(mTint);
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java
index a879a1e..2a18f3c5 100644
--- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java
+++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java
@@ -168,6 +168,11 @@
mConfigurationController.addCallback(new ConfigurationController.ConfigurationListener() {
@Override
+ public void onConfigChanged(Configuration newConfig) {
+ pip.onConfigurationChanged(newConfig);
+ }
+
+ @Override
public void onDensityOrFontScaleChanged() {
pip.onDensityOrFontScaleChanged();
}
diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java
index 71a883d..ee58947 100644
--- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java
+++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java
@@ -37,6 +37,7 @@
import com.android.wm.shell.ShellCommandHandler;
import com.android.wm.shell.ShellInit;
import com.android.wm.shell.ShellTaskOrganizer;
+import com.android.wm.shell.Transitions;
import com.android.wm.shell.WindowManagerShellWrapper;
import com.android.wm.shell.apppairs.AppPairs;
import com.android.wm.shell.bubbles.BubbleController;
@@ -56,8 +57,6 @@
import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutoutController;
-import com.android.wm.shell.letterbox.LetterboxConfigController;
-import com.android.wm.shell.letterbox.LetterboxTaskListener;
import com.android.wm.shell.onehanded.OneHanded;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.pip.Pip;
@@ -172,15 +171,15 @@
ShellTaskOrganizer shellTaskOrganizer,
Optional<SplitScreen> splitScreenOptional,
Optional<AppPairs> appPairsOptional,
- LetterboxTaskListener letterboxTaskListener,
- FullscreenTaskListener fullscreenTaskListener) {
+ FullscreenTaskListener fullscreenTaskListener,
+ Transitions transitions) {
return new ShellInit(displayImeController,
dragAndDropController,
shellTaskOrganizer,
splitScreenOptional,
appPairsOptional,
- letterboxTaskListener,
- fullscreenTaskListener);
+ fullscreenTaskListener,
+ transitions);
}
/**
@@ -195,11 +194,9 @@
Optional<Pip> pipOptional,
Optional<OneHanded> oneHandedOptional,
Optional<HideDisplayCutout> hideDisplayCutout,
- Optional<AppPairs> appPairsOptional,
- LetterboxConfigController letterboxConfigController) {
+ Optional<AppPairs> appPairsOptional) {
return Optional.of(new ShellCommandHandler(shellTaskOrganizer, splitScreenOptional,
- pipOptional, oneHandedOptional, hideDisplayCutout, appPairsOptional,
- letterboxConfigController));
+ pipOptional, oneHandedOptional, hideDisplayCutout, appPairsOptional));
}
@WMSingleton
@@ -278,12 +275,9 @@
@WMSingleton
@Provides
- static ShellTaskOrganizer provideShellTaskOrganizer(SyncTransactionQueue syncQueue,
- @ShellMainThread ShellExecutor shellMainExecutor,
- @ShellAnimationThread ShellExecutor shellAnimationExecutor,
- TransactionPool transactionPool, Context context) {
- return new ShellTaskOrganizer(syncQueue, transactionPool, shellMainExecutor,
- shellAnimationExecutor, context);
+ static ShellTaskOrganizer provideShellTaskOrganizer(@ShellMainThread ShellExecutor mainExecutor,
+ Context context) {
+ return new ShellTaskOrganizer(mainExecutor, context);
}
@WMSingleton
@@ -338,16 +332,9 @@
@WMSingleton
@Provides
- static LetterboxTaskListener provideLetterboxTaskListener(
- SyncTransactionQueue syncQueue,
- LetterboxConfigController letterboxConfigController,
- WindowManager windowManager) {
- return new LetterboxTaskListener(syncQueue, letterboxConfigController, windowManager);
- }
-
- @WMSingleton
- @Provides
- static LetterboxConfigController provideLetterboxConfigController(Context context) {
- return new LetterboxConfigController(context);
+ static Transitions provideTransitions(ShellTaskOrganizer organizer, TransactionPool pool,
+ @ShellMainThread ShellExecutor mainExecutor,
+ @ShellAnimationThread ShellExecutor animExecutor) {
+ return new Transitions(organizer, pool, mainExecutor, animExecutor);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
index 1115043..96f3c15 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
@@ -33,6 +33,7 @@
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
@@ -91,6 +92,7 @@
private MagnificationModeSwitch mMagnificationModeSwitch;
private View.OnTouchListener mTouchListener;
private List<MotionEvent> mMotionEvents = new ArrayList<>();
+ private Runnable mFadeOutAnimation;
@Before
public void setUp() throws Exception {
@@ -119,6 +121,7 @@
event.recycle();
}
mMotionEvents.clear();
+ mFadeOutAnimation = null;
}
@Test
@@ -143,6 +146,13 @@
}
@Test
+ public void showButton_excludeSystemGestureArea() {
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW);
+
+ verify(mSpyImageView).setSystemGestureExclusionRects(any(List.class));
+ }
+
+ @Test
public void showMagnificationButton_setA11yTimeout_postDelayedAnimationWithA11yTimeout() {
final int a11yTimeout = 12345;
when(mAccessibilityManager.getRecommendedTimeoutMillis(anyInt(), anyInt())).thenReturn(
@@ -157,15 +167,9 @@
}
@Test
- public void showMagnificationButton_windowMode_verifyAnimationEndAction() {
- // Execute the runnable immediately to run the animation.
- doAnswer((invocation) -> {
- final Runnable action = invocation.getArgument(0);
- action.run();
- return null;
- }).when(mSpyImageView).postOnAnimationDelayed(any(Runnable.class), anyLong());
-
+ public void showMagnificationButton_windowModeAndFadingOut_verifyAnimationEndAction() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW);
+ executeFadeOutAnimation();
// Verify the end action after fade-out.
final ArgumentCaptor<Runnable> endActionCaptor = ArgumentCaptor.forClass(Runnable.class);
@@ -178,14 +182,17 @@
}
@Test
- public void onConfigurationChanged_buttonIsShowing_setImageResource() {
+ public void onConfigurationChanged_buttonIsShowing_updateResourcesAndLayout() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
resetAndStubMockImageViewAndAnimator();
mMagnificationModeSwitch.onConfigurationChanged(ActivityInfo.CONFIG_DENSITY);
+ verify(mSpyImageView).setPadding(anyInt(), anyInt(), anyInt(), anyInt());
verify(mSpyImageView).setImageResource(
getIconResId(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN));
+ verify(mWindowManager).updateViewLayout(eq(mSpyImageView), any());
+ verify(mSpyImageView).setSystemGestureExclusionRects(any(List.class));
}
@Test
@@ -197,9 +204,6 @@
final long downTime = SystemClock.uptimeMillis();
mTouchListener.onTouch(mSpyImageView,
obtainMotionEvent(downTime, 0, ACTION_DOWN, 100, 100));
-
- verify(mViewPropertyAnimator).cancel();
-
resetAndStubMockImageViewAndAnimator();
mTouchListener.onTouch(mSpyImageView,
obtainMotionEvent(downTime, downTime, ACTION_UP, 100, 100));
@@ -208,6 +212,31 @@
}
@Test
+ public void sendDownEvent_fullscreenMode_fadeOutAnimationIsNull() {
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
+ resetAndStubMockImageViewAndAnimator();
+
+ final long downTime = SystemClock.uptimeMillis();
+ mTouchListener.onTouch(mSpyImageView,
+ obtainMotionEvent(downTime, 0, ACTION_DOWN, 100, 100));
+
+ assertNull(mFadeOutAnimation);
+ }
+
+ @Test
+ public void sendDownEvent_fullscreenModeAndFadingOut_cancelAnimation() {
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
+ executeFadeOutAnimation();
+ resetAndStubMockImageViewAndAnimator();
+
+ final long downTime = SystemClock.uptimeMillis();
+ mTouchListener.onTouch(mSpyImageView,
+ obtainMotionEvent(downTime, 0, ACTION_DOWN, 100, 100));
+
+ verify(mViewPropertyAnimator).cancel();
+ }
+
+ @Test
public void performDragging_showMagnificationButton_updateViewLayout() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
resetAndStubMockImageViewAndAnimator();
@@ -219,7 +248,6 @@
final long downTime = SystemClock.uptimeMillis();
mTouchListener.onTouch(mSpyImageView, obtainMotionEvent(
downTime, 0, ACTION_DOWN, 100, 100));
- verify(mViewPropertyAnimator).cancel();
mTouchListener.onTouch(mSpyImageView,
obtainMotionEvent(downTime, downTime, ACTION_MOVE, 100 + offset,
@@ -368,7 +396,22 @@
private void resetAndStubMockImageViewAndAnimator() {
resetAndStubMockAnimator();
Mockito.reset(mSpyImageView);
+ doAnswer(invocation -> {
+ final Runnable runnable = invocation.getArgument(0);
+ runnable.run();
+ return null;
+ }).when(mSpyImageView).post(any(Runnable.class));
doReturn(mViewPropertyAnimator).when(mSpyImageView).animate();
+ doAnswer((invocation) -> {
+ mFadeOutAnimation = invocation.getArgument(0);
+ return null;
+ }).when(mSpyImageView).postOnAnimationDelayed(any(Runnable.class), anyLong());
+ doAnswer((invocation) -> {
+ if (mFadeOutAnimation == invocation.getArgument(0)) {
+ mFadeOutAnimation = null;
+ }
+ return null;
+ }).when(mSpyImageView).removeCallbacks(any(Runnable.class));
}
private void resetAndStubMockAnimator() {
@@ -397,4 +440,10 @@
mMotionEvents.add(event);
return event;
}
+
+ private void executeFadeOutAnimation() {
+ assertNotNull(mFadeOutAnimation);
+ mFadeOutAnimation.run();
+ mFadeOutAnimation = null;
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
index ade3290..02143a7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
@@ -150,7 +150,7 @@
mController.onOpActiveChanged(
AppOpsManager.OP_RECORD_AUDIO, TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mTestableLooper.processAllMessages();
verify(mCallback).onActiveStateChanged(AppOpsManager.OP_RECORD_AUDIO,
TEST_UID, TEST_PACKAGE_NAME, true);
@@ -204,7 +204,8 @@
mController.onOpActiveChanged(AppOpsManager.OP_CAMERA,
TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION,
- TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.MODE_ALLOWED);
+ TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.OP_FLAG_SELF,
+ AppOpsManager.MODE_ALLOWED);
assertEquals(3, mController.getActiveAppOps().size());
}
@@ -215,7 +216,8 @@
mController.onOpActiveChanged(AppOpsManager.OP_CAMERA,
TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION,
- TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.MODE_ALLOWED);
+ TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.OP_FLAG_SELF,
+ AppOpsManager.MODE_ALLOWED);
assertEquals(2,
mController.getActiveAppOpsForUser(UserHandle.getUserId(TEST_UID)).size());
assertEquals(1,
@@ -246,7 +248,7 @@
public void opNotedScheduledForRemoval() {
mController.setBGHandler(mMockHandler);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
verify(mMockHandler).scheduleRemoval(any(AppOpItem.class), anyLong());
}
@@ -258,7 +260,7 @@
mController.onOpActiveChanged(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
assertFalse(mController.getActiveAppOps().isEmpty());
mController.setListening(false);
@@ -272,9 +274,9 @@
mController.setBGHandler(mMockHandler);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
// Only one post to notify subscribers
verify(mMockHandler, times(1)).post(any());
@@ -288,9 +290,9 @@
mController.setBGHandler(mMockHandler);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
// Only one post to notify subscribers
verify(mMockHandler, times(2)).scheduleRemoval(any(), anyLong());
@@ -308,7 +310,7 @@
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
// Check that we "scheduled" the removal. Don't actually schedule until we are ready to
// process messages at a later time.
@@ -337,7 +339,7 @@
mController.addCallback(new int[]{AppOpsManager.OP_FINE_LOCATION}, mCallback);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpActiveChanged(
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
@@ -366,7 +368,7 @@
mController.addCallback(new int[]{AppOpsManager.OP_FINE_LOCATION}, mCallback);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpActiveChanged(
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
@@ -384,7 +386,7 @@
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mTestableLooper.processAllMessages();
verify(mCallback).onActiveStateChanged(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
index 19f0a15..8c547b1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
@@ -20,6 +20,8 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.anyDouble;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -31,15 +33,19 @@
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.testing.FakeMetricsLogger;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.classifier.FalsingDataProvider.GestureCompleteListener;
import com.android.systemui.dock.DockManagerFake;
+import com.android.systemui.util.time.FakeSystemClock;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -62,16 +68,25 @@
@Mock
private FalsingClassifier mClassifierB;
private final List<MotionEvent> mMotionEventList = new ArrayList<>();
+ @Mock
+ private HistoryTracker mHistoryTracker;
+ private FakeSystemClock mSystemClock = new FakeSystemClock();
+
+ private final FalsingClassifier.Result mFalsedResult = FalsingClassifier.Result.falsed(1, "");
+ private final FalsingClassifier.Result mPassedResult = FalsingClassifier.Result.passed(1);
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
+ when(mClassifierB.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
mClassifiers.add(mClassifierA);
mClassifiers.add(mClassifierB);
when(mFalsingDataProvider.isDirty()).thenReturn(true);
when(mFalsingDataProvider.getRecentMotionEvents()).thenReturn(mMotionEventList);
mBrightLineFalsingManager = new BrightLineFalsingManager(mFalsingDataProvider, mDockManager,
- mMetricsLogger, mClassifiers, mSingleTapClassfier, mDoubleTapClassifier, false);
+ mMetricsLogger, mClassifiers, mSingleTapClassfier, mDoubleTapClassifier,
+ mHistoryTracker, mSystemClock, false);
}
@Test
@@ -98,20 +113,20 @@
@Test
public void testIsFalseTouch_ClassifierARejects() {
- when(mClassifierA.isFalseTouch()).thenReturn(true);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isTrue();
}
@Test
public void testIsFalseTouch_ClassifierBRejects() {
- when(mClassifierB.isFalseTouch()).thenReturn(true);
+ when(mClassifierB.classifyGesture(anyDouble(), anyDouble())).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isTrue();
}
@Test
public void testIsFalseTouch_FaceAuth() {
// Even when the classifiers report a false, we should allow.
- when(mClassifierA.isFalseTouch()).thenReturn(true);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
when(mFalsingDataProvider.isJustUnlockedWithFace()).thenReturn(true);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isFalse();
@@ -120,7 +135,7 @@
@Test
public void testIsFalseTouch_Docked() {
// Even when the classifiers report a false, we should allow.
- when(mClassifierA.isFalseTouch()).thenReturn(true);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
mDockManager.setIsDocked(true);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isFalse();
@@ -128,37 +143,51 @@
@Test
public void testIsFalseTap_BasicCheck() {
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(false);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseTap(false)).isTrue();
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(true);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
assertThat(mBrightLineFalsingManager.isFalseTap(false)).isFalse();
}
@Test
public void testIsFalseTap_RobustCheck_NoFaceAuth() {
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(true);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
mFalsingDataProvider.setJustUnlockedWithFace(false);
assertThat(mBrightLineFalsingManager.isFalseTap(true)).isTrue();
}
@Test
public void testIsFalseTap_RobustCheck_FaceAuth() {
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(true);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
when(mFalsingDataProvider.isJustUnlockedWithFace()).thenReturn(true);
assertThat(mBrightLineFalsingManager.isFalseTap(true)).isFalse();
}
@Test
public void testIsFalseDoubleTap() {
- when(mDoubleTapClassifier.isFalseTouch()).thenReturn(false);
+ when(mDoubleTapClassifier.classifyGesture()).thenReturn(mPassedResult);
assertThat(mBrightLineFalsingManager.isFalseDoubleTap()).isFalse();
- when(mDoubleTapClassifier.isFalseTouch()).thenReturn(true);
+ when(mDoubleTapClassifier.classifyGesture()).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseDoubleTap()).isTrue();
}
+
+ @Test
+ public void testHistory() {
+ ArgumentCaptor<GestureCompleteListener> gestureCompleteListenerCaptor =
+ ArgumentCaptor.forClass(GestureCompleteListener.class);
+
+ verify(mFalsingDataProvider).addGestureCompleteListener(
+ gestureCompleteListenerCaptor.capture());
+
+ GestureCompleteListener gestureCompleteListener = gestureCompleteListenerCaptor.getValue();
+ gestureCompleteListener.onGestureComplete();
+
+ verify(mHistoryTracker).addResults(any(Collection.class), eq(mSystemClock.uptimeMillis()));
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/DiagonalClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/DiagonalClassifierTest.java
index 7659db8..dafc871 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/DiagonalClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/DiagonalClassifierTest.java
@@ -69,93 +69,93 @@
@Test
public void testPass_UnknownAngle() {
when(mDataProvider.getAngle()).thenReturn(Float.MAX_VALUE);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_VerticalSwipe() {
when(mDataProvider.getAngle()).thenReturn(UP_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(DOWN_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_MostlyVerticalSwipe() {
when(mDataProvider.getAngle()).thenReturn(UP_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(UP_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(DOWN_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(DOWN_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS * 2);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_BarelyVerticalSwipe() {
when(mDataProvider.getAngle()).thenReturn(
UP_IN_RADIANS - FORTY_FIVE_DEG_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(
UP_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(
DOWN_IN_RADIANS - FORTY_FIVE_DEG_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(
DOWN_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS * 2);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_HorizontalSwipe() {
when(mDataProvider.getAngle()).thenReturn(RIGHT_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(LEFT_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_MostlyHorizontalSwipe() {
when(mDataProvider.getAngle()).thenReturn(RIGHT_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(RIGHT_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(LEFT_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(LEFT_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_BarelyHorizontalSwipe() {
when(mDataProvider.getAngle()).thenReturn(
RIGHT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(
LEFT_IN_RADIANS - FORTY_FIVE_DEG_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(
LEFT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - 2 * FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getAngle()).thenReturn(
RIGHT_IN_RADIANS - FORTY_FIVE_DEG_IN_RADIANS + 2 * FIVE_DEG_IN_RADIANS * 2);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -163,12 +163,12 @@
when(mDataProvider.getInteractionType()).thenReturn(LEFT_AFFORDANCE);
when(mDataProvider.getAngle()).thenReturn(
RIGHT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.getInteractionType()).thenReturn(RIGHT_AFFORDANCE);
when(mDataProvider.getAngle()).thenReturn(
LEFT_IN_RADIANS - FORTY_FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
// This classifier may return false for other angles, but these are the only
// two that actually matter, as affordances generally only travel in these two directions.
@@ -182,37 +182,37 @@
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.getAngle()).thenReturn(
RIGHT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.getAngle()).thenReturn(
UP_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS + FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.getAngle()).thenReturn(
LEFT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.getAngle()).thenReturn(
DOWN_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS + FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
// Vertical Swipes
when(mDataProvider.isVertical()).thenReturn(true);
when(mDataProvider.getAngle()).thenReturn(
RIGHT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS + FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.getAngle()).thenReturn(
UP_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.getAngle()).thenReturn(
LEFT_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS + FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.getAngle()).thenReturn(
DOWN_IN_RADIANS + FORTY_FIVE_DEG_IN_RADIANS - FIVE_DEG_IN_RADIANS);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/DistanceClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/DistanceClassifierTest.java
index 013fa36..f6c1424 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/DistanceClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/DistanceClassifierTest.java
@@ -51,32 +51,32 @@
@Test
public void testPass_noPointer() {
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
public void testPass_fling() {
mClassifier.onTouchEvent(appendDownEvent(1, 1));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mClassifier.onTouchEvent(appendMoveEvent(1, 40));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mClassifier.onTouchEvent(appendUpEvent(1, 80));
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testFail_flingShort() {
mClassifier.onTouchEvent(appendDownEvent(1, 1));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mClassifier.onTouchEvent(appendMoveEvent(1, 2));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mClassifier.onTouchEvent(appendUpEvent(1, 10));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -84,26 +84,26 @@
// These events, in testing, result in a fling that falls just short of the threshold.
mClassifier.onTouchEvent(appendDownEvent(1, 1, 1));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mClassifier.onTouchEvent(appendMoveEvent(1, 15, 2));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mClassifier.onTouchEvent(appendMoveEvent(1, 16, 3));
mClassifier.onTouchEvent(appendMoveEvent(1, 17, 300));
mClassifier.onTouchEvent(appendMoveEvent(1, 18, 301));
mClassifier.onTouchEvent(appendUpEvent(1, 19, 501));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
public void testPass_swipe() {
mClassifier.onTouchEvent(appendDownEvent(1, 1));
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mClassifier.onTouchEvent(appendMoveEvent(1, mDataProvider.getYdpi() * 3, 3));
mClassifier.onTouchEvent(appendUpEvent(1, mDataProvider.getYdpi() * 3, 300));
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java
index 4c4108a0..17c2700 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java
@@ -55,6 +55,9 @@
private SingleTapClassifier mSingleTapClassifier;
private DoubleTapClassifier mClassifier;
+ private final FalsingClassifier.Result mFalsedResult = FalsingClassifier.Result.falsed(1, "");
+ private final FalsingClassifier.Result mPassedResult = FalsingClassifier.Result.passed(1);
+
@Before
public void setup() {
super.setup();
@@ -77,17 +80,17 @@
@Test
public void testSingleTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, TOUCH_SLOP, 1);
- boolean result = mClassifier.isFalseTouch();
+ boolean result = mClassifier.classifyGesture().isFalse();
assertThat("Single tap recognized as a valid double tap", result, is(true));
}
@Test
public void testDoubleTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mPassedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -97,13 +100,13 @@
addMotionEvent(2, 2, MotionEvent.ACTION_DOWN, TOUCH_SLOP, TOUCH_SLOP);
addMotionEvent(2, 3, MotionEvent.ACTION_UP, TOUCH_SLOP, TOUCH_SLOP);
- boolean result = mClassifier.isFalseTouch();
- assertThat(mClassifier.getReason(), result, is(false));
+ FalsingClassifier.Result result = mClassifier.classifyGesture();
+ assertThat(result.getReason(), result.isFalse(), is(false));
}
@Test
public void testBadFirstTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(false, true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mPassedResult, mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -113,13 +116,13 @@
addMotionEvent(2, 2, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(2, 3, MotionEvent.ACTION_UP, 1, 1);
- boolean result = mClassifier.isFalseTouch();
+ boolean result = mClassifier.classifyGesture().isFalse();
assertThat("Bad first touch allowed", result, is(true));
}
@Test
public void testBadSecondTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true, false);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult, mPassedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -129,13 +132,13 @@
addMotionEvent(2, 2, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(2, 3, MotionEvent.ACTION_UP, 1, 1);
- boolean result = mClassifier.isFalseTouch();
+ boolean result = mClassifier.classifyGesture().isFalse();
assertThat("Bad second touch allowed", result, is(true));
}
@Test
public void testBadTouchSlop() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -145,13 +148,13 @@
addMotionEvent(2, 2, MotionEvent.ACTION_DOWN, TOUCH_SLOP + 1, TOUCH_SLOP);
addMotionEvent(2, 3, MotionEvent.ACTION_UP, TOUCH_SLOP, TOUCH_SLOP + 1);
- boolean result = mClassifier.isFalseTouch();
+ boolean result = mClassifier.classifyGesture().isFalse();
assertThat("Sloppy second touch allowed", result, is(true));
}
@Test
public void testBadTouchSlow() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -163,7 +166,7 @@
addMotionEvent(DOUBLE_TAP_TIMEOUT_MS + 1, DOUBLE_TAP_TIMEOUT_MS + 2,
MotionEvent.ACTION_UP, 1, 1);
- boolean result = mClassifier.isFalseTouch();
+ boolean result = mClassifier.classifyGesture().isFalse();
assertThat("Slow second tap allowed", result, is(true));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java
new file mode 100644
index 0000000..01cce35
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2020 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.systemui.classifier;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.testing.AndroidTestingRunner;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.util.time.FakeSystemClock;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
+
+import java.util.Collections;
+
+@SmallTest
+@RunWith(AndroidTestingRunner.class)
+public class HistoryTrackerTest extends SysuiTestCase {
+
+ private FakeSystemClock mSystemClock = new FakeSystemClock();
+
+ private HistoryTracker mHistoryTracker;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ mHistoryTracker = new HistoryTracker(mSystemClock);
+ }
+
+ @Test
+ public void testNoDataNoPenalty() {
+ assertThat(mHistoryTracker.falsePenalty()).isEqualTo(0);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(0);
+ }
+
+ @Test
+ public void testOneResultFullConfidence() {
+ addResult(true, 1);
+ assertThat(mHistoryTracker.falsePenalty()).isEqualTo(1);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(1);
+ }
+
+ @Test
+ public void testMultipleResultsSameTimestamp() {
+ addResult(true, 1);
+ addResult(false, 1);
+
+ assertThat(mHistoryTracker.falsePenalty()).isEqualTo(0.5);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(0.5);
+ }
+
+ @Test
+ public void testMultipleConfidences() {
+ addResult(true, 1);
+ addResult(true, 0);
+
+ assertThat(mHistoryTracker.falsePenalty()).isEqualTo(0.75);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(.75);
+ }
+
+ @Test
+ public void testDecay() {
+ addResult(true, 1);
+
+ assertThat(mHistoryTracker.falsePenalty()).isEqualTo(1);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(1);
+
+ mSystemClock.advanceTime(1000);
+
+ assertThat(mHistoryTracker.falsePenalty()).isWithin(0.01).of(0.1);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(1);
+ }
+
+ @Test
+ public void testMultipleResultsDifferentTimestamp() {
+ addResult(true, 1);
+ mSystemClock.advanceTime(1000);
+ addResult(false, .5);
+
+ assertThat(mHistoryTracker.falsePenalty()).isWithin(0.01).of(0.17);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(0.625);
+ }
+
+ @Test
+ public void testCompleteDecay() {
+ addResult(true, 1);
+
+ assertThat(mHistoryTracker.falsePenalty()).isEqualTo(1);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(1);
+
+ mSystemClock.advanceTime(2999);
+
+ assertThat(mHistoryTracker.falsePenalty()).isGreaterThan(0);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(1);
+
+ mSystemClock.advanceTime(1);
+
+ assertThat(mHistoryTracker.falsePenalty()).isEqualTo(0);
+ assertThat(mHistoryTracker.falseConfidence()).isEqualTo(0);
+ }
+
+ private void addResult(boolean falsed, double confidence) {
+ mHistoryTracker.addResults(Collections.singletonList(
+ falsed
+ ? FalsingClassifier.Result.falsed(confidence, "test")
+ : FalsingClassifier.Result.passed(confidence)),
+ mSystemClock.uptimeMillis());
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/PointerCountClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/PointerCountClassifierTest.java
index ee289b5..76802f4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/PointerCountClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/PointerCountClassifierTest.java
@@ -50,13 +50,13 @@
@Test
public void testPass_noPointer() {
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_singlePointer() {
mClassifier.onTouchEvent(appendDownEvent(1, 1));
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -72,7 +72,7 @@
0, 0);
mClassifier.onTouchEvent(motionEvent);
motionEvent.recycle();
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -89,6 +89,6 @@
mClassifier.onTouchEvent(motionEvent);
motionEvent.recycle();
getDataProvider().setInteractionType(QUICK_SETTINGS);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java
index 38b025f..ba8ca9a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java
@@ -50,12 +50,16 @@
private DistanceClassifier mDistanceClassifier;
private FalsingClassifier mClassifier;
+ private final FalsingClassifier.Result mFalsedResult =
+ FalsingClassifier.Result.falsed(1, "test");
+ private final FalsingClassifier.Result mPassedResult = FalsingClassifier.Result.passed(1);
+
@Before
public void setup() {
super.setup();
MockitoAnnotations.initMocks(this);
when(mDataProvider.getInteractionType()).thenReturn(GENERIC);
- when(mDistanceClassifier.isLongSwipe()).thenReturn(false);
+ when(mDistanceClassifier.isLongSwipe()).thenReturn(mFalsedResult);
mClassifier = new ProximityClassifier(
mDistanceClassifier, mDataProvider, new DeviceConfigProxyFake());
}
@@ -69,7 +73,7 @@
public void testPass_uncovered() {
touchDown();
touchUp(10);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -78,7 +82,7 @@
mClassifier.onProximityEvent(createSensorEvent(true, 1));
mClassifier.onProximityEvent(createSensorEvent(false, 2));
touchUp(20);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -88,7 +92,7 @@
mClassifier.onProximityEvent(createSensorEvent(true, 1));
mClassifier.onProximityEvent(createSensorEvent(false, 11));
touchUp(10);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -97,7 +101,7 @@
mClassifier.onProximityEvent(createSensorEvent(true, 1));
mClassifier.onProximityEvent(createSensorEvent(false, 11));
touchUp(10);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -108,7 +112,7 @@
mClassifier.onProximityEvent(createSensorEvent(true, 96));
mClassifier.onProximityEvent(createSensorEvent(false, 100));
touchUp(100);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -117,8 +121,8 @@
mClassifier.onProximityEvent(createSensorEvent(true, 1));
mClassifier.onProximityEvent(createSensorEvent(false, 11));
touchUp(10);
- when(mDistanceClassifier.isLongSwipe()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ when(mDistanceClassifier.isLongSwipe()).thenReturn(mPassedResult);
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
private void touchDown() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java
index 941e12e..62c876f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java
@@ -70,14 +70,14 @@
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, TOUCH_SLOP, 1);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
mMotionEvents.clear();
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, -TOUCH_SLOP + 2, 1);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@@ -86,14 +86,14 @@
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, TOUCH_SLOP);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
mMotionEvents.clear();
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, -TOUCH_SLOP + 2);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@@ -102,14 +102,14 @@
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, TOUCH_SLOP + 1, 1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mMotionEvents.clear();
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, -TOUCH_SLOP - 1, 1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@@ -118,14 +118,14 @@
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, TOUCH_SLOP + 1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
mMotionEvents.clear();
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, -TOUCH_SLOP - 1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -134,7 +134,7 @@
addMotionEvent(0, 1, MotionEvent.ACTION_MOVE, 1, TOUCH_SLOP + 1);
addMotionEvent(0, 2, MotionEvent.ACTION_UP, 1, 1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -142,12 +142,12 @@
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
- assertThat(mClassifier.isTap(mMotionEvents), is(true));
+ assertThat(mClassifier.isTap(mMotionEvents).isFalse(), is(false));
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, TOUCH_SLOP + 1);
- assertThat(mClassifier.isTap(mMotionEvents), is(false));
+ assertThat(mClassifier.isTap(mMotionEvents).isFalse(), is(true));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/TypeClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/TypeClassifierTest.java
index 6b9bb4f..4a896a8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/TypeClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/TypeClassifierTest.java
@@ -61,10 +61,10 @@
when(mDataProvider.isUp()).thenReturn(false);
when(mDataProvider.isRight()).thenReturn(false); // right should cause no effect.
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -73,11 +73,11 @@
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isVertical()).thenReturn(true);
when(mDataProvider.isUp()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -87,10 +87,10 @@
when(mDataProvider.isUp()).thenReturn(false);
when(mDataProvider.isRight()).thenReturn(false); // right should cause no effect.
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -99,11 +99,11 @@
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isVertical()).thenReturn(true);
when(mDataProvider.isUp()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -113,10 +113,10 @@
when(mDataProvider.isUp()).thenReturn(false);
when(mDataProvider.isRight()).thenReturn(false); // right should cause no effect.
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -125,11 +125,11 @@
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isVertical()).thenReturn(true);
when(mDataProvider.isUp()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -139,19 +139,19 @@
when(mDataProvider.isUp()).thenReturn(false); // up and right should cause no effect.
when(mDataProvider.isRight()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isUp()).thenReturn(true);
when(mDataProvider.isRight()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isUp()).thenReturn(false);
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isUp()).thenReturn(true);
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -161,19 +161,19 @@
when(mDataProvider.isUp()).thenReturn(false); // up and right should cause no effect.
when(mDataProvider.isRight()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isUp()).thenReturn(true);
when(mDataProvider.isRight()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isUp()).thenReturn(false);
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isUp()).thenReturn(true);
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@@ -185,10 +185,10 @@
when(mDataProvider.isRight()).thenReturn(false); // right should cause no effect.
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -197,15 +197,15 @@
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isVertical()).thenReturn(true);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -216,10 +216,10 @@
when(mDataProvider.isRight()).thenReturn(false); // right should cause no effect.
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -228,15 +228,15 @@
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isVertical()).thenReturn(true);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isVertical()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -247,10 +247,10 @@
when(mDataProvider.isVertical()).thenReturn(false); // vertical should cause no effect.
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isVertical()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -259,15 +259,15 @@
when(mDataProvider.isRight()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isRight()).thenReturn(true);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isRight()).thenReturn(false);
when(mDataProvider.isUp()).thenReturn(false);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -278,10 +278,10 @@
when(mDataProvider.isVertical()).thenReturn(false); // vertical should cause no effect.
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
when(mDataProvider.isVertical()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -290,14 +290,14 @@
when(mDataProvider.isUp()).thenReturn(true);
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isUp()).thenReturn(false);
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
when(mDataProvider.isUp()).thenReturn(false);
when(mDataProvider.isRight()).thenReturn(true);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/ZigZagClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/ZigZagClassifierTest.java
index 339dd9e..09bee12 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/ZigZagClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/ZigZagClassifierTest.java
@@ -51,11 +51,11 @@
@Test
public void testPass_fewTouchesVertical() {
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
appendMoveEvent(0, 0);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
appendMoveEvent(0, 100);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -63,16 +63,16 @@
appendMoveEvent(0, 0);
appendMoveEvent(0, 100);
appendMoveEvent(0, 200);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
public void testPass_fewTouchesHorizontal() {
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
appendMoveEvent(0, 0);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
appendMoveEvent(100, 0);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -80,7 +80,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(100, 0);
appendMoveEvent(200, 0);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@@ -89,7 +89,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(0, 100);
appendMoveEvent(0, 1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -97,7 +97,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(100, 0);
appendMoveEvent(1, 0);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -105,7 +105,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(10, 10);
appendMoveEvent(20, 20);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -115,7 +115,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(5, 100);
appendMoveEvent(-5, 200);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -125,7 +125,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(100, 5);
appendMoveEvent(200, -5);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
@Test
@@ -135,7 +135,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(6, 10);
appendMoveEvent(-6, 20);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -145,7 +145,7 @@
appendMoveEvent(0, 0);
appendMoveEvent(10, 5);
appendMoveEvent(20, -5);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -153,25 +153,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(100, 5);
appendMoveEvent(200, 10);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(100, 0);
appendMoveEvent(200, 10);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(100, -10);
appendMoveEvent(200, 10);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(100, -10);
appendMoveEvent(200, 50);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -179,25 +179,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(10, 50);
appendMoveEvent(8, 100);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(1, 800);
appendMoveEvent(2, 900);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-10, 600);
appendMoveEvent(30, 700);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(40, 100);
appendMoveEvent(0, 101);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -205,25 +205,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(-10, 50);
appendMoveEvent(-24, 100);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-20, 800);
appendMoveEvent(-20, 900);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(30, 600);
appendMoveEvent(-10, 700);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-80, 100);
appendMoveEvent(-10, 101);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -231,25 +231,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(-120, 10);
appendMoveEvent(-200, 20);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-20, 8);
appendMoveEvent(-40, 2);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-500, -2);
appendMoveEvent(-600, 70);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-80, 100);
appendMoveEvent(-100, 1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -257,25 +257,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(-120, -10);
appendMoveEvent(-200, -20);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-20, -8);
appendMoveEvent(-40, -2);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-500, 2);
appendMoveEvent(-600, -70);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-80, -100);
appendMoveEvent(-100, -1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -283,25 +283,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(-12, -20);
appendMoveEvent(-20, -40);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-20, -130);
appendMoveEvent(-40, -260);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(1, -100);
appendMoveEvent(-6, -200);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-80, -100);
appendMoveEvent(-10, -110);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -309,25 +309,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(12, -20);
appendMoveEvent(20, -40);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(20, -130);
appendMoveEvent(40, -260);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(-1, -100);
appendMoveEvent(6, -200);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(80, -100);
appendMoveEvent(10, -110);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
@@ -335,25 +335,25 @@
appendMoveEvent(0, 0);
appendMoveEvent(120, -20);
appendMoveEvent(200, -40);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(200, -13);
appendMoveEvent(400, -30);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(100, 10);
appendMoveEvent(600, -20);
- assertThat(mClassifier.isFalseTouch(), is(false));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(false));
resetDataProvider();
appendMoveEvent(0, 0);
appendMoveEvent(80, -100);
appendMoveEvent(100, -1);
- assertThat(mClassifier.isFalseTouch(), is(true));
+ assertThat(mClassifier.classifyGesture().isFalse(), is(true));
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSensorsTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSensorsTest.java
index 0059881..2320f4e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSensorsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeSensorsTest.java
@@ -31,7 +31,6 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.app.AlarmManager;
import android.database.ContentObserver;
import android.hardware.Sensor;
import android.hardware.display.AmbientDisplayConfiguration;
@@ -65,8 +64,6 @@
public class DozeSensorsTest extends SysuiTestCase {
@Mock
- private AlarmManager mAlarmManager;
- @Mock
private AsyncSensorManager mSensorManager;
@Mock
private DozeParameters mDozeParameters;
@@ -79,8 +76,6 @@
@Mock
private Consumer<Boolean> mProxCallback;
@Mock
- private AlwaysOnDisplayPolicy mAlwaysOnDisplayPolicy;
- @Mock
private TriggerSensor mTriggerSensor;
@Mock
private DozeLog mDozeLog;
@@ -115,7 +110,7 @@
@Test
public void testSensorDebounce() {
- mDozeSensors.setListening(true);
+ mDozeSensors.setListening(true, true);
mWakeLockScreenListener.onSensorChanged(mock(SensorManagerPlugin.SensorEvent.class));
mTestableLooper.processAllMessages();
@@ -133,7 +128,7 @@
@Test
public void testSetListening_firstTrue_registerSettingsObserver() {
verify(mSensorManager, never()).registerListener(any(), any(Sensor.class), anyInt());
- mDozeSensors.setListening(true);
+ mDozeSensors.setListening(true, true);
verify(mTriggerSensor).registerSettingsObserver(any(ContentObserver.class));
}
@@ -141,8 +136,8 @@
@Test
public void testSetListening_twiceTrue_onlyRegisterSettingsObserverOnce() {
verify(mSensorManager, never()).registerListener(any(), any(Sensor.class), anyInt());
- mDozeSensors.setListening(true);
- mDozeSensors.setListening(true);
+ mDozeSensors.setListening(true, true);
+ mDozeSensors.setListening(true, true);
verify(mTriggerSensor, times(1)).registerSettingsObserver(any(ContentObserver.class));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
index 4bbba56..27187a8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
@@ -154,6 +154,7 @@
clearInvocations(mSensors);
mTriggers.transitionTo(DozeMachine.State.DOZE_PULSING, DozeMachine.State.DOZE_PULSE_DONE);
+ mTriggers.transitionTo(DozeMachine.State.DOZE_PULSE_DONE, DozeMachine.State.DOZE_AOD);
waitForSensorManager();
verify(mSensors).requestTriggerSensor(any(), eq(mTapSensor));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
index c897d8a..fd5d996 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
@@ -35,6 +35,7 @@
import androidx.core.graphics.drawable.IconCompat;
import androidx.test.filters.SmallTest;
+import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
@@ -61,6 +62,7 @@
private ActivityStarter mStarter = mock(ActivityStarter.class);
private NotificationEntryManager mNotificationEntryManager =
mock(NotificationEntryManager.class);
+ private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class);
private MediaOutputBaseDialogImpl mMediaOutputBaseDialogImpl;
private MediaOutputController mMediaOutputController;
@@ -73,7 +75,7 @@
public void setUp() {
mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE, false,
mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter,
- mNotificationEntryManager);
+ mNotificationEntryManager, mUiEventLogger);
mMediaOutputBaseDialogImpl = new MediaOutputBaseDialogImpl(mContext,
mMediaOutputController);
mMediaOutputBaseDialogImpl.onCreate(new Bundle());
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java
index 0d352c1..d1a617b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java
@@ -42,6 +42,7 @@
import androidx.core.graphics.drawable.IconCompat;
import androidx.test.filters.SmallTest;
+import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.media.LocalMediaManager;
@@ -89,6 +90,7 @@
private ActivityStarter mStarter = mock(ActivityStarter.class);
private NotificationEntryManager mNotificationEntryManager =
mock(NotificationEntryManager.class);
+ private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class);
private Context mSpyContext;
private MediaOutputController mMediaOutputController;
@@ -111,7 +113,7 @@
mMediaOutputController = new MediaOutputController(mSpyContext, TEST_PACKAGE_NAME, false,
mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter,
- mNotificationEntryManager);
+ mNotificationEntryManager, mUiEventLogger);
mLocalMediaManager = spy(mMediaOutputController.mLocalMediaManager);
mMediaOutputController.mLocalMediaManager = mLocalMediaManager;
MediaDescription.Builder builder = new MediaDescription.Builder();
@@ -155,7 +157,7 @@
public void start_withoutPackageName_verifyMediaControllerInit() {
mMediaOutputController = new MediaOutputController(mSpyContext, null, false,
mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter,
- mNotificationEntryManager);
+ mNotificationEntryManager, mUiEventLogger);
mMediaOutputController.start(mCb);
@@ -176,7 +178,7 @@
public void stop_withoutPackageName_verifyMediaControllerDeinit() {
mMediaOutputController = new MediaOutputController(mSpyContext, null, false,
mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter,
- mNotificationEntryManager);
+ mNotificationEntryManager, mUiEventLogger);
mMediaOutputController.start(mCb);
@@ -200,8 +202,10 @@
@Test
public void onSelectedDeviceStateChanged_verifyCallback() {
+ when(mLocalMediaManager.getCurrentConnectedDevice()).thenReturn(mMediaDevice2);
mMediaOutputController.start(mCb);
reset(mCb);
+ mMediaOutputController.connectDevice(mMediaDevice1);
mMediaOutputController.onSelectedDeviceStateChanged(mMediaDevice1,
LocalMediaManager.MediaDeviceState.STATE_CONNECTED);
@@ -221,8 +225,10 @@
@Test
public void onRequestFailed_verifyCallback() {
+ when(mLocalMediaManager.getCurrentConnectedDevice()).thenReturn(mMediaDevice1);
mMediaOutputController.start(mCb);
reset(mCb);
+ mMediaOutputController.connectDevice(mMediaDevice2);
mMediaOutputController.onRequestFailed(0 /* reason */);
@@ -268,6 +274,8 @@
@Test
public void connectDevice_verifyConnect() {
+ when(mLocalMediaManager.getCurrentConnectedDevice()).thenReturn(mMediaDevice2);
+
mMediaOutputController.connectDevice(mMediaDevice1);
// Wait for background thread execution
@@ -441,7 +449,7 @@
public void getNotificationLargeIcon_withoutPackageName_returnsNull() {
mMediaOutputController = new MediaOutputController(mSpyContext, null, false,
mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter,
- mNotificationEntryManager);
+ mNotificationEntryManager, mUiEventLogger);
assertThat(mMediaOutputController.getNotificationIcon()).isNull();
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
index c1e7db1..86f6bde 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
@@ -19,6 +19,8 @@
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.media.MediaRoute2Info;
@@ -29,6 +31,7 @@
import androidx.test.filters.SmallTest;
+import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.media.LocalMediaManager;
import com.android.settingslib.media.MediaDevice;
@@ -53,26 +56,28 @@
private static final String TEST_PACKAGE = "test_package";
// Mock
- private MediaSessionManager mMediaSessionManager = mock(MediaSessionManager.class);
- private LocalBluetoothManager mLocalBluetoothManager = mock(LocalBluetoothManager.class);
- private ShadeController mShadeController = mock(ShadeController.class);
- private ActivityStarter mStarter = mock(ActivityStarter.class);
- private LocalMediaManager mLocalMediaManager = mock(LocalMediaManager.class);
- private MediaDevice mMediaDevice = mock(MediaDevice.class);
- private NotificationEntryManager mNotificationEntryManager =
+ private final MediaSessionManager mMediaSessionManager = mock(MediaSessionManager.class);
+ private final LocalBluetoothManager mLocalBluetoothManager = mock(LocalBluetoothManager.class);
+ private final ShadeController mShadeController = mock(ShadeController.class);
+ private final ActivityStarter mStarter = mock(ActivityStarter.class);
+ private final LocalMediaManager mLocalMediaManager = mock(LocalMediaManager.class);
+ private final MediaDevice mMediaDevice = mock(MediaDevice.class);
+ private final NotificationEntryManager mNotificationEntryManager =
mock(NotificationEntryManager.class);
+ private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class);
private MediaOutputDialog mMediaOutputDialog;
private MediaOutputController mMediaOutputController;
- private List<String> mFeatures = new ArrayList<>();
+ private final List<String> mFeatures = new ArrayList<>();
@Before
public void setUp() {
mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE, false,
mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter,
- mNotificationEntryManager);
+ mNotificationEntryManager, mUiEventLogger);
mMediaOutputController.mLocalMediaManager = mLocalMediaManager;
- mMediaOutputDialog = new MediaOutputDialog(mContext, false, mMediaOutputController);
+ mMediaOutputDialog = new MediaOutputDialog(mContext, false,
+ mMediaOutputController, mUiEventLogger);
when(mLocalMediaManager.getCurrentConnectedDevice()).thenReturn(mMediaDevice);
when(mMediaDevice.getFeatures()).thenReturn(mFeatures);
@@ -112,4 +117,16 @@
assertThat(mMediaOutputDialog.getStopButtonVisibility()).isEqualTo(View.GONE);
}
+ @Test
+ // Check the visibility metric logging by creating a new MediaOutput dialog,
+ // and verify if the calling times increases.
+ public void onCreate_ShouldLogVisibility() {
+ MediaOutputDialog testDialog = new MediaOutputDialog(mContext, false,
+ mMediaOutputController, mUiEventLogger);
+
+ testDialog.dismissDialog();
+
+ verify(mUiEventLogger, times(2))
+ .log(MediaOutputDialog.MediaOutputEvent.MEDIA_OUTPUT_DIALOG_SHOW);
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java
index 5813350..c296ff5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputGroupDialogTest.java
@@ -28,6 +28,7 @@
import androidx.test.filters.SmallTest;
+import com.android.internal.logging.UiEventLogger;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.media.LocalMediaManager;
import com.android.settingslib.media.MediaDevice;
@@ -62,6 +63,7 @@
private MediaDevice mMediaDevice1 = mock(MediaDevice.class);
private NotificationEntryManager mNotificationEntryManager =
mock(NotificationEntryManager.class);
+ private final UiEventLogger mUiEventLogger = mock(UiEventLogger.class);
private MediaOutputGroupDialog mMediaOutputGroupDialog;
private MediaOutputController mMediaOutputController;
@@ -71,7 +73,7 @@
public void setUp() {
mMediaOutputController = new MediaOutputController(mContext, TEST_PACKAGE, false,
mMediaSessionManager, mLocalBluetoothManager, mShadeController, mStarter,
- mNotificationEntryManager);
+ mNotificationEntryManager, mUiEventLogger);
mMediaOutputController.mLocalMediaManager = mLocalMediaManager;
mMediaOutputGroupDialog = new MediaOutputGroupDialog(mContext, false,
mMediaOutputController);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt
index 3e83498..a8b3056 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/privacy/PrivacyItemControllerTest.kt
@@ -343,6 +343,83 @@
assertTrue(values[values.size - 1].contains(expected.toLog()))
}
+ @Test
+ fun testListRequestedForAllUsers() {
+ privacyItemController.addCallback(callback)
+ executor.runAllReady()
+ verify(appOpsController).getActiveAppOpsForUser(UserHandle.USER_ALL)
+ }
+
+ @Test
+ fun testListFilterCurrentUser() {
+ val otherUser = CURRENT_USER_ID + 1
+ val otherUserUid = otherUser * UserHandle.PER_USER_RANGE
+ `when`(userTracker.userProfiles).thenReturn(listOf(UserInfo(otherUser, "", 0)))
+
+ doReturn(listOf(
+ AppOpItem(AppOpsManager.OP_COARSE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, 0),
+ AppOpItem(AppOpsManager.OP_CAMERA, otherUserUid, TEST_PACKAGE_NAME, 0))
+ ).`when`(appOpsController).getActiveAppOpsForUser(anyInt())
+
+ privacyItemController.userTrackerCallback.onUserChanged(otherUser, mContext)
+ executor.runAllReady()
+
+ privacyItemController.addCallback(callback)
+ executor.runAllReady()
+
+ verify(callback).onPrivacyItemsChanged(capture(argCaptor))
+
+ assertEquals(1, argCaptor.value.size)
+ assertEquals(PrivacyType.TYPE_CAMERA, argCaptor.value[0].privacyType)
+ assertEquals(otherUserUid, argCaptor.value[0].application.uid)
+ }
+
+ @Test
+ fun testAlwaysGetPhoneCameraOps() {
+ val otherUser = CURRENT_USER_ID + 1
+ `when`(userTracker.userProfiles).thenReturn(listOf(UserInfo(otherUser, "", 0)))
+
+ doReturn(listOf(
+ AppOpItem(AppOpsManager.OP_COARSE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, 0),
+ AppOpItem(AppOpsManager.OP_RECORD_AUDIO, TEST_UID, TEST_PACKAGE_NAME, 0),
+ AppOpItem(AppOpsManager.OP_PHONE_CALL_CAMERA, TEST_UID, TEST_PACKAGE_NAME, 0))
+ ).`when`(appOpsController).getActiveAppOpsForUser(anyInt())
+
+ privacyItemController.userTrackerCallback.onUserChanged(otherUser, mContext)
+ executor.runAllReady()
+
+ privacyItemController.addCallback(callback)
+ executor.runAllReady()
+
+ verify(callback).onPrivacyItemsChanged(capture(argCaptor))
+
+ assertEquals(1, argCaptor.value.size)
+ assertEquals(PrivacyType.TYPE_CAMERA, argCaptor.value[0].privacyType)
+ }
+
+ @Test
+ fun testAlwaysGetPhoneMicOps() {
+ val otherUser = CURRENT_USER_ID + 1
+ `when`(userTracker.userProfiles).thenReturn(listOf(UserInfo(otherUser, "", 0)))
+
+ doReturn(listOf(
+ AppOpItem(AppOpsManager.OP_COARSE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, 0),
+ AppOpItem(AppOpsManager.OP_CAMERA, TEST_UID, TEST_PACKAGE_NAME, 0),
+ AppOpItem(AppOpsManager.OP_PHONE_CALL_MICROPHONE, TEST_UID, TEST_PACKAGE_NAME, 0))
+ ).`when`(appOpsController).getActiveAppOpsForUser(anyInt())
+
+ privacyItemController.userTrackerCallback.onUserChanged(otherUser, mContext)
+ executor.runAllReady()
+
+ privacyItemController.addCallback(callback)
+ executor.runAllReady()
+
+ verify(callback).onPrivacyItemsChanged(capture(argCaptor))
+
+ assertEquals(1, argCaptor.value.size)
+ assertEquals(PrivacyType.TYPE_MICROPHONE, argCaptor.value[0].privacyType)
+ }
+
private fun changeMicCamera(value: Boolean?) = changeProperty(MIC_CAMERA, value)
private fun changeAll(value: Boolean?) = changeProperty(ALL_INDICATORS, value)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
index b0e17cd..5fc01cc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
@@ -629,10 +629,8 @@
return new Notification.Action.Builder(
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
"action",
- // TODO(b/174935104) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
+ PendingIntent.FLAG_IMMUTABLE)).build();
}
private static class FakeNotificationLifetimeExtender implements NotificationLifetimeExtender {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java
index 01b3d8e..241451e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java
@@ -233,10 +233,8 @@
return new Notification.Action.Builder(
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
title,
- // TODO(b/174965424) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED))
+ PendingIntent.FLAG_IMMUTABLE))
.setContextual(true)
.build();
}
@@ -245,10 +243,8 @@
return new Notification.Action.Builder(
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
title,
- // TODO(b/174965424) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
+ PendingIntent.FLAG_IMMUTABLE)).build();
}
private ArrayList<Notification.Action> createActions(String... titles) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
index d606316..60c3bc8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
@@ -476,10 +476,8 @@
private NotificationEntry createBubble() {
Notification.BubbleMetadata data = new Notification.BubbleMetadata.Builder(
- // TODO(b/174970399) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED),
+ PendingIntent.FLAG_MUTABLE),
Icon.createWithResource(mContext.getResources(), R.drawable.android))
.build();
Notification n = new Notification.Builder(getContext(), "a")
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java
index 738ce53..9d87579 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java
@@ -28,7 +28,6 @@
import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.eq;
@@ -56,6 +55,7 @@
import com.android.internal.statusbar.IStatusBarService;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -65,8 +65,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-
-import java.util.concurrent.CountDownLatch;
+import org.mockito.MockitoAnnotations;
@SmallTest
@RunWith(AndroidTestingRunner.class)
@@ -78,18 +77,24 @@
private FeedbackInfo mFeedbackInfo;
private final PackageManager mMockPackageManager = mock(PackageManager.class);
private final NotificationGuts mGutsParent = mock(NotificationGuts.class);
+ private final ExpandableNotificationRow mMockNotificationRow =
+ mock(ExpandableNotificationRow.class);
private StatusBarNotification mSbn;
@Mock
private NotificationEntryManager mNotificationEntryManager;
@Mock
private IStatusBarService mStatusBarService;
+ @Mock
+ private NotificationGutsManager mNotificationGutsManager;
@Before
public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
mDependency.injectTestDependency(NotificationEntryManager.class, mNotificationEntryManager);
mDependency.injectTestDependency(IStatusBarService.class, mStatusBarService);
+ mDependency.injectTestDependency(NotificationGutsManager.class, mNotificationGutsManager);
// Inflate the layout
final LayoutInflater layoutInflater = LayoutInflater.from(mContext);
@@ -108,13 +113,14 @@
mSbn = new StatusBarNotification(TEST_PACKAGE_NAME, TEST_PACKAGE_NAME, 0, null, TEST_UID, 0,
new Notification(), UserHandle.CURRENT, null, 0);
+
}
@Test
public void testBindNotification_SetsTextApplicationName() {
when(mMockPackageManager.getApplicationLabel(any())).thenReturn("App Name");
mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(),
- mock(AssistantFeedbackController.class));
+ mMockNotificationRow, mock(AssistantFeedbackController.class));
final TextView textView = mFeedbackInfo.findViewById(R.id.pkg_name);
assertTrue(textView.getText().toString().contains("App Name"));
}
@@ -125,27 +131,16 @@
when(mMockPackageManager.getApplicationIcon(any(ApplicationInfo.class)))
.thenReturn(iconDrawable);
mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(),
- mock(AssistantFeedbackController.class));
+ mMockNotificationRow, mock(AssistantFeedbackController.class));
final ImageView iconView = mFeedbackInfo.findViewById(R.id.pkg_icon);
assertEquals(iconDrawable, iconView.getDrawable());
}
@Test
- public void testOk() {
- final CountDownLatch latch = new CountDownLatch(1);
- mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(),
- mock(AssistantFeedbackController.class));
-
- final View okButton = mFeedbackInfo.findViewById(R.id.ok);
- okButton.performClick();
- assertEquals(1, latch.getCount());
- verify(mGutsParent, times(1)).closeControls(any(), anyBoolean());
- }
-
- @Test
public void testPrompt_silenced() {
mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(IMPORTANCE_DEFAULT,
- IMPORTANCE_LOW, RANKING_UNCHANGED), mock(AssistantFeedbackController.class));
+ IMPORTANCE_LOW, RANKING_UNCHANGED), mMockNotificationRow,
+ mock(AssistantFeedbackController.class));
TextView prompt = mFeedbackInfo.findViewById(R.id.prompt);
assertEquals("This notification was silenced by the system. Was this correct?",
prompt.getText());
@@ -154,7 +149,8 @@
@Test
public void testPrompt_promoted_importance() {
mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(IMPORTANCE_DEFAULT,
- IMPORTANCE_HIGH, RANKING_UNCHANGED), mock(AssistantFeedbackController.class));
+ IMPORTANCE_HIGH, RANKING_UNCHANGED), mMockNotificationRow,
+ mock(AssistantFeedbackController.class));
TextView prompt = mFeedbackInfo.findViewById(R.id.prompt);
assertEquals("This notification was promoted by the system. Was this correct?",
prompt.getText());
@@ -163,7 +159,8 @@
@Test
public void testPrompt_promoted_ranking() {
mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(IMPORTANCE_DEFAULT,
- IMPORTANCE_DEFAULT, RANKING_PROMOTED), mock(AssistantFeedbackController.class));
+ IMPORTANCE_DEFAULT, RANKING_PROMOTED), mMockNotificationRow,
+ mock(AssistantFeedbackController.class));
TextView prompt = mFeedbackInfo.findViewById(R.id.prompt);
assertEquals("This notification was promoted by the system. Was this correct?",
prompt.getText());
@@ -172,7 +169,8 @@
@Test
public void testPrompt_demoted_importance() {
mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(IMPORTANCE_LOW,
- IMPORTANCE_MIN, RANKING_UNCHANGED), mock(AssistantFeedbackController.class));
+ IMPORTANCE_MIN, RANKING_UNCHANGED), mMockNotificationRow,
+ mock(AssistantFeedbackController.class));
TextView prompt = mFeedbackInfo.findViewById(R.id.prompt);
assertEquals("This notification was demoted by the system. Was this correct?",
prompt.getText());
@@ -181,12 +179,43 @@
@Test
public void testPrompt_demoted_ranking() {
mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(IMPORTANCE_DEFAULT,
- IMPORTANCE_DEFAULT, RANKING_DEMOTED), mock(AssistantFeedbackController.class));
+ IMPORTANCE_DEFAULT, RANKING_DEMOTED), mMockNotificationRow,
+ mock(AssistantFeedbackController.class));
TextView prompt = mFeedbackInfo.findViewById(R.id.prompt);
assertEquals("This notification was demoted by the system. Was this correct?",
prompt.getText());
}
+ @Test
+ public void testPositiveFeedback() {
+ mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(), mMockNotificationRow,
+ mock(AssistantFeedbackController.class));
+
+ final View yes = mFeedbackInfo.findViewById(R.id.yes);
+ yes.performClick();
+ verify(mGutsParent, times(1)).closeControls(yes, false);
+ }
+
+ @Test
+ public void testNegativeFeedback() {
+ when(mNotificationGutsManager.openGuts(
+ any(View.class),
+ anyInt(),
+ anyInt(),
+ any(NotificationMenuRowPlugin.MenuItem.class)))
+ .thenReturn(true);
+
+ mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(), mMockNotificationRow,
+ mock(AssistantFeedbackController.class));
+
+ final View no = mFeedbackInfo.findViewById(R.id.no);
+ no.performClick();
+ verify(mGutsParent, times(1)).closeControls(no, false);
+ verify(mNotificationGutsManager, times(1)).openGuts(
+ eq(mMockNotificationRow), eq(0), eq(0),
+ any());
+ }
+
private NotificationEntry getEntry(int oldImportance, int newImportance,
int rankingAdjustment) {
NotificationChannel channel = new NotificationChannel("id", "name", oldImportance);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.java
index d08b2b7..2101ea1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.java
@@ -81,12 +81,15 @@
View mockContracted = mock(NotificationHeaderView.class);
when(mockContracted.findViewById(com.android.internal.R.id.feedback))
.thenReturn(mockContracted);
+ when(mockContracted.getContext()).thenReturn(mContext);
View mockExpanded = mock(NotificationHeaderView.class);
when(mockExpanded.findViewById(com.android.internal.R.id.feedback))
.thenReturn(mockExpanded);
+ when(mockExpanded.getContext()).thenReturn(mContext);
View mockHeadsUp = mock(NotificationHeaderView.class);
when(mockHeadsUp.findViewById(com.android.internal.R.id.feedback))
.thenReturn(mockHeadsUp);
+ when(mockHeadsUp.getContext()).thenReturn(mContext);
mView.setContractedChild(mockContracted);
mView.setExpandedChild(mockExpanded);
@@ -107,18 +110,21 @@
when(mockContracted.animate()).thenReturn(mock(ViewPropertyAnimator.class));
when(mockContracted.findViewById(com.android.internal.R.id.expand_button)).thenReturn(
mockContractedEB);
+ when(mockContracted.getContext()).thenReturn(mContext);
View mockExpandedEB = mock(NotificationExpandButton.class);
View mockExpanded = mock(NotificationHeaderView.class);
when(mockExpanded.animate()).thenReturn(mock(ViewPropertyAnimator.class));
when(mockExpanded.findViewById(com.android.internal.R.id.expand_button)).thenReturn(
mockExpandedEB);
+ when(mockExpanded.getContext()).thenReturn(mContext);
View mockHeadsUpEB = mock(NotificationExpandButton.class);
View mockHeadsUp = mock(NotificationHeaderView.class);
when(mockHeadsUp.animate()).thenReturn(mock(ViewPropertyAnimator.class));
when(mockHeadsUp.findViewById(com.android.internal.R.id.expand_button)).thenReturn(
mockHeadsUpEB);
+ when(mockHeadsUp.getContext()).thenReturn(mContext);
// Set up all 3 child forms
mView.setContractedChild(mockContracted);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java
index 1387a63..291b223 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java
@@ -213,11 +213,9 @@
notification, UserHandle.CURRENT, null, 0);
mEntry = new NotificationEntryBuilder().setSbn(mSbn).setShortcutInfo(mShortcutInfo).build();
- // TODO(b/175005650) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0,
new Intent(mContext, BubblesTestActivity.class),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
mBubbleSbn = new SbnBuilder(mSbn).setBubbleMetadata(
new Notification.BubbleMetadata.Builder(bubbleIntent,
Icon.createWithResource(mContext, R.drawable.android)).build())
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java
index 43ba844..6fcc7fa 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java
@@ -455,10 +455,8 @@
private BubbleMetadata makeBubbleMetadata(PendingIntent deleteIntent) {
Intent target = new Intent(mContext, BubblesTestActivity.class);
- // TODO(b/175014468) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0, target,
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
return new BubbleMetadata.Builder(bubbleIntent,
Icon.createWithResource(mContext, R.drawable.android))
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java
index 085bd90..93a9e59 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.notification.row.wrapper;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import android.content.Context;
import android.testing.AndroidTestingRunner;
@@ -49,6 +50,7 @@
public void setup() throws Exception {
allowTestableLooperAsMainThread();
mView = mock(View.class);
+ when(mView.getContext()).thenReturn(mContext);
NotificationTestHelper helper = new NotificationTestHelper(
mContext,
mDependency,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java
index 83ef87a..c7c1823 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java
@@ -19,7 +19,6 @@
import static com.google.common.truth.Truth.assertThat;
import android.testing.AndroidTestingRunner;
-import android.testing.TestableLooper;
import androidx.test.filters.SmallTest;
@@ -31,7 +30,6 @@
@SmallTest
@RunWith(AndroidTestingRunner.class)
-@TestableLooper.RunWithLooper
public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
private static final int SCREEN_HEIGHT = 2000;
@@ -53,6 +51,7 @@
private int mPreferredClockY;
private boolean mHasCustomClock;
private boolean mHasVisibleNotifs;
+ private float mQsExpansion;
@Before
public void setUp() {
@@ -355,6 +354,17 @@
}
@Test
+ public void clockHiddenWhenQsIsExpanded() {
+ // GIVEN on the lock screen with a custom clock and visible notifications
+ givenLockScreen();
+ mQsExpansion = 1;
+ // WHEN the clock position algorithm is run
+ positionClock();
+ // THEN the clock Y position is the middle of the screen (SCREEN_HEIGHT / 2).
+ assertThat(mClockPosition.clockAlpha).isEqualTo(TRANSPARENT);
+ }
+
+ @Test
public void preferredCustomClockPositionWithVisibleNotificationsOnAod() {
// GIVEN on the lock screen with a custom clock and visible notifications
givenAOD();
@@ -384,7 +394,7 @@
mClockPositionAlgorithm.setup(EMPTY_MARGIN, SCREEN_HEIGHT, mNotificationStackHeight,
mPanelExpansion, SCREEN_HEIGHT, mKeyguardStatusHeight, mPreferredClockY,
mHasCustomClock, mHasVisibleNotifs, mDark, ZERO_DRAG, false /* bypassEnabled */,
- 0 /* unlockedStackScrollerPadding */, false /* udfpsEnrolled */);
+ 0 /* unlockedStackScrollerPadding */, false /* udfpsEnrolled */, mQsExpansion);
mClockPositionAlgorithm.run(mClockPosition);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java
index aca3424..1ac7937 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java
@@ -30,6 +30,7 @@
import androidx.test.runner.AndroidJUnit4;
import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardSecurityModel;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.dock.DockManager;
@@ -80,6 +81,8 @@
private Resources mResources;
@Mock
private HeadsUpManagerPhone mHeadsUpManagerPhone;
+ @Mock
+ private KeyguardSecurityModel mKeyguardSecurityModel;
private LockscreenLockIconController mLockIconController;
private OnAttachStateChangeListener mOnAttachStateChangeListener;
@@ -94,7 +97,7 @@
mShadeController, mAccessibilityController, mKeyguardIndicationController,
mStatusBarStateController, mConfigurationController, mNotificationWakeUpCoordinator,
mKeyguardBypassController, mDockManager, mKeyguardStateController, mResources,
- mHeadsUpManagerPhone);
+ mHeadsUpManagerPhone, mKeyguardSecurityModel);
ArgumentCaptor<OnAttachStateChangeListener> onAttachStateChangeListenerArgumentCaptor =
ArgumentCaptor.forClass(OnAttachStateChangeListener.class);
@@ -139,6 +142,15 @@
sBStateListenerCaptor.getValue().onDozingChanged(true);
verify(mLockIcon).updateIconVisibility(false);
+ }
+ @Test
+ public void testVisibility_noBouncer() {
+ // no security (ie: no lock screen OR swipe to unlock)
+ when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
+ KeyguardSecurityModel.SecurityMode.None);
+
+ mOnAttachStateChangeListener.onViewAttachedToWindow(mLockIcon);
+ verify(mLockIcon).updateIconVisibility(false);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
index d4a94a1..d452861 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
@@ -199,6 +199,8 @@
@Mock
private AuthController mAuthController;
@Mock
+ private ScrimController mScrimController;
+ @Mock
private MediaDataManager mMediaDataManager;
private NotificationPanelViewController mNotificationPanelViewController;
@@ -279,6 +281,7 @@
mNotificationAreaController,
mAuthController,
new QSDetailDisplayer(),
+ mScrimController,
mMediaDataManager);
mNotificationPanelViewController.initDependencies(
mStatusBar,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
index eaf31ed..342b2f5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
@@ -249,6 +249,20 @@
}
@Test
+ public void transitionToShadeLocked() {
+ mScrimController.transitionTo(ScrimState.SHADE_LOCKED);
+ finishAnimationsImmediately();
+
+ assertScrimAlpha(TRANSPARENT /* front */,
+ OPAQUE /* back */,
+ TRANSPARENT /* bubble */);
+
+ assertScrimTint(false /* front */,
+ false /* behind */,
+ false /* bubble */);
+ }
+
+ @Test
public void transitionToOff() {
mScrimController.transitionTo(ScrimState.OFF);
finishAnimationsImmediately();
@@ -464,7 +478,7 @@
// Front scrim should be transparent
// Back scrim should be visible without tint
assertScrimAlpha(TRANSPARENT /* front */,
- SEMI_TRANSPARENT /* back */,
+ OPAQUE /* back */,
TRANSPARENT /* bubble */);
assertScrimTint(false /* front */,
@@ -478,7 +492,7 @@
finishAnimationsImmediately();
// Front scrim should be transparent
// Back scrim should be visible without tint
- assertScrimAlpha(SEMI_TRANSPARENT /* front */,
+ assertScrimAlpha(OPAQUE /* front */,
TRANSPARENT /* back */,
TRANSPARENT /* bubble */);
assertScrimTint(false /* front */,
@@ -519,11 +533,11 @@
Assert.assertEquals(ScrimController.TRANSPARENT,
mScrimInFront.getViewAlpha(), 0.0f);
// Back scrim should be visible
- Assert.assertEquals(ScrimController.BLUR_SCRIM_ALPHA,
+ Assert.assertEquals(ScrimController.BUSY_SCRIM_ALPHA,
mScrimBehind.getViewAlpha(), 0.0f);
// Bubble scrim should be visible
- Assert.assertEquals(ScrimController.BLUR_SCRIM_ALPHA,
- mScrimBehind.getViewAlpha(), 0.0f);
+ Assert.assertEquals(ScrimController.BUBBLE_SCRIM_ALPHA,
+ mScrimForBubble.getViewAlpha(), 0.0f);
}
@Test
@@ -564,6 +578,15 @@
}
@Test
+ public void qsExpansion() {
+ reset(mScrimBehind);
+ mScrimController.setQsExpansion(1f);
+ finishAnimationsImmediately();
+
+ assertScrimAlpha(TRANSPARENT, OPAQUE, TRANSPARENT);
+ }
+
+ @Test
public void panelExpansionAffectsAlpha() {
mScrimController.setPanelExpansion(0f);
mScrimController.setPanelExpansion(0.5f);
@@ -888,7 +911,7 @@
HashSet<ScrimState> regularStates = new HashSet<>(Arrays.asList(
ScrimState.UNINITIALIZED, ScrimState.KEYGUARD, ScrimState.BOUNCER,
ScrimState.BOUNCER_SCRIMMED, ScrimState.BRIGHTNESS_MIRROR, ScrimState.UNLOCKED,
- ScrimState.BUBBLE_EXPANDED));
+ ScrimState.BUBBLE_EXPANDED, ScrimState.SHADE_LOCKED));
for (ScrimState state : ScrimState.values()) {
if (!lowPowerModeStates.contains(state) && !regularStates.contains(state)) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
index 5416f75..6fb4eba 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
@@ -151,6 +151,7 @@
import com.android.wm.shell.splitscreen.SplitScreen;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -886,6 +887,7 @@
verify(mDozeServiceHost).setDozeSuppressed(false);
}
+ @Ignore // TODO (b/175240607) - Figure out if the device will actually dial 911.
@Test
public void onEmergencyActionLaunchGesture_launchesEmergencyIntent() {
ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
@@ -896,7 +898,6 @@
verify(statusBarSpy).startActivity(intentCaptor.capture(), eq(true));
Intent sentIntent = intentCaptor.getValue();
assertEquals(sentIntent.getAction(), EmergencyGesture.ACTION_LAUNCH_EMERGENCY);
-
}
public static class TestableNotificationInterruptStateProviderImpl extends
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BatteryControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BatteryControllerTest.java
index 23fa6fd..2577dbd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BatteryControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BatteryControllerTest.java
@@ -16,7 +16,11 @@
package com.android.systemui.statusbar.policy;
+import static android.os.BatteryManager.EXTRA_PRESENT;
+
+import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Intent;
@@ -31,6 +35,7 @@
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.power.EnhancedEstimates;
+import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChangeCallback;
import org.junit.Assert;
import org.junit.Before;
@@ -98,4 +103,36 @@
Assert.assertFalse(mBatteryController.isAodPowerSave());
}
+ @Test
+ public void testBatteryPresentState_notPresent() {
+ // GIVEN a battery state callback listening for changes
+ BatteryStateChangeCallback cb = mock(BatteryStateChangeCallback.class);
+ mBatteryController.addCallback(cb);
+
+ // WHEN the state of the battery becomes unknown
+ Intent i = new Intent(Intent.ACTION_BATTERY_CHANGED);
+ i.putExtra(EXTRA_PRESENT, false);
+ mBatteryController.onReceive(getContext(), i);
+
+ // THEN the callback is notified
+ verify(cb, atLeastOnce()).onBatteryUnknownStateChanged(true);
+ }
+
+ @Test
+ public void testBatteryPresentState_callbackAddedAfterStateChange() {
+ // GIVEN a battery state callback
+ BatteryController.BatteryStateChangeCallback cb =
+ mock(BatteryController.BatteryStateChangeCallback.class);
+
+ // GIVEN the state has changed before adding a new callback
+ Intent i = new Intent(Intent.ACTION_BATTERY_CHANGED);
+ i.putExtra(EXTRA_PRESENT, false);
+ mBatteryController.onReceive(getContext(), i);
+
+ // WHEN a callback is added
+ mBatteryController.addCallback(cb);
+
+ // THEN it is informed about the battery state
+ verify(cb, atLeastOnce()).onBatteryUnknownStateChanged(true);
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index 138236a..ce9ca9d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -61,6 +61,7 @@
import androidx.test.InstrumentationRegistry;
import com.android.settingslib.graph.SignalDrawable;
+import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
import com.android.settingslib.net.DataUsageController;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
@@ -70,7 +71,6 @@
import com.android.systemui.statusbar.policy.NetworkController.IconState;
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
import com.android.systemui.statusbar.policy.NetworkControllerImpl.Config;
-import com.android.systemui.statusbar.policy.NetworkControllerImpl.SubscriptionDefaults;
import org.junit.Before;
import org.junit.Rule;
@@ -225,7 +225,7 @@
setDefaultSubId(mSubId);
setSubscriptions(mSubId);
mMobileSignalController = mNetworkController.mMobileSignalControllers.get(mSubId);
- mPhoneStateListener = mMobileSignalController.mPhoneStateListener;
+ mPhoneStateListener = mMobileSignalController.mMobileStatusTracker.getPhoneStateListener();
ArgumentCaptor<ConnectivityManager.NetworkCallback> callbackArg =
ArgumentCaptor.forClass(ConnectivityManager.NetworkCallback.class);
diff --git a/packages/Tethering/OWNERS b/packages/Tethering/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/packages/Tethering/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/packages/VpnDialogs/OWNERS b/packages/VpnDialogs/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/packages/VpnDialogs/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/packages/WAPPushManager/OWNERS b/packages/WAPPushManager/OWNERS
new file mode 100644
index 0000000..640baf2
--- /dev/null
+++ b/packages/WAPPushManager/OWNERS
@@ -0,0 +1 @@
+include /telephony/OWNERS
diff --git a/packages/WallpaperBackup/OWNERS b/packages/WallpaperBackup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/packages/WallpaperBackup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/packages/WallpaperCropper/OWNERS b/packages/WallpaperCropper/OWNERS
new file mode 100644
index 0000000..8ff0f74
--- /dev/null
+++ b/packages/WallpaperCropper/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/wallpaper/OWNERS
diff --git a/packages/WindowManager/OWNERS b/packages/WindowManager/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/packages/WindowManager/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/packages/overlays/OWNERS b/packages/overlays/OWNERS
new file mode 100644
index 0000000..afb98d4
--- /dev/null
+++ b/packages/overlays/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/content/om/OWNERS
diff --git a/packages/services/PacProcessor/OWNERS b/packages/services/PacProcessor/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/packages/services/PacProcessor/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/packages/services/Proxy/OWNERS b/packages/services/Proxy/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/packages/services/Proxy/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/proto/src/OWNERS b/proto/src/OWNERS
new file mode 100644
index 0000000..e7ddf86
--- /dev/null
+++ b/proto/src/OWNERS
@@ -0,0 +1,2 @@
+per-file gnss.proto = file:/services/core/java/com/android/server/location/OWNERS
+per-file wifi.proto = file:/wifi/OWNERS
diff --git a/samples/training/network-usage/OWNERS b/samples/training/network-usage/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/samples/training/network-usage/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/services/OWNERS b/services/OWNERS
new file mode 100644
index 0000000..88d0b61
--- /dev/null
+++ b/services/OWNERS
@@ -0,0 +1 @@
+per-file Android.bp = file:platform/build/soong:/OWNERS
diff --git a/services/api/OWNERS b/services/api/OWNERS
new file mode 100644
index 0000000..a609390
--- /dev/null
+++ b/services/api/OWNERS
@@ -0,0 +1,4 @@
+per-file Android.bp = file:platform/build/soong:/OWNERS
+
+# API changes are managed via Prolog rules, not OWNERS
+*
diff --git a/services/appprediction/OWNERS b/services/appprediction/OWNERS
new file mode 100644
index 0000000..3a5d23d
--- /dev/null
+++ b/services/appprediction/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/appprediction/OWNERS
diff --git a/services/autofill/OWNERS b/services/autofill/OWNERS
new file mode 100644
index 0000000..c52751d
--- /dev/null
+++ b/services/autofill/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/autofill/OWNERS
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index 33d13de..bc59602 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -29,8 +29,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManagerInternal;
-import android.app.ActivityTaskManager;
-import android.app.IActivityTaskManager;
import android.content.ComponentName;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -86,6 +84,7 @@
import com.android.server.contentcapture.ContentCaptureManagerInternal;
import com.android.server.infra.AbstractPerUserSystemService;
import com.android.server.inputmethod.InputMethodManagerInternal;
+import com.android.server.wm.ActivityTaskManagerInternal;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -1638,19 +1637,16 @@
}
}
- final IActivityTaskManager atm = ActivityTaskManager.getService();
+ final ActivityTaskManagerInternal atmInternal = LocalServices.getService(
+ ActivityTaskManagerInternal.class);
// Only remove sessions which's activities are not known to the activity manager anymore
for (int i = 0; i < numSessionsToRemove; i++) {
- try {
- // The activity manager cannot resolve activities that have been removed
- if (atm.getActivityClassForToken(sessionsToRemove.valueAt(i)) != null) {
- sessionsToRemove.removeAt(i);
- i--;
- numSessionsToRemove--;
- }
- } catch (RemoteException e) {
- Slog.w(TAG, "Cannot figure out if activity is finished", e);
+ // The activity task manager cannot resolve activities that have been removed.
+ if (atmInternal.getActivityName(sessionsToRemove.valueAt(i)) != null) {
+ sessionsToRemove.removeAt(i);
+ i--;
+ numSessionsToRemove--;
}
}
diff --git a/services/autofill/java/com/android/server/autofill/TEST_MAPPING b/services/autofill/java/com/android/server/autofill/TEST_MAPPING
index cf058ad..d8a6917 100644
--- a/services/autofill/java/com/android/server/autofill/TEST_MAPPING
+++ b/services/autofill/java/com/android/server/autofill/TEST_MAPPING
@@ -1,5 +1,5 @@
{
- "presubmit": [
+ "presubmit-large": [
{
"name": "CtsAutoFillServiceTestCases",
"options": [
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index ac6ed44..6c30999 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -512,7 +512,7 @@
int callingUid = Binder.getCallingUid();
if (CompatChanges.isChangeEnabled(
BackupManager.IS_BACKUP_SERVICE_ACTIVE_ENFORCE_PERMISSION_IN_SERVICE, callingUid)) {
- mContext.enforceCallingPermission(android.Manifest.permission.BACKUP,
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"isBackupServiceActive");
}
synchronized (mStateLock) {
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
index 0a80b02..e6e52de 100644
--- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -40,6 +40,7 @@
import android.companion.Association;
import android.companion.AssociationRequest;
import android.companion.CompanionDeviceManager;
+import android.companion.DeviceNotAssociatedException;
import android.companion.ICompanionDeviceDiscoveryService;
import android.companion.ICompanionDeviceManager;
import android.companion.IFindDeviceCallback;
@@ -486,6 +487,43 @@
a -> Objects.equals(a.getDeviceMacAddress(), macAddress));
}
+ @Override
+ public void registerDevicePresenceListenerService(
+ String packageName, String deviceAddress)
+ throws RemoteException {
+ checkCanRegisterObserverService(packageName, deviceAddress);
+
+ //TODO(eugenesusla) implement
+ }
+
+ @Override
+ public void unregisterDevicePresenceListenerService(
+ String packageName, String deviceAddress)
+ throws RemoteException {
+ checkCanRegisterObserverService(packageName, deviceAddress);
+
+ //TODO(eugenesusla) implement
+ }
+
+ private void checkCanRegisterObserverService(String packageName, String deviceAddress)
+ throws RemoteException {
+ getContext().enforceCallingOrSelfPermission(
+ android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE,
+ "[un]registerDevicePresenceListenerService");
+ checkCallerIsSystemOr(packageName);
+
+ int userId = getCallingUserId();
+ Set<Association> deviceAssociations = CollectionUtils.filter(
+ getAllAssociations(userId, packageName),
+ association -> deviceAddress.equals(association.getDeviceMacAddress()));
+
+ if (deviceAssociations.isEmpty()) {
+ throw new RemoteException(new DeviceNotAssociatedException("App " + packageName
+ + " is not associated with device " + deviceAddress
+ + " for user " + userId));
+ }
+ }
+
private void checkCanCallNotificationApi(String callingPackage) throws RemoteException {
checkCallerIsSystemOr(callingPackage);
int userId = getCallingUserId();
diff --git a/services/contentcapture/OWNERS b/services/contentcapture/OWNERS
new file mode 100644
index 0000000..a28e00a
--- /dev/null
+++ b/services/contentcapture/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/contentcapture/OWNERS
diff --git a/services/contentsuggestions/OWNERS b/services/contentsuggestions/OWNERS
new file mode 100644
index 0000000..449db3a
--- /dev/null
+++ b/services/contentsuggestions/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/contentsuggestions/OWNERS
diff --git a/services/core/Android.bp b/services/core/Android.bp
index 17e3456..252fd63 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -110,6 +110,7 @@
],
required: [
+ "cec_config.xml",
"gps_debug.conf",
"protolog.conf.json.gz",
],
@@ -172,6 +173,11 @@
}
prebuilt_etc {
+ name: "cec_config.xml",
+ src: "java/com/android/server/hdmi/cec_config.xml",
+}
+
+prebuilt_etc {
name: "gps_debug.conf",
src: "java/com/android/server/location/gnss/gps_debug.conf",
}
diff --git a/services/core/OWNERS b/services/core/OWNERS
new file mode 100644
index 0000000..88d0b61
--- /dev/null
+++ b/services/core/OWNERS
@@ -0,0 +1 @@
+per-file Android.bp = file:platform/build/soong:/OWNERS
diff --git a/services/core/java/com/android/server/BluetoothAirplaneModeListener.java b/services/core/java/com/android/server/BluetoothAirplaneModeListener.java
index 4d9680c..aa56da5 100644
--- a/services/core/java/com/android/server/BluetoothAirplaneModeListener.java
+++ b/services/core/java/com/android/server/BluetoothAirplaneModeListener.java
@@ -119,7 +119,9 @@
}
return;
}
- mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager);
+ if (mAirplaneHelper != null) {
+ mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager);
+ }
}
@VisibleForTesting
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 0a68428..dc24ffd 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -1275,7 +1275,7 @@
@Override
public boolean bindBluetoothProfileService(int bluetoothProfile,
IBluetoothProfileServiceConnection proxy) {
- if (!mEnable) {
+ if (mState != BluetoothAdapter.STATE_ON) {
if (DBG) {
Slog.d(TAG, "Trying to bind to profile: " + bluetoothProfile
+ ", while Bluetooth was disabled");
@@ -1441,7 +1441,7 @@
mBluetoothLock.readLock().unlock();
}
- if (!mEnable || state != BluetoothAdapter.STATE_ON) {
+ if (state != BluetoothAdapter.STATE_ON) {
if (DBG) {
Slog.d(TAG, "Unable to bindService while Bluetooth is disabled");
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 0d0f0dd..a6559f9 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -129,6 +129,7 @@
import android.net.SocketKeepalive;
import android.net.TetheringManager;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.Uri;
import android.net.VpnManager;
import android.net.VpnService;
@@ -184,7 +185,6 @@
import com.android.internal.net.VpnProfile;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.AsyncChannel;
-import com.android.internal.util.DumpUtils;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.LocationPermissionChecker;
import com.android.internal.util.MessageUtils;
@@ -1287,7 +1287,7 @@
if (network == null) {
return null;
}
- return getNetworkAgentInfoForNetId(network.netId);
+ return getNetworkAgentInfoForNetId(network.getNetId());
}
private NetworkAgentInfo getNetworkAgentInfoForNetId(int netId) {
@@ -1378,7 +1378,7 @@
}
final String action = blocked ? "BLOCKED" : "UNBLOCKED";
mNetworkInfoBlockingLogs.log(String.format(
- "%s %d(%d) on netId %d", action, nri.mUid, nri.request.requestId, net.netId));
+ "%s %d(%d) on netId %d", action, nri.mUid, nri.request.requestId, net.getNetId()));
}
/**
@@ -1890,7 +1890,7 @@
int netId;
synchronized (nai) {
lp = nai.linkProperties;
- netId = nai.network.netId;
+ netId = nai.network.getNetId();
}
boolean ok = addLegacyRouteToHost(lp, addr, netId, uid);
if (DBG) log("requestRouteToHostAddress ok=" + ok);
@@ -2525,9 +2525,21 @@
PriorityDump.dump(mPriorityDumper, fd, writer, args);
}
+ private boolean checkDumpPermission(Context context, String tag, PrintWriter pw) {
+ if (context.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
+ != PackageManager.PERMISSION_GRANTED) {
+ pw.println("Permission Denial: can't dump " + tag + " from from pid="
+ + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid()
+ + " due to missing android.permission.DUMP permission");
+ return false;
+ } else {
+ return true;
+ }
+ }
+
private void doDump(FileDescriptor fd, PrintWriter writer, String[] args, boolean asProto) {
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
- if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
+ if (!checkDumpPermission(mContext, TAG, pw)) return;
if (asProto) return;
if (ArrayUtils.contains(args, DIAG_ARG)) {
@@ -2553,7 +2565,7 @@
if (defaultNai == null) {
pw.println("none");
} else {
- pw.println(defaultNai.network.netId);
+ pw.println(defaultNai.network.getNetId());
}
pw.println();
@@ -2690,7 +2702,7 @@
private NetworkAgentInfo[] networksSortedById() {
NetworkAgentInfo[] networks = new NetworkAgentInfo[0];
networks = mNetworkAgentInfos.values().toArray(networks);
- Arrays.sort(networks, Comparator.comparingInt(nai -> nai.network.netId));
+ Arrays.sort(networks, Comparator.comparingInt(nai -> nai.network.getNetId()));
return networks;
}
@@ -2811,6 +2823,7 @@
break;
}
case NetworkAgent.EVENT_UNDERLYING_NETWORKS_CHANGED: {
+ // TODO: prevent loops, e.g., if a network declares itself as underlying.
if (!nai.supportsUnderlyingNetworks()) {
Log.wtf(TAG, "Non-virtual networks cannot have underlying networks");
break;
@@ -2831,7 +2844,7 @@
log(nai.toShortString() + " changed underlying networks to "
+ Arrays.toString(nai.declaredUnderlyingNetworks));
}
- updateCapabilities(nai.getCurrentScore(), nai, nai.networkCapabilities);
+ updateCapabilitiesForNetwork(nai);
notifyIfacesChangedForNetworkStats();
}
}
@@ -2855,8 +2868,7 @@
if (probePrivateDnsCompleted) {
if (nai.networkCapabilities.isPrivateDnsBroken() != privateDnsBroken) {
nai.networkCapabilities.setPrivateDnsBroken(privateDnsBroken);
- final int oldScore = nai.getCurrentScore();
- updateCapabilities(oldScore, nai, nai.networkCapabilities);
+ updateCapabilitiesForNetwork(nai);
}
// Only show the notification when the private DNS is broken and the
// PRIVATE_DNS_BROKEN notification hasn't shown since last valid.
@@ -2871,8 +2883,7 @@
// done yet. In either case, the networkCapabilities should be updated to
// reflect the new status.
nai.networkCapabilities.setPrivateDnsBroken(false);
- final int oldScore = nai.getCurrentScore();
- updateCapabilities(oldScore, nai, nai.networkCapabilities);
+ updateCapabilitiesForNetwork(nai);
nai.networkAgentConfig.hasShownBroken = false;
}
break;
@@ -2893,7 +2904,6 @@
final NetworkAgentInfo nai = getNetworkAgentInfoForNetId(netId);
// If captive portal status has changed, update capabilities or disconnect.
if (nai != null && (visible != nai.lastCaptivePortalDetected)) {
- final int oldScore = nai.getCurrentScore();
nai.lastCaptivePortalDetected = visible;
nai.everCaptivePortalDetected |= visible;
if (nai.lastCaptivePortalDetected &&
@@ -2904,7 +2914,7 @@
teardownUnneededNetwork(nai);
break;
}
- updateCapabilities(oldScore, nai, nai.networkCapabilities);
+ updateCapabilitiesForNetwork(nai);
}
if (!visible) {
// Only clear SIGN_IN and NETWORK_SWITCH notifications here, or else other
@@ -2974,13 +2984,13 @@
handleFreshlyValidatedNetwork(nai);
// Clear NO_INTERNET, PRIVATE_DNS_BROKEN, PARTIAL_CONNECTIVITY and
// LOST_INTERNET notifications if network becomes valid.
- mNotifier.clearNotification(nai.network.netId,
+ mNotifier.clearNotification(nai.network.getNetId(),
NotificationType.NO_INTERNET);
- mNotifier.clearNotification(nai.network.netId,
+ mNotifier.clearNotification(nai.network.getNetId(),
NotificationType.LOST_INTERNET);
- mNotifier.clearNotification(nai.network.netId,
+ mNotifier.clearNotification(nai.network.getNetId(),
NotificationType.PARTIAL_CONNECTIVITY);
- mNotifier.clearNotification(nai.network.netId,
+ mNotifier.clearNotification(nai.network.getNetId(),
NotificationType.PRIVATE_DNS_BROKEN);
// If network becomes valid, the hasShownBroken should be reset for
// that network so that the notification will be fired when the private
@@ -2988,7 +2998,7 @@
nai.networkAgentConfig.hasShownBroken = false;
}
} else if (partialConnectivityChanged) {
- updateCapabilities(nai.getCurrentScore(), nai, nai.networkCapabilities);
+ updateCapabilitiesForNetwork(nai);
}
updateInetCondition(nai);
// Let the NetworkAgent know the state of its network
@@ -3051,7 +3061,7 @@
private final AutodestructReference<NetworkAgentInfo> mNai;
private NetworkMonitorCallbacks(NetworkAgentInfo nai) {
- mNetId = nai.network.netId;
+ mNetId = nai.network.getNetId();
mNai = new AutodestructReference<>(nai);
}
@@ -3201,7 +3211,7 @@
// in order to restart a validation pass from within netd.
final PrivateDnsConfig cfg = mDnsManager.getPrivateDnsConfig();
if (cfg.useTls && TextUtils.isEmpty(cfg.hostname)) {
- updateDnses(nai.linkProperties, null, nai.network.netId);
+ updateDnses(nai.linkProperties, null, nai.network.getNetId());
}
}
@@ -3234,7 +3244,7 @@
private void updatePrivateDns(NetworkAgentInfo nai, PrivateDnsConfig newCfg) {
mDnsManager.updatePrivateDns(nai.network, newCfg);
- updateDnses(nai.linkProperties, null, nai.network.netId);
+ updateDnses(nai.linkProperties, null, nai.network.getNetId());
}
private void handlePrivateDnsValidationUpdate(PrivateDnsValidationUpdate update) {
@@ -3330,9 +3340,9 @@
if (nai != null) {
final boolean wasDefault = isDefaultNetwork(nai);
synchronized (mNetworkForNetId) {
- mNetworkForNetId.remove(nai.network.netId);
+ mNetworkForNetId.remove(nai.network.getNetId());
}
- mNetIdManager.releaseNetId(nai.network.netId);
+ mNetIdManager.releaseNetId(nai.network.getNetId());
// Just in case.
mLegacyTypeTracker.remove(nai, wasDefault);
}
@@ -3362,7 +3372,7 @@
log(nai.toShortString() + " disconnected, was satisfying " + nai.numNetworkRequests());
}
// Clear all notifications of this network.
- mNotifier.clearNotification(nai.network.netId);
+ mNotifier.clearNotification(nai.network.getNetId());
// A network agent has disconnected.
// TODO - if we move the logic to the network agent (have them disconnect
// because they lost all their requests or because their score isn't good)
@@ -3399,19 +3409,21 @@
synchronized (mNetworkForNetId) {
// Remove the NetworkAgent, but don't mark the netId as
// available until we've told netd to delete it below.
- mNetworkForNetId.remove(nai.network.netId);
+ mNetworkForNetId.remove(nai.network.getNetId());
}
// Remove all previously satisfied requests.
for (int i = 0; i < nai.numNetworkRequests(); i++) {
NetworkRequest request = nai.requestAt(i);
final NetworkRequestInfo nri = mNetworkRequests.get(request);
final NetworkAgentInfo currentNetwork = nri.mSatisfier;
- if (currentNetwork != null && currentNetwork.network.netId == nai.network.netId) {
+ if (currentNetwork != null
+ && currentNetwork.network.getNetId() == nai.network.getNetId()) {
nri.mSatisfier = null;
sendUpdatedScoreToFactories(request, null);
}
}
nai.clearLingerState();
+ propagateUnderlyingNetworkCapabilities(nai.network);
if (nai.isSatisfyingRequest(mDefaultRequest.requestId)) {
mDefaultNetworkNai = null;
updateDataActivityTracking(null /* newNetwork */, nai);
@@ -3419,9 +3431,6 @@
ensureNetworkTransitionWakelock(nai.toShortString());
}
mLegacyTypeTracker.remove(nai, wasDefault);
- if (!nai.networkCapabilities.hasTransport(TRANSPORT_VPN)) {
- propagateUnderlyingNetworkCapabilities();
- }
rematchAllNetworksAndRequests();
mLingerMonitor.noteDisconnect(nai);
if (nai.created) {
@@ -3436,26 +3445,26 @@
destroyNativeNetwork(nai);
mDnsManager.removeNetwork(nai.network);
}
- mNetIdManager.releaseNetId(nai.network.netId);
+ mNetIdManager.releaseNetId(nai.network.getNetId());
}
private boolean createNativeNetwork(@NonNull NetworkAgentInfo networkAgent) {
try {
// This should never fail. Specifying an already in use NetID will cause failure.
if (networkAgent.isVPN()) {
- mNetd.networkCreateVpn(networkAgent.network.netId,
+ mNetd.networkCreateVpn(networkAgent.network.getNetId(),
(networkAgent.networkAgentConfig == null
|| !networkAgent.networkAgentConfig.allowBypass));
} else {
- mNetd.networkCreatePhysical(networkAgent.network.netId,
+ mNetd.networkCreatePhysical(networkAgent.network.getNetId(),
getNetworkPermission(networkAgent.networkCapabilities));
}
- mDnsResolver.createNetworkCache(networkAgent.network.netId);
- mDnsManager.updateTransportsForNetwork(networkAgent.network.netId,
+ mDnsResolver.createNetworkCache(networkAgent.network.getNetId());
+ mDnsManager.updateTransportsForNetwork(networkAgent.network.getNetId(),
networkAgent.networkCapabilities.getTransportTypes());
return true;
} catch (RemoteException | ServiceSpecificException e) {
- loge("Error creating network " + networkAgent.network.netId + ": "
+ loge("Error creating network " + networkAgent.network.getNetId() + ": "
+ e.getMessage());
return false;
}
@@ -3463,8 +3472,8 @@
private void destroyNativeNetwork(@NonNull NetworkAgentInfo networkAgent) {
try {
- mNetd.networkDestroy(networkAgent.network.netId);
- mDnsResolver.destroyNetworkCache(networkAgent.network.netId);
+ mNetd.networkDestroy(networkAgent.network.getNetId());
+ mDnsResolver.destroyNetworkCache(networkAgent.network.getNetId());
} catch (RemoteException | ServiceSpecificException e) {
loge("Exception destroying network: " + e);
}
@@ -3656,7 +3665,7 @@
nri.mSatisfier = null;
if (!wasBackgroundNetwork && nai.isBackgroundNetwork()) {
// Went from foreground to background.
- updateCapabilities(nai.getCurrentScore(), nai, nai.networkCapabilities);
+ updateCapabilitiesForNetwork(nai);
}
}
@@ -4026,7 +4035,7 @@
Intent intent = new Intent(action);
if (type != NotificationType.PRIVATE_DNS_BROKEN) {
- intent.setData(Uri.fromParts("netId", Integer.toString(nai.network.netId), null));
+ intent.setData(Uri.fromParts("netId", Integer.toString(nai.network.getNetId()), null));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Some OEMs have their own Settings package. Thus, need to get the current using
// Settings package name instead of just use default name "com.android.settings".
@@ -4041,7 +4050,8 @@
intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
- mNotifier.showNotification(nai.network.netId, type, nai, null, pendingIntent, highPriority);
+ mNotifier.showNotification(
+ nai.network.getNetId(), type, nai, null, pendingIntent, highPriority);
}
private boolean shouldPromptUnvalidated(NetworkAgentInfo nai) {
@@ -4407,7 +4417,7 @@
return;
}
if (DBG) {
- int netid = nai.network.netId;
+ int netid = nai.network.getNetId();
log("reportNetworkConnectivity(" + netid + ", " + hasConnectivity + ") by " + uid);
}
// Validating a network that has not yet connected could result in a call to
@@ -4442,7 +4452,7 @@
return null;
}
return getLinkPropertiesProxyInfo(activeNetwork);
- } else if (mDeps.queryUserAccess(Binder.getCallingUid(), network.netId)) {
+ } else if (mDeps.queryUserAccess(Binder.getCallingUid(), network.getNetId())) {
// Don't call getLinkProperties() as it requires ACCESS_NETWORK_STATE permission, which
// caller may not have.
return getLinkPropertiesProxyInfo(network);
@@ -4809,18 +4819,36 @@
}
}
+ private Network[] underlyingNetworksOrDefault(Network[] underlyingNetworks) {
+ final Network defaultNetwork = getNetwork(getDefaultNetwork());
+ if (underlyingNetworks == null && defaultNetwork != null) {
+ // null underlying networks means to track the default.
+ underlyingNetworks = new Network[] { defaultNetwork };
+ }
+ return underlyingNetworks;
+ }
+
+ // Returns true iff |network| is an underlying network of |nai|.
+ private boolean hasUnderlyingNetwork(NetworkAgentInfo nai, Network network) {
+ // TODO: support more than one level of underlying networks, either via a fixed-depth search
+ // (e.g., 2 levels of underlying networks), or via loop detection, or....
+ if (!nai.supportsUnderlyingNetworks()) return false;
+ final Network[] underlying = underlyingNetworksOrDefault(nai.declaredUnderlyingNetworks);
+ return ArrayUtils.contains(underlying, network);
+ }
+
/**
- * Ask all networks with underlying networks to recompute and update their capabilities.
+ * Recompute the capabilities for any networks that had a specific network as underlying.
*
* When underlying networks change, such networks may have to update capabilities to reflect
* things like the metered bit, their transports, and so on. The capabilities are calculated
* immediately. This method runs on the ConnectivityService thread.
*/
- private void propagateUnderlyingNetworkCapabilities() {
+ private void propagateUnderlyingNetworkCapabilities(Network updatedNetwork) {
ensureRunningOnConnectivityServiceThread();
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
- if (nai.supportsUnderlyingNetworks()) {
- updateCapabilities(nai.getCurrentScore(), nai, nai.networkCapabilities);
+ if (updatedNetwork == null || hasUnderlyingNetwork(nai, updatedNetwork)) {
+ updateCapabilitiesForNetwork(nai);
}
}
}
@@ -5142,7 +5170,7 @@
loge("Starting user already has a VPN");
return;
}
- userVpn = new Vpn(mHandler.getLooper(), mContext, mNMS, userId, mKeyStore);
+ userVpn = new Vpn(mHandler.getLooper(), mContext, mNMS, mNetd, userId, mKeyStore);
mVpns.put(userId, userVpn);
if (mUserManager.getUserInfo(userId).isPrimary() && LockdownVpnTracker.isEnabled()) {
updateLockdownVpn();
@@ -5569,11 +5597,12 @@
}
private boolean checkUnsupportedStartingFrom(int version, String callingPackageName) {
- final PackageManager pm = mContext.getPackageManager();
- final int userId = UserHandle.getCallingUserId();
+ final UserHandle user = UserHandle.getUserHandleForUid(Binder.getCallingUid());
+ final PackageManager pm =
+ mContext.createContextAsUser(user, 0 /* flags */).getPackageManager();
try {
- final int callingVersion = pm.getApplicationInfoAsUser(
- callingPackageName, 0 /* flags */, userId).targetSdkVersion;
+ final int callingVersion = pm.getApplicationInfo(
+ callingPackageName, 0 /* flags */).targetSdkVersion;
if (callingVersion < version) return false;
} catch (PackageManager.NameNotFoundException e) { }
return true;
@@ -5653,7 +5682,7 @@
return false;
}
synchronized (mNetworkForNetId) {
- nai = mNetworkForNetId.get(network.netId);
+ nai = mNetworkForNetId.get(network.getNetId());
}
if (nai != null) {
nai.asyncChannel.sendMessage(android.net.NetworkAgent.CMD_REQUEST_BANDWIDTH_UPDATE);
@@ -6033,7 +6062,7 @@
if (VDBG) log("Got NetworkAgent Messenger");
mNetworkAgentInfos.put(nai.messenger, nai);
synchronized (mNetworkForNetId) {
- mNetworkForNetId.put(nai.network.netId, nai);
+ mNetworkForNetId.put(nai.network.getNetId(), nai);
}
try {
@@ -6061,7 +6090,7 @@
private void updateLinkProperties(NetworkAgentInfo networkAgent, LinkProperties newLp,
@NonNull LinkProperties oldLp) {
- int netId = networkAgent.network.netId;
+ int netId = networkAgent.network.getNetId();
// The NetworkAgent does not know whether clatd is running on its network or not, or whether
// a NAT64 prefix was discovered by the DNS resolver. Before we do anything else, make sure
@@ -6342,7 +6371,7 @@
final int newPermission = getNetworkPermission(newNc);
if (oldPermission != newPermission && nai.created && !nai.isVPN()) {
try {
- mNetd.networkSetPermissionForNetwork(nai.network.netId, newPermission);
+ mNetd.networkSetPermissionForNetwork(nai.network.getNetId(), newPermission);
} catch (RemoteException | ServiceSpecificException e) {
loge("Exception in networkSetPermissionForNetwork: " + e);
}
@@ -6357,22 +6386,28 @@
* This method should never alter the agent's NetworkCapabilities, only store data in |nai|.
*/
private void processCapabilitiesFromAgent(NetworkAgentInfo nai, NetworkCapabilities nc) {
- nai.declaredMetered = !nc.hasCapability(NET_CAPABILITY_NOT_METERED);
+ // Note: resetting the owner UID before storing the agent capabilities in NAI means that if
+ // the agent attempts to change the owner UID, then nai.declaredCapabilities will not
+ // actually be the same as the capabilities sent by the agent. Still, it is safer to reset
+ // the owner UID here and behave as if the agent had never tried to change it.
+ if (nai.networkCapabilities.getOwnerUid() != nc.getOwnerUid()) {
+ Log.e(TAG, nai.toShortString() + ": ignoring attempt to change owner from "
+ + nai.networkCapabilities.getOwnerUid() + " to " + nc.getOwnerUid());
+ nc.setOwnerUid(nai.networkCapabilities.getOwnerUid());
+ }
+ nai.declaredCapabilities = new NetworkCapabilities(nc);
}
- /** Modifies |caps| based on the capabilities of the specified underlying networks. */
+ /** Modifies |newNc| based on the capabilities of |underlyingNetworks| and |agentCaps|. */
@VisibleForTesting
void applyUnderlyingCapabilities(@Nullable Network[] underlyingNetworks,
- @NonNull NetworkCapabilities caps, boolean declaredMetered) {
- final Network defaultNetwork = getNetwork(getDefaultNetwork());
- if (underlyingNetworks == null && defaultNetwork != null) {
- // null underlying networks means to track the default.
- underlyingNetworks = new Network[] { defaultNetwork };
- }
- int[] transportTypes = new int[] { NetworkCapabilities.TRANSPORT_VPN };
+ @NonNull NetworkCapabilities agentCaps, @NonNull NetworkCapabilities newNc) {
+ underlyingNetworks = underlyingNetworksOrDefault(underlyingNetworks);
+ int[] transportTypes = agentCaps.getTransportTypes();
int downKbps = NetworkCapabilities.LINK_BANDWIDTH_UNSPECIFIED;
int upKbps = NetworkCapabilities.LINK_BANDWIDTH_UNSPECIFIED;
- boolean metered = declaredMetered; // metered if any underlying is metered, or agentMetered
+ // metered if any underlying is metered, or originally declared metered by the agent.
+ boolean metered = !agentCaps.hasCapability(NET_CAPABILITY_NOT_METERED);
boolean roaming = false; // roaming if any underlying is roaming
boolean congested = false; // congested if any underlying is congested
boolean suspended = true; // suspended if all underlying are suspended
@@ -6418,13 +6453,13 @@
suspended = false;
}
- caps.setTransportTypes(transportTypes);
- caps.setLinkDownstreamBandwidthKbps(downKbps);
- caps.setLinkUpstreamBandwidthKbps(upKbps);
- caps.setCapability(NET_CAPABILITY_NOT_METERED, !metered);
- caps.setCapability(NET_CAPABILITY_NOT_ROAMING, !roaming);
- caps.setCapability(NET_CAPABILITY_NOT_CONGESTED, !congested);
- caps.setCapability(NET_CAPABILITY_NOT_SUSPENDED, !suspended);
+ newNc.setTransportTypes(transportTypes);
+ newNc.setLinkDownstreamBandwidthKbps(downKbps);
+ newNc.setLinkUpstreamBandwidthKbps(upKbps);
+ newNc.setCapability(NET_CAPABILITY_NOT_METERED, !metered);
+ newNc.setCapability(NET_CAPABILITY_NOT_ROAMING, !roaming);
+ newNc.setCapability(NET_CAPABILITY_NOT_CONGESTED, !congested);
+ newNc.setCapability(NET_CAPABILITY_NOT_SUSPENDED, !suspended);
}
/**
@@ -6481,7 +6516,8 @@
}
if (nai.supportsUnderlyingNetworks()) {
- applyUnderlyingCapabilities(nai.declaredUnderlyingNetworks, newNc, nai.declaredMetered);
+ applyUnderlyingCapabilities(nai.declaredUnderlyingNetworks, nai.declaredCapabilities,
+ newNc);
}
return newNc;
@@ -6560,17 +6596,20 @@
}
}
- if (!newNc.hasTransport(TRANSPORT_VPN)) {
- // Tell VPNs about updated capabilities, since they may need to
- // bubble those changes through.
- propagateUnderlyingNetworkCapabilities();
- }
+ // This network might have been underlying another network. Propagate its capabilities.
+ propagateUnderlyingNetworkCapabilities(nai.network);
if (!newNc.equalsTransportTypes(prevNc)) {
- mDnsManager.updateTransportsForNetwork(nai.network.netId, newNc.getTransportTypes());
+ mDnsManager.updateTransportsForNetwork(
+ nai.network.getNetId(), newNc.getTransportTypes());
}
}
+ /** Convenience method to update the capabilities for a given network. */
+ private void updateCapabilitiesForNetwork(NetworkAgentInfo nai) {
+ updateCapabilities(nai.getCurrentScore(), nai, nai.networkCapabilities);
+ }
+
/**
* Returns whether VPN isolation (ingress interface filtering) should be applied on the given
* network.
@@ -6600,6 +6639,16 @@
&& (lp.hasIpv6DefaultRoute() || lp.hasIpv6UnreachableDefaultRoute());
}
+ private static UidRangeParcel[] toUidRangeStableParcels(final @NonNull Set<UidRange> ranges) {
+ final UidRangeParcel[] stableRanges = new UidRangeParcel[ranges.size()];
+ int index = 0;
+ for (UidRange range : ranges) {
+ stableRanges[index] = new UidRangeParcel(range.start, range.stop);
+ index++;
+ }
+ return stableRanges;
+ }
+
private void updateUids(NetworkAgentInfo nai, NetworkCapabilities prevNc,
NetworkCapabilities newNc) {
Set<UidRange> prevRanges = null == prevNc ? null : prevNc.getUids();
@@ -6619,14 +6668,11 @@
// removing old range works because, unlike the filtering rules below, it's possible to
// add duplicate UID routing rules.
if (!newRanges.isEmpty()) {
- final UidRange[] addedRangesArray = new UidRange[newRanges.size()];
- newRanges.toArray(addedRangesArray);
- mNMS.addVpnUidRanges(nai.network.netId, addedRangesArray);
+ mNetd.networkAddUidRanges(nai.network.netId, toUidRangeStableParcels(newRanges));
}
if (!prevRanges.isEmpty()) {
- final UidRange[] removedRangesArray = new UidRange[prevRanges.size()];
- prevRanges.toArray(removedRangesArray);
- mNMS.removeVpnUidRanges(nai.network.netId, removedRangesArray);
+ mNetd.networkRemoveUidRanges(
+ nai.network.netId, toUidRangeStableParcels(prevRanges));
}
final boolean wasFiltering = requiresVpnIsolation(nai, prevNc, nai.linkProperties);
final boolean shouldFilter = requiresVpnIsolation(nai, newNc, nai.linkProperties);
@@ -6657,7 +6703,7 @@
public void handleUpdateLinkProperties(NetworkAgentInfo nai, LinkProperties newLp) {
ensureRunningOnConnectivityServiceThread();
- if (getNetworkAgentInfoForNetId(nai.network.netId) != nai) {
+ if (getNetworkAgentInfoForNetId(nai.network.getNetId()) != nai) {
// Ignore updates for disconnected networks
return;
}
@@ -6856,8 +6902,7 @@
teardownUnneededNetwork(oldNetwork);
} else {
// Put the network in the background.
- updateCapabilities(oldNetwork.getCurrentScore(), oldNetwork,
- oldNetwork.networkCapabilities);
+ updateCapabilitiesForNetwork(oldNetwork);
}
}
@@ -6868,7 +6913,7 @@
try {
if (null != newNetwork) {
- mNetd.networkSetDefault(newNetwork.network.netId);
+ mNetd.networkSetDefault(newNetwork.network.getNetId());
} else {
mNetd.networkClearDefault();
}
@@ -6882,8 +6927,10 @@
updateTcpBufferSizes(null != newNetwork
? newNetwork.linkProperties.getTcpBufferSizes() : null);
notifyIfacesChangedForNetworkStats();
- // Fix up the NetworkCapabilities of any VPNs that don't specify underlying networks.
- propagateUnderlyingNetworkCapabilities();
+ // Fix up the NetworkCapabilities of any networks that have this network as underlying.
+ if (newNetwork != null) {
+ propagateUnderlyingNetworkCapabilities(newNetwork.network);
+ }
}
private void processListenRequests(@NonNull final NetworkAgentInfo nai) {
@@ -6931,8 +6978,8 @@
public String toString() {
return mRequest.mRequests.get(0).requestId + " : "
- + (null != mOldNetwork ? mOldNetwork.network.netId : "null")
- + " → " + (null != mNewNetwork ? mNewNetwork.network.netId : "null");
+ + (null != mOldNetwork ? mOldNetwork.network.getNetId() : "null")
+ + " → " + (null != mNewNetwork ? mNewNetwork.network.getNetId() : "null");
}
}
@@ -7339,13 +7386,11 @@
networkAgent.networkCapabilities.addCapability(NET_CAPABILITY_FOREGROUND);
if (!createNativeNetwork(networkAgent)) return;
- if (networkAgent.isVPN()) {
- // Initialize the VPN capabilities to their starting values according to the
- // underlying networks. This will avoid a spurious callback to
- // onCapabilitiesUpdated being sent in updateAllVpnCapabilities below as
- // the VPN would switch from its default, blank capabilities to those
- // that reflect the capabilities of its underlying networks.
- propagateUnderlyingNetworkCapabilities();
+ if (networkAgent.supportsUnderlyingNetworks()) {
+ // Initialize the network's capabilities to their starting values according to the
+ // underlying networks. This ensures that the capabilities are correct before
+ // anything happens to the network.
+ updateCapabilitiesForNetwork(networkAgent);
}
networkAgent.created = true;
}
@@ -7387,10 +7432,6 @@
// doing.
updateSignalStrengthThresholds(networkAgent, "CONNECT", null);
- if (networkAgent.supportsUnderlyingNetworks()) {
- propagateUnderlyingNetworkCapabilities();
- }
-
// Consider network even though it is not yet validated.
rematchAllNetworksAndRequests();
@@ -7796,7 +7837,7 @@
private void logNetworkEvent(NetworkAgentInfo nai, int evtype) {
int[] transports = nai.networkCapabilities.getTransportTypes();
- mMetricsLog.log(nai.network.netId, transports, new NetworkEvent(evtype));
+ mMetricsLog.log(nai.network.getNetId(), transports, new NetworkEvent(evtype));
}
private static boolean toBool(int encodedBoolean) {
@@ -8418,6 +8459,6 @@
KEY_TCP_METRICS_COLLECTION_PERIOD_MILLIS);
}
- notifyDataStallSuspected(p, network.netId);
+ notifyDataStallSuspected(p, network.getNetId());
}
}
diff --git a/services/core/java/com/android/server/GestureLauncherService.java b/services/core/java/com/android/server/GestureLauncherService.java
index 8ed23f9..c34285e 100644
--- a/services/core/java/com/android/server/GestureLauncherService.java
+++ b/services/core/java/com/android/server/GestureLauncherService.java
@@ -257,7 +257,7 @@
@VisibleForTesting
void updateEmergencyGestureEnabled() {
- boolean enabled = isEmergencyGestureEnabled(mContext, mUserId);
+ boolean enabled = isEmergencyGestureSettingEnabled(mContext, mUserId);
synchronized (this) {
mEmergencyGestureEnabled = enabled;
}
@@ -390,38 +390,50 @@
/**
* Whether to enable emergency gesture.
*/
- public static boolean isEmergencyGestureEnabled(Context context, int userId) {
- return Settings.Secure.getIntForUser(context.getContentResolver(),
+ @VisibleForTesting
+ static boolean isEmergencyGestureSettingEnabled(Context context, int userId) {
+ return isEmergencyGestureEnabled(context.getResources())
+ && Settings.Secure.getIntForUser(context.getContentResolver(),
Settings.Secure.EMERGENCY_GESTURE_ENABLED, 0, userId) != 0;
}
/**
* Whether to enable the camera launch gesture.
*/
- public static boolean isCameraLaunchEnabled(Resources resources) {
+ private static boolean isCameraLaunchEnabled(Resources resources) {
boolean configSet = resources.getInteger(
com.android.internal.R.integer.config_cameraLaunchGestureSensorType) != -1;
return configSet &&
!SystemProperties.getBoolean("gesture.disable_camera_launch", false);
}
- public static boolean isCameraDoubleTapPowerEnabled(Resources resources) {
+ @VisibleForTesting
+ static boolean isCameraDoubleTapPowerEnabled(Resources resources) {
return resources.getBoolean(
com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled);
}
- public static boolean isCameraLiftTriggerEnabled(Resources resources) {
+ private static boolean isCameraLiftTriggerEnabled(Resources resources) {
boolean configSet = resources.getInteger(
com.android.internal.R.integer.config_cameraLiftTriggerSensorType) != -1;
return configSet;
}
/**
+ * Whether or not the emergency gesture feature is enabled by platform
+ */
+ private static boolean isEmergencyGestureEnabled(Resources resources) {
+ return resources.getBoolean(com.android.internal.R.bool.config_emergencyGestureEnabled);
+ }
+
+ /**
* Whether GestureLauncherService should be enabled according to system properties.
*/
public static boolean isGestureLauncherEnabled(Resources resources) {
- return isCameraLaunchEnabled(resources) || isCameraDoubleTapPowerEnabled(resources) ||
- isCameraLiftTriggerEnabled(resources);
+ return isCameraLaunchEnabled(resources)
+ || isCameraDoubleTapPowerEnabled(resources)
+ || isCameraLiftTriggerEnabled(resources)
+ || isEmergencyGestureEnabled(resources);
}
/**
diff --git a/services/core/java/com/android/server/IpSecService.java b/services/core/java/com/android/server/IpSecService.java
index b2f0c83..f648c3e 100644
--- a/services/core/java/com/android/server/IpSecService.java
+++ b/services/core/java/com/android/server/IpSecService.java
@@ -31,6 +31,7 @@
import android.content.pm.PackageManager;
import android.net.IIpSecService;
import android.net.INetd;
+import android.net.InetAddresses;
import android.net.IpSecAlgorithm;
import android.net.IpSecConfig;
import android.net.IpSecManager;
@@ -41,7 +42,6 @@
import android.net.IpSecUdpEncapResponse;
import android.net.LinkAddress;
import android.net.Network;
-import android.net.NetworkUtils;
import android.net.TrafficStats;
import android.net.util.NetdService;
import android.os.Binder;
@@ -1083,7 +1083,7 @@
throw new IllegalArgumentException("Unspecified address");
}
- InetAddress checkAddr = NetworkUtils.numericToInetAddress(inetAddress);
+ InetAddress checkAddr = InetAddresses.parseNumericAddress(inetAddress);
if (checkAddr.isAnyLocalAddress()) {
throw new IllegalArgumentException("Inappropriate wildcard address: " + inetAddress);
@@ -1467,7 +1467,7 @@
private int getFamily(String inetAddress) {
int family = AF_UNSPEC;
- InetAddress checkAddress = NetworkUtils.numericToInetAddress(inetAddress);
+ InetAddress checkAddress = InetAddresses.parseNumericAddress(inetAddress);
if (checkAddress instanceof Inet4Address) {
family = AF_INET;
} else if (checkAddress instanceof Inet6Address) {
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 821a967..086cc1c 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -58,10 +58,8 @@
import android.net.NetworkPolicyManager;
import android.net.NetworkStack;
import android.net.NetworkStats;
-import android.net.NetworkUtils;
import android.net.RouteInfo;
import android.net.TetherStatsParcel;
-import android.net.UidRange;
import android.net.UidRangeParcel;
import android.net.shared.NetdUtils;
import android.net.shared.RouteUtils;
@@ -803,7 +801,7 @@
InterfaceConfiguration cfg = new InterfaceConfiguration();
cfg.setHardwareAddress(p.hwAddr);
- final InetAddress addr = NetworkUtils.numericToInetAddress(p.ipv4Addr);
+ final InetAddress addr = InetAddresses.parseNumericAddress(p.ipv4Addr);
cfg.setLinkAddress(new LinkAddress(addr, p.prefixLength));
for (String flag : p.flags) {
cfg.setFlag(flag);
@@ -1394,38 +1392,6 @@
}
}
- private static UidRangeParcel makeUidRangeParcel(int start, int stop) {
- UidRangeParcel range = new UidRangeParcel();
- range.start = start;
- range.stop = stop;
- return range;
- }
-
- private static UidRangeParcel[] toStableParcels(UidRange[] ranges) {
- UidRangeParcel[] stableRanges = new UidRangeParcel[ranges.length];
- for (int i = 0; i < ranges.length; i++) {
- stableRanges[i] = makeUidRangeParcel(ranges[i].start, ranges[i].stop);
- }
- return stableRanges;
- }
-
- @Override
- public void setAllowOnlyVpnForUids(boolean add, UidRange[] uidRanges)
- throws ServiceSpecificException {
- NetworkStack.checkNetworkStackPermission(mContext);
- try {
- mNetdService.networkRejectNonSecureVpn(add, toStableParcels(uidRanges));
- } catch (ServiceSpecificException e) {
- Log.w(TAG, "setAllowOnlyVpnForUids(" + add + ", " + Arrays.toString(uidRanges) + ")"
- + ": netd command failed", e);
- throw e;
- } catch (RemoteException e) {
- Log.w(TAG, "setAllowOnlyVpnForUids(" + add + ", " + Arrays.toString(uidRanges) + ")"
- + ": netd command failed", e);
- throw e.rethrowAsRuntimeException();
- }
- }
-
private void applyUidCleartextNetworkPolicy(int uid, int policy) {
final int policyValue;
switch (policy) {
@@ -1554,27 +1520,6 @@
}
@Override
- public void addVpnUidRanges(int netId, UidRange[] ranges) {
- NetworkStack.checkNetworkStackPermission(mContext);
-
- try {
- mNetdService.networkAddUidRanges(netId, toStableParcels(ranges));
- } catch (RemoteException | ServiceSpecificException e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
- public void removeVpnUidRanges(int netId, UidRange[] ranges) {
- NetworkStack.checkNetworkStackPermission(mContext);
- try {
- mNetdService.networkRemoveUidRanges(netId, toStableParcels(ranges));
- } catch (RemoteException | ServiceSpecificException e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
public void setFirewallEnabled(boolean enabled) {
enforceSystemUid();
try {
@@ -1617,7 +1562,7 @@
ranges = new UidRangeParcel[] {
// TODO: is there a better way of finding all existing users? If so, we could
// specify their ranges here.
- makeUidRangeParcel(Process.FIRST_APPLICATION_UID, Integer.MAX_VALUE),
+ new UidRangeParcel(Process.FIRST_APPLICATION_UID, Integer.MAX_VALUE),
};
// ... except for the UIDs that have allow rules.
synchronized (mRulesLock) {
@@ -1648,7 +1593,7 @@
for (int i = 0; i < ranges.length; i++) {
if (rules.valueAt(i) == FIREWALL_RULE_DENY) {
int uid = rules.keyAt(i);
- ranges[numUids] = makeUidRangeParcel(uid, uid);
+ ranges[numUids] = new UidRangeParcel(uid, uid);
numUids++;
}
}
diff --git a/services/core/java/com/android/server/OWNERS b/services/core/java/com/android/server/OWNERS
index 8706cdf..a10764b 100644
--- a/services/core/java/com/android/server/OWNERS
+++ b/services/core/java/com/android/server/OWNERS
@@ -9,3 +9,24 @@
# Userspace reboot
per-file UserspaceRebootLogger.java = ioffe@google.com, tomcherry@google.com
+
+# Sensor Privacy
+per-file SensorPrivacyService.java = file:platform/frameworks/native:/libs/sensorprivacy/OWNERS
+
+per-file *Alarm* = file:/apex/jobscheduler/OWNERS
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
+per-file *Bluetooth* = file:/core/java/android/bluetooth/OWNERS
+per-file *Gnss* = file:/services/core/java/com/android/server/location/OWNERS
+per-file *Location* = file:/services/core/java/com/android/server/location/OWNERS
+per-file *Network* = file:/services/core/java/com/android/server/net/OWNERS
+per-file *Storage* = file:/core/java/android/os/storage/OWNERS
+per-file *TimeUpdate* = file:/core/java/android/app/timezone/OWNERS
+per-file ConnectivityService.java = file:/services/core/java/com/android/server/net/OWNERS
+per-file GestureLauncherService.java = file:platform/packages/apps/EmergencyInfo:/OWNERS
+per-file IpSecService.java = file:/services/core/java/com/android/server/net/OWNERS
+per-file MmsServiceBroker.java = file:/telephony/OWNERS
+per-file NetIdManager.java = file:/services/core/java/com/android/server/net/OWNERS
+per-file PackageWatchdog.java = file:/services/core/java/com/android/server/rollback/OWNERS
+per-file TelephonyRegistry.java = file:/telephony/OWNERS
+per-file UiModeManagerService.java = file:/packages/SystemUI/OWNERS
+per-file VcnManagementService.java = file:/services/core/java/com/android/server/vcn/OWNERS
diff --git a/services/core/java/com/android/server/SensorPrivacyService.java b/services/core/java/com/android/server/SensorPrivacyService.java
index 51e2b12..01021345 100644
--- a/services/core/java/com/android/server/SensorPrivacyService.java
+++ b/services/core/java/com/android/server/SensorPrivacyService.java
@@ -16,39 +16,68 @@
package com.android.server;
+import static android.app.AppOpsManager.MODE_ALLOWED;
+import static android.app.AppOpsManager.OP_CAMERA;
+import static android.app.AppOpsManager.OP_RECORD_AUDIO;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.service.SensorPrivacyIndividualEnabledSensorProto.CAMERA;
+import static android.service.SensorPrivacyIndividualEnabledSensorProto.MICROPHONE;
+import static android.service.SensorPrivacyIndividualEnabledSensorProto.UNKNOWN;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.app.AppOpsManager;
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.drawable.Icon;
import android.hardware.ISensorPrivacyListener;
import android.hardware.ISensorPrivacyManager;
+import android.hardware.SensorPrivacyManager;
+import android.os.Binder;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.os.ResultReceiver;
+import android.os.ShellCallback;
+import android.os.ShellCommand;
+import android.service.SensorPrivacyIndividualEnabledSensorProto;
+import android.service.SensorPrivacyServiceDumpProto;
import android.util.ArrayMap;
import android.util.AtomicFile;
+import android.util.IndentingPrintWriter;
import android.util.Log;
+import android.util.SparseBooleanArray;
import android.util.TypedXmlPullParser;
import android.util.TypedXmlSerializer;
import android.util.Xml;
+import android.util.proto.ProtoOutputStream;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.util.FastXmlSerializer;
+import com.android.internal.util.DumpUtils;
import com.android.internal.util.XmlUtils;
+import com.android.internal.util.dump.DualDumpOutputStream;
import com.android.internal.util.function.pooled.PooledLambda;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlSerializer;
import java.io.File;
+import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
+import java.io.PrintWriter;
import java.util.NoSuchElementException;
+import java.util.Objects;
/** @hide */
public final class SensorPrivacyService extends SystemService {
@@ -57,7 +86,15 @@
private static final String SENSOR_PRIVACY_XML_FILE = "sensor_privacy.xml";
private static final String XML_TAG_SENSOR_PRIVACY = "sensor-privacy";
+ private static final String XML_TAG_INDIVIDUAL_SENSOR_PRIVACY = "individual-sensor-privacy";
private static final String XML_ATTRIBUTE_ENABLED = "enabled";
+ private static final String XML_ATTRIBUTE_SENSOR = "sensor";
+
+ private static final String SENSOR_PRIVACY_CHANNEL_ID = Context.SENSOR_PRIVACY_SERVICE;
+ private static final String ACTION_DISABLE_INDIVIDUAL_SENSOR_PRIVACY =
+ SensorPrivacyService.class.getName() + ".action.disable_sensor_privacy";
+ private static final String EXTRA_SENSOR = SensorPrivacyService.class.getName()
+ + ".extra.sensor";
private final SensorPrivacyServiceImpl mSensorPrivacyServiceImpl;
@@ -71,7 +108,8 @@
publishBinderService(Context.SENSOR_PRIVACY_SERVICE, mSensorPrivacyServiceImpl);
}
- class SensorPrivacyServiceImpl extends ISensorPrivacyManager.Stub {
+ class SensorPrivacyServiceImpl extends ISensorPrivacyManager.Stub implements
+ AppOpsManager.OnOpNotedListener, AppOpsManager.OnOpStartedListener {
private final SensorPrivacyHandler mHandler;
private final Context mContext;
@@ -80,6 +118,7 @@
private final AtomicFile mAtomicFile;
@GuardedBy("mLock")
private boolean mEnabled;
+ private SparseBooleanArray mIndividualEnabled = new SparseBooleanArray();
SensorPrivacyServiceImpl(Context context) {
mContext = context;
@@ -88,8 +127,100 @@
SENSOR_PRIVACY_XML_FILE);
mAtomicFile = new AtomicFile(sensorPrivacyFile);
synchronized (mLock) {
- mEnabled = readPersistedSensorPrivacyEnabledLocked();
+ readPersistedSensorPrivacyStateLocked();
}
+
+ int[] micAndCameraOps = new int[]{OP_RECORD_AUDIO, OP_CAMERA};
+ AppOpsManager appOpsManager = mContext.getSystemService(AppOpsManager.class);
+ appOpsManager.startWatchingNoted(micAndCameraOps, this);
+ appOpsManager.startWatchingStarted(micAndCameraOps, this);
+
+ mContext.registerReceiver(new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ setIndividualSensorPrivacy(intent.getIntExtra(EXTRA_SENSOR, UNKNOWN), false);
+ }
+ }, new IntentFilter(ACTION_DISABLE_INDIVIDUAL_SENSOR_PRIVACY));
+ }
+
+ @Override
+ public void onOpStarted(int code, int uid, String packageName,
+ @AppOpsManager.OpFlags int flags, @AppOpsManager.Mode int result) {
+ onOpNoted(code, uid, packageName, flags, result);
+ }
+
+ @Override
+ public void onOpNoted(int code, int uid, String packageName,
+ @AppOpsManager.OpFlags int flags, @AppOpsManager.Mode int result) {
+ if (result != MODE_ALLOWED || (flags & AppOpsManager.OP_FLAGS_ALL_TRUSTED) == 0) {
+ return;
+ }
+
+ int sensor;
+ if (code == OP_RECORD_AUDIO) {
+ sensor = MICROPHONE;
+ } else {
+ sensor = CAMERA;
+ }
+
+ onSensorUseStarted(uid, packageName, sensor);
+ }
+
+ /**
+ * Called when a sensor protected by individual sensor privacy is attempting to get used.
+ *
+ * @param uid The uid of the app using the sensor
+ * @param packageName The package name of the app using the sensor
+ * @param sensor The sensor that is attempting to be used
+ */
+ private void onSensorUseStarted(int uid, String packageName, int sensor) {
+ if (!isIndividualSensorPrivacyEnabled(sensor)) {
+ return;
+ }
+
+ // TODO moltmann: Use dialog instead of notification if we can determine the activity
+ // which triggered this usage
+
+ // TODO evanseverson: - Implement final UX for notification
+ // - Finalize strings and icons and add as resources
+
+ int icon;
+ CharSequence notificationMessage;
+ if (sensor == MICROPHONE) {
+ icon = com.android.internal.R.drawable.ic_mic;
+ notificationMessage = "Microphone is muted because of sensor privacy";
+ } else {
+ icon = com.android.internal.R.drawable.ic_camera;
+ notificationMessage = "Camera is blocked because of sensor privacy";
+ }
+
+ NotificationManager notificationManager =
+ mContext.getSystemService(NotificationManager.class);
+ NotificationChannel channel = new NotificationChannel(
+ SENSOR_PRIVACY_CHANNEL_ID, "Sensor privacy",
+ NotificationManager.IMPORTANCE_HIGH);
+ channel.setSound(null, null);
+ channel.setBypassDnd(true);
+ channel.enableVibration(false);
+ channel.setBlockable(false);
+
+ notificationManager.createNotificationChannel(channel);
+
+ notificationManager.notify(sensor,
+ new Notification.Builder(mContext, SENSOR_PRIVACY_CHANNEL_ID)
+ .setContentTitle(notificationMessage)
+ .setSmallIcon(icon)
+ .addAction(new Notification.Action.Builder(
+ Icon.createWithResource(mContext, icon),
+ "Disable sensor privacy",
+ PendingIntent.getBroadcast(mContext, sensor,
+ new Intent(ACTION_DISABLE_INDIVIDUAL_SENSOR_PRIVACY)
+ .setPackage(mContext.getPackageName())
+ .putExtra(EXTRA_SENSOR, sensor),
+ PendingIntent.FLAG_IMMUTABLE
+ | PendingIntent.FLAG_UPDATE_CURRENT))
+ .build())
+ .build());
}
/**
@@ -101,24 +232,28 @@
enforceSensorPrivacyPermission();
synchronized (mLock) {
mEnabled = enable;
- FileOutputStream outputStream = null;
- try {
- outputStream = mAtomicFile.startWrite();
- TypedXmlSerializer serializer = Xml.resolveSerializer(outputStream);
- serializer.startDocument(null, true);
- serializer.startTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, enable);
- serializer.endTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.endDocument();
- mAtomicFile.finishWrite(outputStream);
- } catch (IOException e) {
- Log.e(TAG, "Caught an exception persisting the sensor privacy state: ", e);
- mAtomicFile.failWrite(outputStream);
- }
+ persistSensorPrivacyStateLocked();
}
mHandler.onSensorPrivacyChanged(enable);
}
+ public void setIndividualSensorPrivacy(int sensor, boolean enable) {
+ enforceSensorPrivacyPermission();
+ synchronized (mLock) {
+ mIndividualEnabled.put(sensor, enable);
+
+ if (!enable) {
+ // Remove any notifications prompting the user to disable sensory privacy
+ NotificationManager notificationManager =
+ mContext.getSystemService(NotificationManager.class);
+
+ notificationManager.cancel(sensor);
+ }
+
+ persistSensorPrivacyState();
+ }
+ }
+
/**
* Enforces the caller contains the necessary permission to change the state of sensor
* privacy.
@@ -143,30 +278,48 @@
}
}
+ @Override
+ public boolean isIndividualSensorPrivacyEnabled(int sensor) {
+ synchronized (mLock) {
+ return mIndividualEnabled.get(sensor, false);
+ }
+ }
+
/**
* Returns the state of sensor privacy from persistent storage.
*/
- private boolean readPersistedSensorPrivacyEnabledLocked() {
+ private void readPersistedSensorPrivacyStateLocked() {
// if the file does not exist then sensor privacy has not yet been enabled on
// the device.
if (!mAtomicFile.exists()) {
- return false;
+ return;
}
- boolean enabled;
try (FileInputStream inputStream = mAtomicFile.openRead()) {
TypedXmlPullParser parser = Xml.resolvePullParser(inputStream);
XmlUtils.beginDocument(parser, XML_TAG_SENSOR_PRIVACY);
parser.next();
- String tagName = parser.getName();
- enabled = parser.getAttributeBoolean(null, XML_ATTRIBUTE_ENABLED, false);
+ mEnabled = parser.getAttributeBoolean(null, XML_ATTRIBUTE_ENABLED, false);
+
+ XmlUtils.nextElement(parser);
+ while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {
+ String tagName = parser.getName();
+ if (XML_TAG_INDIVIDUAL_SENSOR_PRIVACY.equals(tagName)) {
+ int sensor = XmlUtils.readIntAttribute(parser, XML_ATTRIBUTE_SENSOR);
+ boolean enabled = XmlUtils.readBooleanAttribute(parser,
+ XML_ATTRIBUTE_ENABLED);
+ mIndividualEnabled.put(sensor, enabled);
+ XmlUtils.skipCurrentTag(parser);
+ } else {
+ XmlUtils.nextElement(parser);
+ }
+ }
+
} catch (IOException | XmlPullParserException e) {
Log.e(TAG, "Caught an exception reading the state from storage: ", e);
// Delete the file to prevent the same error on subsequent calls and assume sensor
// privacy is not enabled.
mAtomicFile.delete();
- enabled = false;
}
- return enabled;
}
/**
@@ -174,20 +327,33 @@
*/
private void persistSensorPrivacyState() {
synchronized (mLock) {
- FileOutputStream outputStream = null;
- try {
- outputStream = mAtomicFile.startWrite();
- TypedXmlSerializer serializer = Xml.resolveSerializer(outputStream);
- serializer.startDocument(null, true);
- serializer.startTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, mEnabled);
- serializer.endTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.endDocument();
- mAtomicFile.finishWrite(outputStream);
- } catch (IOException e) {
- Log.e(TAG, "Caught an exception persisting the sensor privacy state: ", e);
- mAtomicFile.failWrite(outputStream);
+ persistSensorPrivacyStateLocked();
+ }
+ }
+
+ private void persistSensorPrivacyStateLocked() {
+ FileOutputStream outputStream = null;
+ try {
+ outputStream = mAtomicFile.startWrite();
+ TypedXmlSerializer serializer = Xml.resolveSerializer(outputStream);
+ serializer.startDocument(null, true);
+ serializer.startTag(null, XML_TAG_SENSOR_PRIVACY);
+ serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, mEnabled);
+ int numIndividual = mIndividualEnabled.size();
+ for (int i = 0; i < numIndividual; i++) {
+ serializer.startTag(null, XML_TAG_INDIVIDUAL_SENSOR_PRIVACY);
+ int sensor = mIndividualEnabled.keyAt(i);
+ boolean enabled = mIndividualEnabled.valueAt(i);
+ serializer.attributeInt(null, XML_ATTRIBUTE_SENSOR, sensor);
+ serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, enabled);
+ serializer.endTag(null, XML_TAG_INDIVIDUAL_SENSOR_PRIVACY);
}
+ serializer.endTag(null, XML_TAG_SENSOR_PRIVACY);
+ serializer.endDocument();
+ mAtomicFile.finishWrite(outputStream);
+ } catch (IOException e) {
+ Log.e(TAG, "Caught an exception persisting the sensor privacy state: ", e);
+ mAtomicFile.failWrite(outputStream);
}
}
@@ -212,6 +378,170 @@
}
mHandler.removeListener(listener);
}
+
+ @Override
+ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ Objects.requireNonNull(fd);
+
+ if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
+
+ int opti = 0;
+ boolean dumpAsProto = false;
+ while (opti < args.length) {
+ String opt = args[opti];
+ if (opt == null || opt.length() <= 0 || opt.charAt(0) != '-') {
+ break;
+ }
+ opti++;
+ if ("--proto".equals(opt)) {
+ dumpAsProto = true;
+ } else {
+ pw.println("Unknown argument: " + opt + "; use -h for help");
+ }
+ }
+
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ if (dumpAsProto) {
+ dump(new DualDumpOutputStream(new ProtoOutputStream(fd)));
+ } else {
+ pw.println("SENSOR PRIVACY MANAGER STATE (dumpsys "
+ + Context.SENSOR_PRIVACY_SERVICE + ")");
+
+ dump(new DualDumpOutputStream(new IndentingPrintWriter(pw, " ")));
+ }
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
+ * Dump state to {@link DualDumpOutputStream}.
+ *
+ * @param dumpStream The destination to dump to
+ */
+ private void dump(@NonNull DualDumpOutputStream dumpStream) {
+ synchronized (mLock) {
+ dumpStream.write("is_enabled", SensorPrivacyServiceDumpProto.IS_ENABLED, mEnabled);
+
+ int numIndividualEnabled = mIndividualEnabled.size();
+ for (int i = 0; i < numIndividualEnabled; i++) {
+ long token = dumpStream.start("individual_enabled_sensor",
+ SensorPrivacyServiceDumpProto.INDIVIDUAL_ENABLED_SENSOR);
+
+ dumpStream.write("sensor",
+ SensorPrivacyIndividualEnabledSensorProto.SENSOR,
+ mIndividualEnabled.keyAt(i));
+ dumpStream.write("is_enabled",
+ SensorPrivacyIndividualEnabledSensorProto.IS_ENABLED,
+ mIndividualEnabled.valueAt(i));
+
+ dumpStream.end(token);
+ }
+ }
+
+ dumpStream.flush();
+ }
+
+ /**
+ * Convert a string into a {@link SensorPrivacyManager.IndividualSensor id}.
+ *
+ * @param sensor The name to convert
+ *
+ * @return The id corresponding to the name
+ */
+ private @SensorPrivacyManager.IndividualSensor int sensorStrToId(@Nullable String sensor) {
+ if (sensor == null) {
+ return UNKNOWN;
+ }
+
+ switch (sensor) {
+ case "microphone":
+ return MICROPHONE;
+ case "camera":
+ return CAMERA;
+ default: {
+ return UNKNOWN;
+ }
+ }
+ }
+
+ @Override
+ public void onShellCommand(FileDescriptor in, FileDescriptor out,
+ FileDescriptor err, String[] args, ShellCallback callback,
+ ResultReceiver resultReceiver) {
+ (new ShellCommand() {
+ @Override
+ public int onCommand(String cmd) {
+ if (cmd == null) {
+ return handleDefaultCommands(cmd);
+ }
+
+ final PrintWriter pw = getOutPrintWriter();
+ switch (cmd) {
+ case "enable" : {
+ int sensor = sensorStrToId(getNextArg());
+ if (sensor == UNKNOWN) {
+ pw.println("Invalid sensor");
+ return -1;
+ }
+
+ setIndividualSensorPrivacy(sensor, true);
+ }
+ break;
+ case "disable" : {
+ int sensor = sensorStrToId(getNextArg());
+ if (sensor == UNKNOWN) {
+ pw.println("Invalid sensor");
+ return -1;
+ }
+
+ setIndividualSensorPrivacy(sensor, false);
+ }
+ break;
+ case "reset": {
+ int sensor = sensorStrToId(getNextArg());
+ if (sensor == UNKNOWN) {
+ pw.println("Invalid sensor");
+ return -1;
+ }
+
+ enforceSensorPrivacyPermission();
+
+ synchronized (mLock) {
+ mIndividualEnabled.delete(sensor);
+ persistSensorPrivacyState();
+ }
+ }
+ break;
+ default:
+ return handleDefaultCommands(cmd);
+ }
+
+ return 0;
+ }
+
+ @Override
+ public void onHelp() {
+ final PrintWriter pw = getOutPrintWriter();
+
+ pw.println("Sensor privacy manager (" + Context.SENSOR_PRIVACY_SERVICE
+ + ") commands:");
+ pw.println(" help");
+ pw.println(" Print this help text.");
+ pw.println("");
+ pw.println(" enable SENSOR");
+ pw.println(" Enable privacy for a certain sensor.");
+ pw.println("");
+ pw.println(" disable SENSOR");
+ pw.println(" Disable privacy for a certain sensor.");
+ pw.println("");
+ pw.println(" reset SENSOR");
+ pw.println(" Reset privacy state for a certain sensor.");
+ pw.println("");
+ }
+ }).exec(this, in, out, err, args, callback, resultReceiver);
+ }
}
/**
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index dbd27af4..ad547c5 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -108,7 +108,6 @@
import android.os.storage.StorageVolume;
import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
-import android.provider.DeviceConfig;
import android.provider.DocumentsContract;
import android.provider.Downloads;
import android.provider.MediaStore;
@@ -206,27 +205,6 @@
private static final String ANDROID_VOLD_APP_DATA_ISOLATION_ENABLED_PROPERTY =
"persist.sys.vold_app_data_isolation_enabled";
- // TODO(b/169327180): Will be fetched from the server, but for now, we emulate this in
- // the system_server since it can write to DeviceConfig and MediaProvider can read it
- private static final String PROP_TRANSCODE_ENABLED = "transcode_enabled";
- private static final String PROP_TRANSCODE_DEFAULT = "transcode_default";
- private static final String PROP_TRANSCODE_COMPAT_MANIFEST = "transcode_compat_manifest";
- private static final boolean TRANSCODE_ENABLED_VALUE = false;
- // Determines the default behavior of apps when transcode is enabled, AKA, Option A/Option B.
- // If true, transcode by default (Option B). If false, don't transcode by default (Option A)
- // For dogfood, we go with Option B
- private static final boolean TRANSCODE_DEFAULT_VALUE = true;
- // Format is <package_name>,<media_capability_bit_mask>,...
- // media_capability_bit_mask is defined in MediaProvider/../TranscodeHelper.java:
- // FLAG_HEVC = 1 << 0;
- // FLAG_SLOW_MOTION = 1 << 1;
- // FLAG_HDR_10 = 1 << 2;
- // FLAG_HDR_10_PLUS = 1 << 3;
- // FLAG_HDR_HLG = 1 << 4;
- // FLAG_HDR_DOLBY_VISION = 1 << 5;
- private static final String TRANSCODE_COMPAT_MANIFEST_VALUE =
- "com.google.android.apps.photos,1";
-
// How long we wait to reset storage, if we failed to call onMount on the
// external storage service.
public static final int FAILED_MOUNT_RESET_TIMEOUT_SECONDS = 10;
@@ -901,18 +879,6 @@
com.android.internal.R.bool.config_zramWriteback)) {
ZramWriteback.scheduleZramWriteback(mContext);
}
-
- // TODO(b/169327180): Remove after setting up server-side DeviceConfig flags
- // Set DeviceConfig values for transcoding that will be read by MediaProvider
- DeviceConfig.setProperty(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
- PROP_TRANSCODE_ENABLED, String.valueOf(TRANSCODE_ENABLED_VALUE),
- false /* makeDefault */);
- DeviceConfig.setProperty(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
- PROP_TRANSCODE_DEFAULT, String.valueOf(TRANSCODE_DEFAULT_VALUE),
- false /* makeDefault */);
- DeviceConfig.setProperty(DeviceConfig.NAMESPACE_STORAGE_NATIVE_BOOT,
- PROP_TRANSCODE_COMPAT_MANIFEST, TRANSCODE_COMPAT_MANIFEST_VALUE,
- false /* makeDefault */);
}
/**
@@ -4409,14 +4375,7 @@
// Create package obb and data dir if it doesn't exist.
int appUid = UserHandle.getUid(userId, mPmInternal.getPackage(pkg).getUid());
- File file = new File(packageObbDir);
- if (!file.exists()) {
- vold.setupAppDir(packageObbDir, appUid);
- }
- file = new File(packageDataDir);
- if (!file.exists()) {
- vold.setupAppDir(packageDataDir, appUid);
- }
+ vold.ensureAppDirsCreated(new String[] {packageObbDir, packageDataDir}, appUid);
}
} catch (ServiceManager.ServiceNotFoundException | RemoteException e) {
Slog.e(TAG, "Unable to create obb and data directories for " + processName,e);
@@ -4522,10 +4481,13 @@
// When using FUSE, we may need to kill the app if the op changes
switch(code) {
case OP_REQUEST_INSTALL_PACKAGES:
- if (previousMode == MODE_ALLOWED || mode == MODE_ALLOWED) {
- // If we transition to/from MODE_ALLOWED, kill the app to make
- // sure it has the correct view of /storage. Changing between
- // MODE_DEFAULT / MODE_ERRORED is a no-op
+ // In R, we used to kill the app here if it transitioned to/from
+ // MODE_ALLOWED, to make sure the app had the correct (writable) OBB
+ // view. But the majority of apps don't handle OBBs anyway, and for those
+ // that do, they can restart themselves. Therefore, starting from S,
+ // only kill the app when it transitions away from MODE_ALLOWED (eg,
+ // when the permission is taken away).
+ if (previousMode == MODE_ALLOWED && mode != MODE_ALLOWED) {
killAppForOpChange(code, uid);
}
return;
diff --git a/services/core/java/com/android/server/SystemServiceManager.java b/services/core/java/com/android/server/SystemServiceManager.java
index 9d60b84..cb6e73a 100644
--- a/services/core/java/com/android/server/SystemServiceManager.java
+++ b/services/core/java/com/android/server/SystemServiceManager.java
@@ -60,12 +60,12 @@
// Constants used on onUser(...)
// NOTE: do not change their values, as they're used on Trace calls and changes might break
// performance tests that rely on them.
- private static final String USER_STARTING = "Start";
- private static final String USER_UNLOCKING = "Unlocking";
- private static final String USER_UNLOCKED = "Unlocked";
- private static final String USER_SWITCHING = "Switch";
- private static final String USER_STOPPING = "Stop";
- private static final String USER_STOPPED = "Cleanup";
+ private static final String USER_STARTING = "Start"; // Logged as onStartUser
+ private static final String USER_UNLOCKING = "Unlocking"; // Logged as onUnlockingUser
+ private static final String USER_UNLOCKED = "Unlocked"; // Logged as onUnlockedUser
+ private static final String USER_SWITCHING = "Switch"; // Logged as onSwitchUser
+ private static final String USER_STOPPING = "Stop"; // Logged as onStopUser
+ private static final String USER_STOPPED = "Cleanup"; // Logged as onCleanupUser
private static File sSystemDir;
private final Context mContext;
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 52eb77d..ae5c131 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -2361,6 +2361,40 @@
}
}
+ /**
+ * Notify that the data enabled has changed.
+ *
+ * @param enabled True if data is enabled, otherwise disabled.
+ * @param reason Reason for data enabled/disabled. See {@code DATA_*} in
+ * {@link TelephonyManager}.
+ */
+ public void notifyDataEnabled(boolean enabled,
+ @TelephonyManager.DataEnabledReason int reason) {
+ if (!checkNotifyPermission("notifyDataEnabled()")) {
+ return;
+ }
+
+ if (VDBG) {
+ log("notifyDataEnabled: enabled=" + enabled + " reason=" + reason);
+ }
+
+ mIsDataEnabled = enabled;
+ mDataEnabledReason = reason;
+ synchronized (mRecords) {
+ for (Record r : mRecords) {
+ if (r.matchPhoneStateListenerEvent(
+ PhoneStateListener.EVENT_DATA_ENABLED_CHANGED)) {
+ try {
+ r.callback.onDataEnabledChanged(enabled, reason);
+ } catch (RemoteException ex) {
+ mRemoveList.add(r.binder);
+ }
+ }
+ }
+ handleRemoveListLocked();
+ }
+ }
+
@Override
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
@@ -2413,6 +2447,8 @@
pw.println("mDefaultPhoneId=" + mDefaultPhoneId);
pw.println("mDefaultSubId=" + mDefaultSubId);
pw.println("mPhysicalChannelConfigs=" + mPhysicalChannelConfigs);
+ pw.println("mIsDataEnabled=" + mIsDataEnabled);
+ pw.println("mDataEnabledReason=" + mDataEnabledReason);
pw.decreaseIndent();
diff --git a/services/core/java/com/android/server/TestNetworkService.java b/services/core/java/com/android/server/TestNetworkService.java
index a45466d..655d8ab 100644
--- a/services/core/java/com/android/server/TestNetworkService.java
+++ b/services/core/java/com/android/server/TestNetworkService.java
@@ -61,9 +61,8 @@
/** @hide */
class TestNetworkService extends ITestNetworkManager.Stub {
- @NonNull private static final String TAG = TestNetworkService.class.getSimpleName();
@NonNull private static final String TEST_NETWORK_LOGTAG = "TestNetworkAgent";
- @NonNull private static final String TEST_NETWORK_PROVIDER_NAME = TAG;
+ @NonNull private static final String TEST_NETWORK_PROVIDER_NAME = "TestNetworkProvider";
@NonNull private static final AtomicInteger sTestTunIndex = new AtomicInteger();
@NonNull private final Context mContext;
@@ -168,17 +167,15 @@
private TestNetworkAgent(
@NonNull Context context,
@NonNull Looper looper,
- @NonNull NetworkAgentConfig config,
@NonNull NetworkCapabilities nc,
@NonNull LinkProperties lp,
+ @NonNull NetworkAgentConfig config,
int uid,
@NonNull IBinder binder,
@NonNull NetworkProvider np)
throws RemoteException {
super(context, looper, TEST_NETWORK_LOGTAG, nc, lp, NETWORK_SCORE, config, np);
-
mUid = uid;
-
synchronized (mBinderLock) {
mBinder = binder; // Binder null-checks in create()
@@ -220,7 +217,7 @@
// Has to be in TestNetworkAgent to ensure all teardown codepaths properly clean up
// resources, even for binder death or unwanted calls.
synchronized (mTestNetworkTracker) {
- mTestNetworkTracker.remove(getNetwork().netId);
+ mTestNetworkTracker.remove(getNetwork().getNetId());
}
}
}
@@ -286,8 +283,8 @@
lp.addRoute(new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), null, iface));
}
- final TestNetworkAgent agent = new TestNetworkAgent(context, looper,
- new NetworkAgentConfig.Builder().build(), nc, lp, callingUid, binder,
+ final TestNetworkAgent agent = new TestNetworkAgent(context, looper, nc, lp,
+ new NetworkAgentConfig.Builder().build(), callingUid, binder,
mNetworkProvider);
agent.register();
agent.markConnected();
@@ -339,7 +336,7 @@
administratorUids,
binder);
- mTestNetworkTracker.put(agent.getNetwork().netId, agent);
+ mTestNetworkTracker.put(agent.getNetwork().getNetId(), agent);
}
} catch (SocketException e) {
throw new UncheckedIOException(e);
diff --git a/services/core/java/com/android/server/VibratorManagerService.java b/services/core/java/com/android/server/VibratorManagerService.java
index f1f2815..eca1dfa 100644
--- a/services/core/java/com/android/server/VibratorManagerService.java
+++ b/services/core/java/com/android/server/VibratorManagerService.java
@@ -16,32 +16,85 @@
package com.android.server;
+import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.AppOpsManager;
import android.content.Context;
+import android.content.pm.PackageManager;
+import android.hardware.vibrator.IVibrator;
import android.os.CombinedVibrationEffect;
+import android.os.Handler;
import android.os.IBinder;
import android.os.IVibratorManagerService;
+import android.os.Looper;
import android.os.ResultReceiver;
import android.os.ShellCallback;
import android.os.ShellCommand;
+import android.os.Trace;
import android.os.VibrationAttributes;
+import android.os.VibrationEffect;
+import android.os.Vibrator;
+import android.os.VibratorInfo;
+import android.util.Slog;
+import android.util.SparseArray;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.vibrator.Vibration;
+import com.android.server.vibrator.VibrationScaler;
+import com.android.server.vibrator.VibrationSettings;
+import com.android.server.vibrator.VibratorController;
import libcore.util.NativeAllocationRegistry;
import java.io.FileDescriptor;
import java.io.PrintWriter;
+import java.lang.ref.WeakReference;
import java.util.Arrays;
+import java.util.function.Consumer;
+import java.util.function.Function;
/** System implementation of {@link IVibratorManagerService}. */
public class VibratorManagerService extends IVibratorManagerService.Stub {
private static final String TAG = "VibratorManagerService";
private static final boolean DEBUG = false;
+ private static final VibrationAttributes DEFAULT_ATTRIBUTES =
+ new VibrationAttributes.Builder().build();
+ /** Lifecycle responsible for initializing this class at the right system server phases. */
+ public static class Lifecycle extends SystemService {
+ private VibratorManagerService mService;
+
+ public Lifecycle(Context context) {
+ super(context);
+ }
+
+ @Override
+ public void onStart() {
+ mService = new VibratorManagerService(getContext(), new Injector());
+ publishBinderService("vibrator_manager", mService);
+ }
+
+ @Override
+ public void onBootPhase(int phase) {
+ if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
+ mService.systemReady();
+ }
+ }
+ }
+
+ private final Object mLock = new Object();
private final Context mContext;
+ private final Handler mHandler;
+ private final AppOpsManager mAppOps;
private final NativeWrapper mNativeWrapper;
private final int[] mVibratorIds;
+ private final SparseArray<VibratorController> mVibrators;
+ @GuardedBy("mLock")
+ private final SparseArray<AlwaysOnVibration> mAlwaysOnEffects = new SparseArray<>();
+
+ private VibrationSettings mVibrationSettings;
+ private VibrationScaler mVibrationScaler;
static native long nativeInit();
@@ -49,19 +102,53 @@
static native int[] nativeGetVibratorIds(long nativeServicePtr);
- VibratorManagerService(Context context) {
- this(context, new Injector());
- }
-
@VisibleForTesting
VibratorManagerService(Context context, Injector injector) {
mContext = context;
+ mHandler = injector.createHandler(Looper.myLooper());
mNativeWrapper = injector.getNativeWrapper();
-
mNativeWrapper.init();
+ mAppOps = mContext.getSystemService(AppOpsManager.class);
+
int[] vibratorIds = mNativeWrapper.getVibratorIds();
- mVibratorIds = vibratorIds == null ? new int[0] : vibratorIds;
+ if (vibratorIds == null) {
+ mVibratorIds = new int[0];
+ mVibrators = new SparseArray<>(0);
+ } else {
+ // Keep original vibrator id order, which might be meaningful.
+ mVibratorIds = vibratorIds;
+ mVibrators = new SparseArray<>(mVibratorIds.length);
+ VibrationCompleteListener listener = new VibrationCompleteListener(this);
+ for (int vibratorId : vibratorIds) {
+ mVibrators.put(vibratorId, injector.createVibratorController(vibratorId, listener));
+ }
+ }
+ }
+
+ /** Finish initialization at boot phase {@link SystemService#PHASE_SYSTEM_SERVICES_READY}. */
+ @VisibleForTesting
+ void systemReady() {
+ Slog.v(TAG, "Initializing VibratorManager service...");
+ Trace.traceBegin(Trace.TRACE_TAG_VIBRATOR, "systemReady");
+ try {
+ mVibrationSettings = new VibrationSettings(mContext, mHandler);
+ mVibrationScaler = new VibrationScaler(mContext, mVibrationSettings);
+
+ mVibrationSettings.addListener(this::updateServiceState);
+
+ updateServiceState();
+ } finally {
+ Slog.v(TAG, "VibratorManager service initialized");
+ Trace.traceEnd(Trace.TRACE_TAG_VIBRATOR);
+ }
+ }
+
+ @Override // Binder call
+ @Nullable
+ public VibratorInfo getVibratorInfo(int vibratorId) {
+ VibratorController controller = mVibrators.get(vibratorId);
+ return controller == null ? null : controller.getVibratorInfo();
}
@Override // Binder call
@@ -70,7 +157,48 @@
}
@Override // Binder call
- public void vibrate(int uid, String opPkg, CombinedVibrationEffect effect,
+ public boolean setAlwaysOnEffect(int uid, String opPkg, int alwaysOnId,
+ @Nullable CombinedVibrationEffect effect, @Nullable VibrationAttributes attrs) {
+ Trace.traceBegin(Trace.TRACE_TAG_VIBRATOR, "setAlwaysOnEffect");
+ try {
+ if (!hasPermission(android.Manifest.permission.VIBRATE_ALWAYS_ON)) {
+ throw new SecurityException("Requires VIBRATE_ALWAYS_ON permission");
+ }
+ if (effect == null) {
+ synchronized (mLock) {
+ mAlwaysOnEffects.delete(alwaysOnId);
+ onAllVibratorsLocked(v -> {
+ if (v.hasCapability(IVibrator.CAP_ALWAYS_ON_CONTROL)) {
+ v.updateAlwaysOn(alwaysOnId, /* effect= */ null);
+ }
+ });
+ }
+ return true;
+ }
+ if (!isEffectValid(effect)) {
+ return false;
+ }
+ attrs = fixupVibrationAttributes(attrs);
+ synchronized (mLock) {
+ SparseArray<VibrationEffect.Prebaked> effects = fixupAlwaysOnEffectsLocked(effect);
+ if (effects == null) {
+ // Invalid effects set in CombinedVibrationEffect, or always-on capability is
+ // missing on individual vibrators.
+ return false;
+ }
+ AlwaysOnVibration alwaysOnVibration = new AlwaysOnVibration(
+ alwaysOnId, uid, opPkg, attrs, effects);
+ mAlwaysOnEffects.put(alwaysOnId, alwaysOnVibration);
+ updateAlwaysOnLocked(alwaysOnVibration);
+ }
+ return true;
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_VIBRATOR);
+ }
+ }
+
+ @Override // Binder call
+ public void vibrate(int uid, String opPkg, @NonNull CombinedVibrationEffect effect,
@Nullable VibrationAttributes attrs, String reason, IBinder token) {
throw new UnsupportedOperationException("Not implemented");
}
@@ -86,6 +214,201 @@
new VibratorManagerShellCommand(this).exec(this, in, out, err, args, cb, resultReceiver);
}
+ private void updateServiceState() {
+ synchronized (mLock) {
+ for (int i = 0; i < mAlwaysOnEffects.size(); i++) {
+ updateAlwaysOnLocked(mAlwaysOnEffects.valueAt(i));
+ }
+ }
+ }
+
+ @GuardedBy("mLock")
+ private void updateAlwaysOnLocked(AlwaysOnVibration vib) {
+ for (int i = 0; i < vib.effects.size(); i++) {
+ VibratorController vibrator = mVibrators.get(vib.effects.keyAt(i));
+ VibrationEffect.Prebaked effect = vib.effects.valueAt(i);
+ if (vibrator == null) {
+ continue;
+ }
+ Vibration.Status ignoredStatus = shouldIgnoreVibrationLocked(
+ vib.uid, vib.opPkg, vib.attrs);
+ if (ignoredStatus == null) {
+ effect = mVibrationScaler.scale(effect, vib.attrs.getUsage());
+ } else {
+ // Vibration should not run, use null effect to remove registered effect.
+ effect = null;
+ }
+ vibrator.updateAlwaysOn(vib.alwaysOnId, effect);
+ }
+ }
+
+ /**
+ * Check if a vibration with given {@code uid}, {@code opPkg} and {@code attrs} should be
+ * ignored by this service.
+ *
+ * @param uid The user id of this vibration
+ * @param opPkg The package name of this vibration
+ * @param attrs The attributes of this vibration
+ * @return One of Vibration.Status.IGNORED_* values if the vibration should be ignored.
+ */
+ @GuardedBy("mLock")
+ @Nullable
+ private Vibration.Status shouldIgnoreVibrationLocked(int uid, String opPkg,
+ VibrationAttributes attrs) {
+ if (!mVibrationSettings.shouldVibrateForPowerMode(attrs.getUsage())) {
+ return Vibration.Status.IGNORED_FOR_POWER;
+ }
+
+ int intensity = mVibrationSettings.getCurrentIntensity(attrs.getUsage());
+ if (intensity == Vibrator.VIBRATION_INTENSITY_OFF) {
+ return Vibration.Status.IGNORED_FOR_SETTINGS;
+ }
+
+ if (!mVibrationSettings.shouldVibrateForRingerMode(attrs.getUsage())) {
+ if (DEBUG) {
+ Slog.e(TAG, "Vibrate ignored, not vibrating for ringtones");
+ }
+ return Vibration.Status.IGNORED_RINGTONE;
+ }
+
+ int mode = getAppOpMode(uid, opPkg, attrs);
+ if (mode != AppOpsManager.MODE_ALLOWED) {
+ if (mode == AppOpsManager.MODE_ERRORED) {
+ // We might be getting calls from within system_server, so we don't actually
+ // want to throw a SecurityException here.
+ Slog.w(TAG, "Would be an error: vibrate from uid " + uid);
+ return Vibration.Status.IGNORED_ERROR_APP_OPS;
+ } else {
+ return Vibration.Status.IGNORED_APP_OPS;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Check which mode should be set for a vibration with given {@code uid}, {@code opPkg} and
+ * {@code attrs}. This will return one of the AppOpsManager.MODE_*.
+ */
+ private int getAppOpMode(int uid, String opPkg, VibrationAttributes attrs) {
+ int mode = mAppOps.checkAudioOpNoThrow(AppOpsManager.OP_VIBRATE,
+ attrs.getAudioUsage(), uid, opPkg);
+ if (mode == AppOpsManager.MODE_ALLOWED) {
+ mode = mAppOps.startOpNoThrow(AppOpsManager.OP_VIBRATE, uid, opPkg);
+ }
+ if (mode == AppOpsManager.MODE_IGNORED
+ && attrs.isFlagSet(VibrationAttributes.FLAG_BYPASS_INTERRUPTION_POLICY)) {
+ // If we're just ignoring the vibration op then this is set by DND and we should ignore
+ // if we're asked to bypass. AppOps won't be able to record this operation, so make
+ // sure we at least note it in the logs for debugging.
+ Slog.d(TAG, "Bypassing DND for vibrate from uid " + uid);
+ mode = AppOpsManager.MODE_ALLOWED;
+ }
+ return mode;
+ }
+
+ /**
+ * Validate the incoming {@link CombinedVibrationEffect}.
+ *
+ * We can't throw exceptions here since we might be called from some system_server component,
+ * which would bring the whole system down.
+ *
+ * @return whether the CombinedVibrationEffect is non-null and valid
+ */
+ private static boolean isEffectValid(@Nullable CombinedVibrationEffect effect) {
+ if (effect == null) {
+ Slog.wtf(TAG, "effect must not be null");
+ return false;
+ }
+ try {
+ effect.validate();
+ } catch (Exception e) {
+ Slog.wtf(TAG, "Encountered issue when verifying CombinedVibrationEffect.", e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Return new {@link VibrationAttributes} that only applies flags that this user has permissions
+ * to use.
+ */
+ private VibrationAttributes fixupVibrationAttributes(@Nullable VibrationAttributes attrs) {
+ if (attrs == null) {
+ attrs = DEFAULT_ATTRIBUTES;
+ }
+ if (attrs.isFlagSet(VibrationAttributes.FLAG_BYPASS_INTERRUPTION_POLICY)) {
+ if (!(hasPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)
+ || hasPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ || hasPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING))) {
+ final int flags = attrs.getFlags()
+ & ~VibrationAttributes.FLAG_BYPASS_INTERRUPTION_POLICY;
+ attrs = new VibrationAttributes.Builder(attrs)
+ .setFlags(flags, attrs.getFlags()).build();
+ }
+ }
+ return attrs;
+ }
+
+ @GuardedBy("mLock")
+ @Nullable
+ private SparseArray<VibrationEffect.Prebaked> fixupAlwaysOnEffectsLocked(
+ CombinedVibrationEffect effect) {
+ Trace.traceBegin(Trace.TRACE_TAG_VIBRATOR, "fixupAlwaysOnEffectsLocked");
+ try {
+ SparseArray<VibrationEffect> effects;
+ if (effect instanceof CombinedVibrationEffect.Mono) {
+ VibrationEffect syncedEffect = ((CombinedVibrationEffect.Mono) effect).getEffect();
+ effects = transformAllVibratorsLocked(unused -> syncedEffect);
+ } else if (effect instanceof CombinedVibrationEffect.Stereo) {
+ effects = ((CombinedVibrationEffect.Stereo) effect).getEffects();
+ } else {
+ // Only synced combinations can be used for always-on effects.
+ return null;
+ }
+ SparseArray<VibrationEffect.Prebaked> result = new SparseArray<>();
+ for (int i = 0; i < effects.size(); i++) {
+ VibrationEffect prebaked = effects.valueAt(i);
+ if (!(prebaked instanceof VibrationEffect.Prebaked)) {
+ Slog.e(TAG, "Only prebaked effects supported for always-on.");
+ return null;
+ }
+ int vibratorId = effects.keyAt(i);
+ VibratorController vibrator = mVibrators.get(vibratorId);
+ if (vibrator != null && vibrator.hasCapability(IVibrator.CAP_ALWAYS_ON_CONTROL)) {
+ result.put(vibratorId, (VibrationEffect.Prebaked) prebaked);
+ }
+ }
+ if (result.size() == 0) {
+ return null;
+ }
+ return result;
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_VIBRATOR);
+ }
+ }
+
+ private boolean hasPermission(String permission) {
+ return mContext.checkCallingOrSelfPermission(permission)
+ == PackageManager.PERMISSION_GRANTED;
+ }
+
+ @GuardedBy("mLock")
+ private void onAllVibratorsLocked(Consumer<VibratorController> consumer) {
+ for (int i = 0; i < mVibrators.size(); i++) {
+ consumer.accept(mVibrators.valueAt(i));
+ }
+ }
+
+ @GuardedBy("mLock")
+ private <T> SparseArray<T> transformAllVibratorsLocked(Function<VibratorController, T> fn) {
+ SparseArray<T> ret = new SparseArray<>(mVibrators.size());
+ for (int i = 0; i < mVibrators.size(); i++) {
+ ret.put(mVibrators.keyAt(i), fn.apply(mVibrators.valueAt(i)));
+ }
+ return ret;
+ }
+
/** Point of injection for test dependencies */
@VisibleForTesting
static class Injector {
@@ -93,6 +416,57 @@
NativeWrapper getNativeWrapper() {
return new NativeWrapper();
}
+
+ Handler createHandler(Looper looper) {
+ return new Handler(looper);
+ }
+
+ VibratorController createVibratorController(int vibratorId,
+ VibratorController.OnVibrationCompleteListener listener) {
+ return new VibratorController(vibratorId, listener);
+ }
+ }
+
+ /**
+ * Implementation of {@link VibratorController.OnVibrationCompleteListener} with a weak
+ * reference to this service.
+ */
+ private static final class VibrationCompleteListener implements
+ VibratorController.OnVibrationCompleteListener {
+ private WeakReference<VibratorManagerService> mServiceRef;
+
+ VibrationCompleteListener(VibratorManagerService service) {
+ mServiceRef = new WeakReference<>(service);
+ }
+
+ @Override
+ public void onComplete(int vibratorId, long vibrationId) {
+ VibratorManagerService service = mServiceRef.get();
+ if (service != null) {
+ // TODO(b/159207608): finish vibration if all vibrators finished for this vibration
+ }
+ }
+ }
+
+ /**
+ * Combination of prekabed vibrations on multiple vibrators, with the same {@link
+ * VibrationAttributes}, that can be set for always-on effects.
+ */
+ private static final class AlwaysOnVibration {
+ public final int alwaysOnId;
+ public final int uid;
+ public final String opPkg;
+ public final VibrationAttributes attrs;
+ public final SparseArray<VibrationEffect.Prebaked> effects;
+
+ AlwaysOnVibration(int alwaysOnId, int uid, String opPkg, VibrationAttributes attrs,
+ SparseArray<VibrationEffect.Prebaked> effects) {
+ this.alwaysOnId = alwaysOnId;
+ this.uid = uid;
+ this.opPkg = opPkg;
+ this.attrs = attrs;
+ this.effects = effects;
+ }
}
/** Wrapper around the static-native methods of {@link VibratorManagerService} for tests. */
@@ -120,7 +494,7 @@
}
}
- /** Provides limited functionality from {@link VibratorManagerService} as shell commands. */
+ /** Provide limited functionality from {@link VibratorManagerService} as shell commands. */
private final class VibratorManagerShellCommand extends ShellCommand {
private final IBinder mToken;
diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java
index db2b4e4..6a9715e 100644
--- a/services/core/java/com/android/server/VibratorService.java
+++ b/services/core/java/com/android/server/VibratorService.java
@@ -19,7 +19,6 @@
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.AppOpsManager;
-import android.app.IUidObserver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -37,9 +36,6 @@
import android.os.IVibratorStateListener;
import android.os.Looper;
import android.os.PowerManager;
-import android.os.PowerManager.ServiceType;
-import android.os.PowerManagerInternal;
-import android.os.PowerSaveState;
import android.os.Process;
import android.os.RemoteException;
import android.os.ResultReceiver;
@@ -51,9 +47,9 @@
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
import android.os.Vibrator;
+import android.os.VibratorInfo;
import android.os.WorkSource;
import android.util.Slog;
-import android.util.SparseArray;
import android.util.proto.ProtoOutputStream;
import com.android.internal.annotations.GuardedBy;
@@ -73,7 +69,6 @@
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.LinkedList;
-import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/** System implementation of {@link IVibratorService}. */
@@ -95,7 +90,6 @@
private final LinkedList<Vibration.DebugInfo> mPreviousExternalVibrations;
private final LinkedList<Vibration.DebugInfo> mPreviousVibrations;
private final int mPreviousVibrationsLimit;
- private final SparseArray<Integer> mProcStatesCache = new SparseArray<>();
private final WorkSource mTmpWorkSource = new WorkSource();
private final Handler mH;
private final Object mLock = new Object();
@@ -106,7 +100,6 @@
private final AppOpsManager mAppOps;
private final IBatteryStats mBatteryStatsService;
private final String mSystemUiPackage;
- private PowerManagerInternal mPowerManagerInternal;
private VibrationSettings mVibrationSettings;
private VibrationScaler mVibrationScaler;
private InputDeviceDelegate mInputDeviceDelegate;
@@ -119,31 +112,6 @@
private VibrationDeathRecipient mCurrentVibrationDeathRecipient;
private int mCurVibUid = -1;
private ExternalVibrationHolder mCurrentExternalVibration;
- private boolean mLowPowerMode;
- private SparseArray<Vibration> mAlwaysOnEffects = new SparseArray<>();
-
- private final IUidObserver mUidObserver = new IUidObserver.Stub() {
- @Override public void onUidStateChanged(int uid, int procState, long procStateSeq,
- int capability) {
- mProcStatesCache.put(uid, procState);
- }
-
- @Override public void onUidGone(int uid, boolean disabled) {
- mProcStatesCache.delete(uid);
- }
-
- @Override
- public void onUidActive(int uid) {
- }
-
- @Override
- public void onUidIdle(int uid, boolean disabled) {
- }
-
- @Override
- public void onUidCachedChanged(int uid, boolean cached) {
- }
- };
/**
* Implementation of {@link OnVibrationCompleteListener} with a weak reference to this service.
@@ -277,37 +245,15 @@
mVibrationScaler = new VibrationScaler(mContext, mVibrationSettings);
mInputDeviceDelegate = new InputDeviceDelegate(mContext, mH);
- mPowerManagerInternal = LocalServices.getService(PowerManagerInternal.class);
- mPowerManagerInternal.registerLowPowerModeObserver(
- new PowerManagerInternal.LowPowerModeListener() {
- @Override
- public int getServiceType() {
- return ServiceType.VIBRATION;
- }
-
- @Override
- public void onLowPowerModeChanged(PowerSaveState result) {
- updateVibrators();
- }
- });
-
mVibrationSettings.addListener(this::updateVibrators);
mContext.registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- updateVibrators();
+ mVibrationSettings.updateSettings();
}
}, new IntentFilter(Intent.ACTION_USER_SWITCHED), null, mH);
- try {
- ActivityManager.getService().registerUidObserver(mUidObserver,
- ActivityManager.UID_OBSERVER_PROCSTATE | ActivityManager.UID_OBSERVER_GONE,
- ActivityManager.PROCESS_STATE_UNKNOWN, null);
- } catch (RemoteException e) {
- // ignored; both services live in system_server
- }
-
updateVibrators();
} finally {
Trace.traceEnd(Trace.TRACE_TAG_VIBRATOR);
@@ -346,6 +292,11 @@
}
@Override // Binder call
+ public VibratorInfo getVibratorInfo() {
+ return mVibratorController.getVibratorInfo();
+ }
+
+ @Override // Binder call
public boolean registerVibratorStateListener(IVibratorStateListener listener) {
if (!hasPermission(android.Manifest.permission.ACCESS_VIBRATOR_STATE)) {
throw new SecurityException("Requires ACCESS_VIBRATOR_STATE permission");
@@ -369,61 +320,6 @@
|| mVibratorController.hasCapability(IVibrator.CAP_AMPLITUDE_CONTROL);
}
- @Override // Binder call
- public int[] areEffectsSupported(int[] effectIds) {
- return mVibratorController.areEffectsSupported(effectIds);
- }
-
- @Override // Binder call
- public boolean[] arePrimitivesSupported(int[] primitiveIds) {
- return mVibratorController.arePrimitivesSupported(primitiveIds);
- }
-
- private static List<Integer> asList(int... vals) {
- if (vals == null) {
- return null;
- }
- List<Integer> l = new ArrayList<>(vals.length);
- for (int val : vals) {
- l.add(val);
- }
- return l;
- }
-
- @Override // Binder call
- public boolean setAlwaysOnEffect(int uid, String opPkg, int alwaysOnId, VibrationEffect effect,
- VibrationAttributes attrs) {
- if (!hasPermission(android.Manifest.permission.VIBRATE_ALWAYS_ON)) {
- throw new SecurityException("Requires VIBRATE_ALWAYS_ON permission");
- }
- if (!mVibratorController.hasCapability(IVibrator.CAP_ALWAYS_ON_CONTROL)) {
- Slog.e(TAG, "Always-on effects not supported.");
- return false;
- }
- if (effect == null) {
- synchronized (mLock) {
- mAlwaysOnEffects.delete(alwaysOnId);
- mVibratorController.updateAlwaysOn(alwaysOnId, /* effect= */ null);
- }
- } else {
- if (!verifyVibrationEffect(effect)) {
- return false;
- }
- if (!(effect instanceof VibrationEffect.Prebaked)) {
- Slog.e(TAG, "Only prebaked effects supported for always-on.");
- return false;
- }
- attrs = fixupVibrationAttributes(attrs);
- synchronized (mLock) {
- Vibration vib = new Vibration(null, mNextVibrationId.getAndIncrement(), effect,
- attrs, uid, opPkg, null);
- mAlwaysOnEffects.put(alwaysOnId, vib);
- updateAlwaysOnLocked(alwaysOnId, vib);
- }
- }
- return true;
- }
-
private void verifyIncomingUid(int uid) {
if (uid == Binder.getCallingUid()) {
return;
@@ -543,9 +439,7 @@
return;
}
- if (mProcStatesCache.get(uid, ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND)
- > ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND
- && !isNotification(vib) && !isRingtone(vib) && !isAlarm(vib)) {
+ if (!mVibrationSettings.shouldVibrateForUid(uid, vib.attrs.getUsage())) {
Slog.e(TAG, "Ignoring incoming vibration as process with"
+ " uid= " + uid + " is background,"
+ " attrs= " + vib.attrs);
@@ -582,16 +476,19 @@
private void endVibrationLocked(Vibration vib, Vibration.Status status) {
final LinkedList<Vibration.DebugInfo> previousVibrations;
- if (isRingtone(vib)) {
- previousVibrations = mPreviousRingVibrations;
- } else if (isNotification(vib)) {
- previousVibrations = mPreviousNotificationVibrations;
- } else if (isAlarm(vib)) {
- previousVibrations = mPreviousAlarmVibrations;
- } else {
- previousVibrations = mPreviousVibrations;
+ switch (vib.attrs.getUsage()) {
+ case VibrationAttributes.USAGE_NOTIFICATION:
+ previousVibrations = mPreviousNotificationVibrations;
+ break;
+ case VibrationAttributes.USAGE_RINGTONE:
+ previousVibrations = mPreviousRingVibrations;
+ break;
+ case VibrationAttributes.USAGE_ALARM:
+ previousVibrations = mPreviousAlarmVibrations;
+ break;
+ default:
+ previousVibrations = mPreviousVibrations;
}
-
if (previousVibrations.size() > mPreviousVibrationsLimit) {
previousVibrations.removeFirst();
}
@@ -706,17 +603,6 @@
}
}
- private boolean shouldVibrateForPowerModeLocked(Vibration vib) {
- if (!mLowPowerMode) {
- return true;
- }
-
- int usage = vib.attrs.getUsage();
- return usage == VibrationAttributes.USAGE_RINGTONE
- || usage == VibrationAttributes.USAGE_ALARM
- || usage == VibrationAttributes.USAGE_COMMUNICATION_REQUEST;
- }
-
/** Scale the vibration effect by the intensity as appropriate based its intent. */
private void applyVibrationIntensityScalingLocked(Vibration vib) {
vib.updateEffect(mVibrationScaler.scale(vib.getEffect(), vib.attrs.getUsage()));
@@ -744,7 +630,7 @@
}
private boolean shouldVibrate(Vibration vib) {
- if (!shouldVibrateForPowerModeLocked(vib)) {
+ if (!mVibrationSettings.shouldVibrateForPowerMode(vib.attrs.getUsage())) {
endVibrationLocked(vib, Vibration.Status.IGNORED_FOR_POWER);
return false;
}
@@ -755,7 +641,7 @@
return false;
}
- if (isRingtone(vib) && !mVibrationSettings.shouldVibrateForRingtone()) {
+ if (!mVibrationSettings.shouldVibrateForRingerMode(vib.attrs.getUsage())) {
if (DEBUG) {
Slog.e(TAG, "Vibrate ignored, not vibrating for ringtones");
}
@@ -769,7 +655,7 @@
// We might be getting calls from within system_server, so we don't actually
// want to throw a SecurityException here.
Slog.w(TAG, "Would be an error: vibrate from uid " + vib.uid);
- endVibrationLocked(vib, Vibration.Status.ERROR_APP_OPS);
+ endVibrationLocked(vib, Vibration.Status.IGNORED_ERROR_APP_OPS);
} else {
endVibrationLocked(vib, Vibration.Status.IGNORED_APP_OPS);
}
@@ -821,44 +707,11 @@
private void updateVibrators() {
synchronized (mLock) {
- boolean devicesUpdated = mInputDeviceDelegate.updateInputDeviceVibrators(
+ mInputDeviceDelegate.updateInputDeviceVibrators(
mVibrationSettings.shouldVibrateInputDevices());
- boolean lowPowerModeUpdated = updateLowPowerModeLocked();
- if (devicesUpdated || lowPowerModeUpdated) {
- // If the state changes out from under us then just reset.
- doCancelVibrateLocked(Vibration.Status.CANCELLED);
- }
-
- updateAlwaysOnLocked();
- }
- }
-
- private boolean updateLowPowerModeLocked() {
- boolean lowPowerMode = mPowerManagerInternal
- .getLowPowerState(ServiceType.VIBRATION).batterySaverEnabled;
- if (lowPowerMode != mLowPowerMode) {
- mLowPowerMode = lowPowerMode;
- return true;
- }
- return false;
- }
-
- private void updateAlwaysOnLocked(int id, Vibration vib) {
- VibrationEffect.Prebaked effect;
- if (!shouldVibrate(vib)) {
- effect = null;
- } else {
- effect = mVibrationScaler.scale(vib.getEffect(), vib.attrs.getUsage());
- }
- mVibratorController.updateAlwaysOn(id, effect);
- }
-
- private void updateAlwaysOnLocked() {
- for (int i = 0; i < mAlwaysOnEffects.size(); i++) {
- int id = mAlwaysOnEffects.keyAt(i);
- Vibration vib = mAlwaysOnEffects.valueAt(i);
- updateAlwaysOnLocked(id, vib);
+ // If the state changes out from under us then just reset.
+ doCancelVibrateLocked(Vibration.Status.CANCELLED);
}
}
@@ -994,23 +847,10 @@
}
- private static boolean isNotification(Vibration vib) {
- return vib.attrs.getUsage() == VibrationAttributes.USAGE_NOTIFICATION;
- }
-
- private static boolean isRingtone(Vibration vib) {
- return vib.attrs.getUsage() == VibrationAttributes.USAGE_RINGTONE;
- }
-
- private static boolean isHapticFeedback(Vibration vib) {
- return vib.attrs.getUsage() == VibrationAttributes.USAGE_TOUCH;
- }
-
- private static boolean isAlarm(Vibration vib) {
- return vib.attrs.getUsage() == VibrationAttributes.USAGE_ALARM;
- }
-
- private boolean isFromSystem(Vibration vib) {
+ private boolean isSystemHapticFeedback(Vibration vib) {
+ if (vib.attrs.getUsage() != VibrationAttributes.USAGE_TOUCH) {
+ return false;
+ }
return vib.uid == Process.SYSTEM_UID || vib.uid == 0 || mSystemUiPackage.equals(vib.opPkg);
}
@@ -1050,7 +890,6 @@
} else {
pw.println("null");
}
- pw.println(" mLowPowerMode=" + mLowPowerMode);
pw.println(" mVibratorController=" + mVibratorController);
pw.println(" mVibrationSettings=" + mVibrationSettings);
pw.println();
@@ -1097,7 +936,6 @@
proto.write(VibratorServiceDumpProto.IS_VIBRATING, mVibratorController.isVibrating());
proto.write(VibratorServiceDumpProto.VIBRATOR_UNDER_EXTERNAL_CONTROL,
mVibratorController.isUnderExternalControl());
- proto.write(VibratorServiceDumpProto.LOW_POWER_MODE, mLowPowerMode);
proto.write(VibratorServiceDumpProto.HAPTIC_FEEDBACK_INTENSITY,
mVibrationSettings.getCurrentIntensity(VibrationAttributes.USAGE_TOUCH));
proto.write(VibratorServiceDumpProto.HAPTIC_FEEDBACK_DEFAULT_INTENSITY,
@@ -1289,7 +1127,7 @@
static class Injector {
VibratorController createVibratorController(OnVibrationCompleteListener listener) {
- return new VibratorController(/* vibratorId= */ 0, listener);
+ return new VibratorController(/* vibratorId= */ -1, listener);
}
Handler createHandler(Looper looper) {
@@ -1311,9 +1149,7 @@
// them. However it may happen that the system is currently playing
// haptic feedback as part of the transition. So we don't cancel
// system vibrations.
- if (mCurrentVibration != null
- && !(isHapticFeedback(mCurrentVibration)
- && isFromSystem(mCurrentVibration))) {
+ if (mCurrentVibration != null && !isSystemHapticFeedback(mCurrentVibration)) {
doCancelVibrateLocked(Vibration.Status.CANCELLED);
}
}
@@ -1373,7 +1209,7 @@
vibHolder.scale = SCALE_MUTE;
if (mode == AppOpsManager.MODE_ERRORED) {
Slog.w(TAG, "Would be an error: external vibrate from uid " + vib.getUid());
- endVibrationLocked(vibHolder, Vibration.Status.ERROR_APP_OPS);
+ endVibrationLocked(vibHolder, Vibration.Status.IGNORED_ERROR_APP_OPS);
} else {
endVibrationLocked(vibHolder, Vibration.Status.IGNORED_APP_OPS);
}
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 9a94e4e..15e31ba 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -3085,7 +3085,8 @@
.setContentTitle(title)
.setContentText(subtitle)
.setContentIntent(PendingIntent.getActivityAsUser(mContext, 0, intent,
- PendingIntent.FLAG_CANCEL_CURRENT, null, user))
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ null, user))
.build();
installNotification(getCredentialPermissionNotificationId(
account, authTokenType, uid), n, packageName, user.getIdentifier());
@@ -5307,7 +5308,8 @@
.setContentTitle(String.format(notificationTitleFormat, account.name))
.setContentText(message)
.setContentIntent(PendingIntent.getActivityAsUser(
- mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT,
+ mContext, 0, intent,
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
null, new UserHandle(userId)))
.build();
installNotification(id, n, packageName, userId);
diff --git a/services/core/java/com/android/server/adb/OWNERS b/services/core/java/com/android/server/adb/OWNERS
new file mode 100644
index 0000000..b97f795
--- /dev/null
+++ b/services/core/java/com/android/server/adb/OWNERS
@@ -0,0 +1 @@
+include platform/packages/modules/adb:/OWNERS
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index dffe0ba..7d6e542 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -19,7 +19,6 @@
import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND;
import static android.Manifest.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND;
import static android.Manifest.permission.SYSTEM_ALERT_WINDOW;
-import static android.app.ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST;
import static android.os.Process.NFC_UID;
@@ -168,6 +167,7 @@
public static final int FGS_FEATURE_ALLOWED_BY_SYSTEM_ALERT_WINDOW_PERMISSION = 16;
public static final int FGS_FEATURE_ALLOWED_BY_FGS_BINDING = 17;
public static final int FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE = 18;
+ public static final int FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD = 19;
@IntDef(flag = true, prefix = { "FGS_FEATURE_" }, value = {
FGS_FEATURE_DENIED,
@@ -187,7 +187,8 @@
FGS_FEATURE_ALLOWED_BY_DEVICE_IDLE_ALLOW_LIST,
FGS_FEATURE_ALLOWED_BY_SYSTEM_ALERT_WINDOW_PERMISSION,
FGS_FEATURE_ALLOWED_BY_FGS_BINDING,
- FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE
+ FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE,
+ FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD
})
@Retention(RetentionPolicy.SOURCE)
public @interface FgsFeatureRetCode {}
@@ -1859,7 +1860,7 @@
private final AppOpsManager.OnOpNotedListener mOpNotedCallback =
new AppOpsManager.OnOpNotedListener() {
@Override
- public void onOpNoted(int op, int uid, String pkgName, int result) {
+ public void onOpNoted(int op, int uid, String pkgName, int flags, int result) {
incrementOpCountIfNeeded(op, uid, result);
}
};
@@ -1867,7 +1868,8 @@
private final AppOpsManager.OnOpStartedListener mOpStartedCallback =
new AppOpsManager.OnOpStartedListener() {
@Override
- public void onOpStarted(int op, int uid, String pkgName, int result) {
+ public void onOpStarted(int op, int uid, String pkgName, int flags,
+ int result) {
incrementOpCountIfNeeded(op, uid, result);
}
};
@@ -5243,10 +5245,14 @@
if (ret == FGS_FEATURE_DENIED) {
for (int i = mAm.mProcessList.mLruProcesses.size() - 1; i >= 0; i--) {
final ProcessRecord pr = mAm.mProcessList.mLruProcesses.get(i);
- if (pr.uid == callingUid
- && pr.mAllowStartFgsState <= PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
- ret = FGS_FEATURE_ALLOWED_BY_PROC_STATE;
- break;
+ if (pr.uid == callingUid) {
+ if (pr.mAllowStartFgs) {
+ ret = FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD;
+ break;
+ } else if (pr.isAllowedStartFgsState()) {
+ ret = FGS_FEATURE_ALLOWED_BY_PROC_STATE;
+ break;
+ }
}
}
}
@@ -5285,8 +5291,7 @@
}
if (ret == FGS_FEATURE_DENIED) {
- if (mAm.mConstants.mFlagFgsStartTempAllowListEnabled
- && mAm.isWhitelistedForFgsStartLocked(r.appInfo.uid)) {
+ if (mAm.isWhitelistedForFgsStartLocked(callingUid)) {
// uid is on DeviceIdleController's user/system allowlist
// or AMS's FgsStartTempAllowList.
ret = FGS_FEATURE_ALLOWED_BY_DEVICE_IDLE_ALLOW_LIST;
@@ -5354,6 +5359,8 @@
return "ALLOWED_BY_FGS_BINDING";
case FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE:
return "ALLOWED_BY_DEVICE_DEMO_MODE";
+ case FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD:
+ return "ALLOWED_BY_PROCESS_RECORD";
default:
return "";
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerConstants.java b/services/core/java/com/android/server/am/ActivityManagerConstants.java
index b4e856b..b0f296f 100644
--- a/services/core/java/com/android/server/am/ActivityManagerConstants.java
+++ b/services/core/java/com/android/server/am/ActivityManagerConstants.java
@@ -167,13 +167,6 @@
"default_fgs_starts_restriction_enabled";
/**
- * Default value for mFlagFgsStartTempAllowListEnabled if not explicitly set in
- * Settings.Global.
- */
- private static final String KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED =
- "default_fgs_starts_temp_allowlist_enabled";
-
- /**
* Whether FGS notification display is deferred following the transition into
* the foreground state. Default behavior is {@code true} unless overridden.
*/
@@ -372,10 +365,6 @@
// at all.
volatile boolean mFlagFgsStartRestrictionEnabled = false;
- // When the foreground service background start restriction is enabled, if the app in
- // DeviceIdleController's Temp AllowList is allowed to bypass the restriction.
- volatile boolean mFlagFgsStartTempAllowListEnabled = false;
-
// Whether we defer FGS notifications a few seconds following their transition to
// the foreground state. Applies only to S+ apps; enabled by default.
volatile boolean mFlagFgsNotificationDeferralEnabled = true;
@@ -540,9 +529,6 @@
case KEY_DEFAULT_FGS_STARTS_RESTRICTION_ENABLED:
updateFgsStartsRestriction();
break;
- case KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED:
- updateFgsStartsTempAllowList();
- break;
case KEY_DEFERRED_FGS_NOTIFICATIONS_ENABLED:
updateFgsNotificationDeferralEnable();
break;
@@ -809,13 +795,6 @@
/*defaultValue*/ false);
}
- private void updateFgsStartsTempAllowList() {
- mFlagFgsStartTempAllowListEnabled = DeviceConfig.getBoolean(
- DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
- KEY_DEFAULT_FGS_STARTS_TEMP_ALLOWLIST_ENABLED,
- /*defaultValue*/ false);
- }
-
private void updateFgsNotificationDeferralEnable() {
mFlagFgsNotificationDeferralEnabled = DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 0f9e9ee..10102cd 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -174,6 +174,7 @@
import android.app.WaitResult;
import android.app.backup.BackupManager.OperationType;
import android.app.backup.IBackupManager;
+import android.app.compat.CompatChanges;
import android.app.usage.UsageEvents;
import android.app.usage.UsageEvents.Event;
import android.app.usage.UsageStatsManager;
@@ -13713,6 +13714,37 @@
forceStopPackageLocked(packageName, -1, false, true, true,
false, false, userId, "package unstartable");
break;
+ case Intent.ACTION_CLOSE_SYSTEM_DIALOGS:
+ if (!canCloseSystemDialogs(callingPid, callingUid, callerApp)) {
+ // The app can't close system dialogs, throw only if it targets S+
+ if (CompatChanges.isChangeEnabled(
+ ActivityManager.LOCK_DOWN_CLOSE_SYSTEM_DIALOGS, callingUid)) {
+ throw new SecurityException(
+ "Permission Denial: " + Intent.ACTION_CLOSE_SYSTEM_DIALOGS
+ + " broadcast from " + callerPackage + " (pid="
+ + callingPid + ", uid=" + callingUid + ")"
+ + " requires "
+ + permission.BROADCAST_CLOSE_SYSTEM_DIALOGS + ".");
+ } else if (CompatChanges.isChangeEnabled(
+ ActivityManager.DROP_CLOSE_SYSTEM_DIALOGS, callingUid)) {
+ Slog.w(TAG, "Permission Denial: " + intent.getAction()
+ + " broadcast from " + callerPackage + " (pid=" + callingPid
+ + ", uid=" + callingUid + ")"
+ + " requires "
+ + permission.BROADCAST_CLOSE_SYSTEM_DIALOGS
+ + ", dropping broadcast.");
+ // Returning success seems to be the pattern here
+ return ActivityManager.BROADCAST_SUCCESS;
+ } else {
+ Slog.w(TAG, intent.getAction()
+ + " broadcast from " + callerPackage + " (pid=" + callingPid
+ + ", uid=" + callingUid + ")"
+ + " will require "
+ + permission.BROADCAST_CLOSE_SYSTEM_DIALOGS
+ + " in future builds.");
+ }
+ }
+ break;
}
if (Intent.ACTION_PACKAGE_ADDED.equals(action) ||
@@ -14005,6 +14037,32 @@
return ActivityManager.BROADCAST_SUCCESS;
}
+ private boolean canCloseSystemDialogs(int pid, int uid, @Nullable ProcessRecord callerApp) {
+ if (checkPermission(permission.BROADCAST_CLOSE_SYSTEM_DIALOGS, pid, uid)
+ == PERMISSION_GRANTED) {
+ return true;
+ }
+ if (callerApp == null) {
+ synchronized (mPidsSelfLocked) {
+ callerApp = mPidsSelfLocked.get(pid);
+ }
+ }
+ // Check if the instrumentation of the process has the permission. This covers the usual
+ // test started from the shell (which has the permission) case. This is needed for apps
+ // targeting SDK level < S but we are also allowing for targetSdk S+ as a convenience to
+ // avoid breaking a bunch of existing tests and asking them to adopt shell permissions to do
+ // this.
+ if (callerApp != null) {
+ ActiveInstrumentation instrumentation = callerApp.getActiveInstrumentation();
+ if (instrumentation != null && checkPermission(
+ permission.BROADCAST_CLOSE_SYSTEM_DIALOGS, -1, instrumentation.mSourceUid)
+ == PERMISSION_GRANTED) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* @return uid from the extra field {@link Intent#EXTRA_UID} if present, Otherwise -1
*/
@@ -14610,11 +14668,11 @@
@Override
public int getLaunchedFromUid(IBinder activityToken) {
- return mActivityTaskManager.getLaunchedFromUid(activityToken);
+ return ActivityClient.getInstance().getLaunchedFromUid(activityToken);
}
public String getLaunchedFromPackage(IBinder activityToken) {
- return mActivityTaskManager.getLaunchedFromPackage(activityToken);
+ return ActivityClient.getInstance().getLaunchedFromPackage(activityToken);
}
// =========================================================
@@ -15704,6 +15762,11 @@
return mUserController.getCurrentUser();
}
+ @Override
+ public @UserIdInt int getCurrentUserId() {
+ return mUserController.getCurrentUserIdChecked();
+ }
+
String getStartedUserState(int userId) {
final UserState userState = mUserController.getStartedUserState(userId);
return UserState.stateToString(userState.state);
@@ -16322,7 +16385,7 @@
final ActivityClient ac = ActivityClient.getInstance();
return new ActivityPresentationInfo(ac.getTaskForActivity(token,
/*onlyRoot=*/ false), ac.getDisplayId(token),
- mActivityTaskManager.getActivityClassForToken(token));
+ mAtmInternal.getActivityName(token));
}
@Override
@@ -17225,8 +17288,6 @@
throw new SecurityException("Shell can delegate permissions only "
+ "to one instrumentation at a time");
}
- delegate.setPermissions(permissions);
- return;
}
final int instrCount = mActiveInstrumentation.size();
@@ -17269,7 +17330,8 @@
private class ShellDelegate implements CheckOpsDelegate {
private final int mTargetUid;
- private @Nullable String[] mPermissions;
+ @Nullable
+ private final String[] mPermissions;
ShellDelegate(int targetUid, @Nullable String[] permissions) {
mTargetUid = targetUid;
@@ -17280,11 +17342,6 @@
return mTargetUid;
}
- void setPermissions(@Nullable String[] permissions) {
- mPermissions = permissions;
- PackageManager.invalidatePackageInfoCache();
- }
-
@Override
public int checkOperation(int code, int uid, String packageName, boolean raw,
QuadFunction<Integer, Integer, String, Boolean, Integer> superImpl) {
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
index e3c071f..12fe3ed 100644
--- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
+++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
@@ -118,7 +118,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
-import java.util.Objects;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -1842,9 +1841,11 @@
}
int runGetCurrentUser(PrintWriter pw) throws RemoteException {
- UserInfo currentUser = Objects.requireNonNull(mInterface.getCurrentUser(),
- "Current user not set");
- pw.println(currentUser.id);
+ int userId = mInterface.getCurrentUserId();
+ if (userId == UserHandle.USER_NULL) {
+ throw new IllegalStateException("Current user not set");
+ }
+ pw.println(userId);
return 0;
}
diff --git a/services/core/java/com/android/server/am/AppErrors.java b/services/core/java/com/android/server/am/AppErrors.java
index 0b4d27f..f2c1e90 100644
--- a/services/core/java/com/android/server/am/AppErrors.java
+++ b/services/core/java/com/android/server/am/AppErrors.java
@@ -756,8 +756,9 @@
boolean handleAppCrashLocked(ProcessRecord app, String reason,
String shortMsg, String longMsg, String stackTrace, AppErrorDialog.Data data) {
final long now = SystemClock.uptimeMillis();
- final boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0;
+ final boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ANR_SHOW_BACKGROUND, 0,
+ mService.mUserController.getCurrentUserId()) != 0;
final boolean procIsBoundForeground =
(app.getCurProcState() == ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE);
@@ -889,8 +890,9 @@
void handleShowAppErrorUi(Message msg) {
AppErrorDialog.Data data = (AppErrorDialog.Data) msg.obj;
- boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0;
+ boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ANR_SHOW_BACKGROUND, 0,
+ mService.mUserController.getCurrentUserId()) != 0;
final int userId;
synchronized (mService) {
@@ -982,8 +984,9 @@
return;
}
- boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0;
+ boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ANR_SHOW_BACKGROUND, 0,
+ mService.mUserController.getCurrentUserId()) != 0;
if (mService.mAtmInternal.canShowErrorDialogs() || showBackground) {
proc.getDialogController().showAnrDialogs(data);
} else {
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 3b6f0ac..422ae68 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -261,6 +261,8 @@
mStats.setRadioScanningTimeoutLocked(mContext.getResources().getInteger(
com.android.internal.R.integer.config_radioScanningTimeout) * 1000L);
mStats.setPowerProfileLocked(new PowerProfile(context));
+ mStats.startTrackingSystemServerCpuTime();
+
mBatteryUsageStatsProvider = new BatteryUsageStatsProvider(context, mStats);
}
diff --git a/services/core/java/com/android/server/am/OWNERS b/services/core/java/com/android/server/am/OWNERS
index 60530c4..9e79b02 100644
--- a/services/core/java/com/android/server/am/OWNERS
+++ b/services/core/java/com/android/server/am/OWNERS
@@ -23,6 +23,8 @@
# Battery Stats
joeo@google.com
+per-file BatteryStats* = file:/BATTERY_STATS_OWNERS
+per-file BatteryExternalStats* = file:/BATTERY_STATS_OWNERS
# Londoners
michaelwr@google.com
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 771f273..5b3e651 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -1329,7 +1329,7 @@
app.setCached(false);
app.shouldNotFreeze = false;
- app.mAllowStartFgsState = PROCESS_STATE_NONEXISTENT;
+ app.resetAllowStartFgs();
final int appUid = app.info.uid;
final int logUid = mService.mCurOomAdjUid;
@@ -1351,7 +1351,6 @@
app.setCurrentSchedulingGroup(ProcessList.SCHED_GROUP_DEFAULT);
app.curCapability = PROCESS_CAPABILITY_ALL;
app.setCurProcState(ActivityManager.PROCESS_STATE_PERSISTENT);
- app.bumpAllowStartFgsState(PROCESS_STATE_PERSISTENT);
// System processes can do UI, and when they do we want to have
// them trim their memory after the user leaves the UI. To
// facilitate this, here we need to determine whether or not it
@@ -1382,6 +1381,8 @@
app.setCurRawProcState(app.getCurProcState());
app.curAdj = app.maxAdj;
app.completedAdjSeq = app.adjSeq;
+ app.bumpAllowStartFgsState(app.getCurProcState());
+ app.setAllowStartFgs();
// if curAdj is less than prevAppAdj, then this process was promoted
return app.curAdj < prevAppAdj || app.getCurProcState() < prevProcState;
}
@@ -1773,6 +1774,11 @@
int clientAdj = client.getCurRawAdj();
int clientProcState = client.getCurRawProcState();
+ // pass client's mAllowStartFgs to the app if client is not persistent process.
+ if (client.mAllowStartFgs && client.maxAdj >= ProcessList.FOREGROUND_APP_ADJ) {
+ app.mAllowStartFgs = true;
+ }
+
if ((cr.flags & Context.BIND_WAIVE_PRIORITY) == 0) {
if (shouldSkipDueToCycle(app, client, procState, adj, cycleReEval)) {
continue;
@@ -2236,7 +2242,7 @@
app.setCurRawProcState(procState);
app.setHasForegroundActivities(foregroundActivities);
app.completedAdjSeq = mAdjSeq;
-
+ app.setAllowStartFgs();
// if curAdj or curProcState improved, then this process was promoted
return app.curAdj < prevAppAdj || app.getCurProcState() < prevProcState
|| app.curCapability != prevCapability ;
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index cf4adc6..255badd 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -16,7 +16,16 @@
package com.android.server.am;
+import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND;
+import static android.Manifest.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND;
+import static android.Manifest.permission.SYSTEM_ALERT_WINDOW;
+import static android.app.ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE;
import static android.app.ActivityManager.PROCESS_STATE_NONEXISTENT;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.os.Process.NFC_UID;
+import static android.os.Process.ROOT_UID;
+import static android.os.Process.SHELL_UID;
+import static android.os.Process.SYSTEM_UID;
import static com.android.server.Watchdog.NATIVE_STACKS_OF_INTEREST;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ANR;
@@ -361,6 +370,17 @@
private final ArraySet<Binder> mBackgroundFgsStartTokens = new ArraySet<>();
+ // The list of permissions that can start FGS from background.
+ private static String[] ALLOW_BG_START_FGS_PERMISSIONS =
+ {START_ACTIVITIES_FROM_BACKGROUND, START_FOREGROUND_SERVICES_FROM_BACKGROUND,
+ SYSTEM_ALERT_WINDOW};
+ // Does the process has permission to start FGS from background.
+ boolean mAllowStartFgsByPermission;
+ // Can this process start FGS from background?
+ // If this process has the ability to start FGS from background, this ability can be passed to
+ // another process through service binding.
+ boolean mAllowStartFgs;
+
void setStartParams(int startUid, HostingRecord hostingRecord, String seInfo,
long startTime) {
this.startUid = startUid;
@@ -476,6 +496,9 @@
pw.println();
pw.print(prefix); pw.print("allowStartFgsState=");
pw.println(mAllowStartFgsState);
+ if (mAllowStartFgs) {
+ pw.print(prefix); pw.print("allowStartFgs="); pw.println(mAllowStartFgs);
+ }
if (hasShownUi || mPendingUiClean || hasAboveClient || treatLikeActivity) {
pw.print(prefix); pw.print("hasShownUi="); pw.print(hasShownUi);
pw.print(" pendingUiClean="); pw.print(mPendingUiClean);
@@ -672,6 +695,7 @@
mWindowProcessController = new WindowProcessController(
mService.mActivityTaskManager, info, processName, uid, userId, this, this);
pkgList.put(_info.packageName, new ProcessStats.ProcessStateHolder(_info.longVersionCode));
+ setAllowStartFgsByPermission();
}
public void setPid(int _pid) {
@@ -1983,12 +2007,78 @@
return mDialogController;
}
+ void resetAllowStartFgs() {
+ mAllowStartFgsState = PROCESS_STATE_NONEXISTENT;
+ mAllowStartFgs = mAllowStartFgsByPermission;
+ }
+
void bumpAllowStartFgsState(int newProcState) {
if (newProcState < mAllowStartFgsState) {
mAllowStartFgsState = newProcState;
}
}
+ void setAllowStartFgsByPermission() {
+ boolean ret = false;
+ if (!ret) {
+ boolean isSystem = false;
+ final int uid = UserHandle.getAppId(info.uid);
+ switch (uid) {
+ case ROOT_UID:
+ case SYSTEM_UID:
+ case NFC_UID:
+ case SHELL_UID:
+ isSystem = true;
+ break;
+ default:
+ isSystem = false;
+ break;
+ }
+
+ if (isSystem) {
+ ret = true;
+ }
+ }
+
+ if (!ret) {
+ for (int i = 0; i < ALLOW_BG_START_FGS_PERMISSIONS.length; ++i) {
+ if (ActivityManager.checkComponentPermission(ALLOW_BG_START_FGS_PERMISSIONS[i],
+ info.uid, -1, true)
+ == PERMISSION_GRANTED) {
+ ret = true;
+ break;
+ }
+ }
+ }
+ mAllowStartFgs = mAllowStartFgsByPermission = ret;
+ }
+
+ boolean isAllowedStartFgsState() {
+ return mAllowStartFgsState <= PROCESS_STATE_BOUND_FOREGROUND_SERVICE;
+ }
+
+ void setAllowStartFgs() {
+ if (mAllowStartFgs) {
+ return;
+ }
+ if (!mAllowStartFgs) {
+ mAllowStartFgs = isAllowedStartFgsState();
+ }
+
+ if (!mAllowStartFgs) {
+ // Is the calling UID a device owner app?
+ if (mService.mInternal != null) {
+ mAllowStartFgs = mService.mInternal.isDeviceOwner(info.uid);
+ }
+ }
+
+ if (!mAllowStartFgs) {
+ // uid is on DeviceIdleController's user/system allowlist
+ // or AMS's FgsStartTempAllowList.
+ mAllowStartFgs = mService.isWhitelistedForFgsStartLocked(info.uid);
+ }
+ }
+
/** A controller to generate error dialogs in {@link ProcessRecord} */
class ErrorDialogController {
/** dialogs being displayed due to crash */
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index 12fcc9c..c04f6ff 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -2173,7 +2173,7 @@
}
}
- UserInfo getCurrentUser() {
+ private void checkGetCurrentUserPermissions() {
if ((mInjector.checkCallingPermission(INTERACT_ACROSS_USERS)
!= PackageManager.PERMISSION_GRANTED) && (
mInjector.checkCallingPermission(INTERACT_ACROSS_USERS_FULL)
@@ -2185,8 +2185,12 @@
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
+ }
- // Optimization - if there is no pending user switch, return current id
+ UserInfo getCurrentUser() {
+ checkGetCurrentUserPermissions();
+
+ // Optimization - if there is no pending user switch, return user for current id
// (no need to acquire lock because mTargetUserId and mCurrentUserId are volatile)
if (mTargetUserId == UserHandle.USER_NULL) {
return getUserInfo(mCurrentUserId);
@@ -2196,9 +2200,23 @@
}
}
+ /**
+ * Gets the current user id, but checking that caller has the proper permissions.
+ */
+ int getCurrentUserIdChecked() {
+ checkGetCurrentUserPermissions();
+
+ // Optimization - if there is no pending user switch, return current id
+ // (no need to acquire lock because mTargetUserId and mCurrentUserId are volatile)
+ if (mTargetUserId == UserHandle.USER_NULL) {
+ return mCurrentUserId;
+ }
+ return getCurrentOrTargetUserId();
+ }
+
@GuardedBy("mLock")
UserInfo getCurrentUserLU() {
- int userId = mTargetUserId != UserHandle.USER_NULL ? mTargetUserId : mCurrentUserId;
+ int userId = getCurrentOrTargetUserIdLU();
return getUserInfo(userId);
}
@@ -2213,7 +2231,6 @@
return mTargetUserId != UserHandle.USER_NULL ? mTargetUserId : mCurrentUserId;
}
-
@GuardedBy("mLock")
int getCurrentUserIdLU() {
return mCurrentUserId;
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index d4e2d27..4da7825 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -3090,7 +3090,7 @@
final Ops ops = getOpsLocked(uid, packageName, attributionTag, bypass,
true /* edit */);
if (ops == null) {
- scheduleOpNotedIfNeededLocked(code, uid, packageName,
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags,
AppOpsManager.MODE_IGNORED);
if (DEBUG) Slog.d(TAG, "noteOperation: no op for code " + code + " uid " + uid
+ " package " + packageName);
@@ -3098,7 +3098,7 @@
}
final Op op = getOpLocked(ops, code, uid, true);
if (isOpRestrictedLocked(uid, code, packageName, bypass)) {
- scheduleOpNotedIfNeededLocked(code, uid, packageName,
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags,
AppOpsManager.MODE_IGNORED);
return AppOpsManager.MODE_IGNORED;
}
@@ -3120,7 +3120,7 @@
+ switchCode + " (" + code + ") uid " + uid + " package "
+ packageName);
attributedOp.rejected(uidState.state, flags);
- scheduleOpNotedIfNeededLocked(code, uid, packageName, uidMode);
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags, uidMode);
return uidMode;
}
} else {
@@ -3132,7 +3132,7 @@
+ switchCode + " (" + code + ") uid " + uid + " package "
+ packageName);
attributedOp.rejected(uidState.state, flags);
- scheduleOpNotedIfNeededLocked(code, uid, packageName, mode);
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags, mode);
return mode;
}
}
@@ -3142,7 +3142,8 @@
+ packageName + (attributionTag == null ? ""
: "." + attributionTag));
}
- scheduleOpNotedIfNeededLocked(code, uid, packageName, AppOpsManager.MODE_ALLOWED);
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags,
+ AppOpsManager.MODE_ALLOWED);
attributedOp.accessed(proxyUid, proxyPackageName, proxyAttributionTag, uidState.state,
flags);
@@ -3545,7 +3546,7 @@
if (ops == null) {
if (!dryRun) {
scheduleOpStartedIfNeededLocked(code, uid, packageName,
- AppOpsManager.MODE_IGNORED);
+ flags, AppOpsManager.MODE_IGNORED);
}
if (DEBUG) Slog.d(TAG, "startOperation: no op for code " + code + " uid " + uid
+ " package " + packageName);
@@ -3555,7 +3556,7 @@
if (isOpRestrictedLocked(uid, code, packageName, bypass)) {
if (!dryRun) {
scheduleOpStartedIfNeededLocked(code, uid, packageName,
- AppOpsManager.MODE_IGNORED);
+ flags, AppOpsManager.MODE_IGNORED);
}
return AppOpsManager.MODE_IGNORED;
}
@@ -3575,7 +3576,7 @@
}
if (!dryRun) {
attributedOp.rejected(uidState.state, flags);
- scheduleOpStartedIfNeededLocked(code, uid, packageName, uidMode);
+ scheduleOpStartedIfNeededLocked(code, uid, packageName, flags, uidMode);
}
return uidMode;
}
@@ -3590,7 +3591,7 @@
+ packageName);
if (!dryRun) {
attributedOp.rejected(uidState.state, flags);
- scheduleOpStartedIfNeededLocked(code, uid, packageName, mode);
+ scheduleOpStartedIfNeededLocked(code, uid, packageName, flags, mode);
}
return mode;
}
@@ -3598,7 +3599,8 @@
if (DEBUG) Slog.d(TAG, "startOperation: allowing code " + code + " uid " + uid
+ " package " + packageName);
if (!dryRun) {
- scheduleOpStartedIfNeededLocked(code, uid, packageName, AppOpsManager.MODE_ALLOWED);
+ scheduleOpStartedIfNeededLocked(code, uid, packageName, flags,
+ AppOpsManager.MODE_ALLOWED);
try {
attributedOp.started(clientId, proxyUid, proxyPackageName, proxyAttributionTag,
uidState.state, flags);
@@ -3736,7 +3738,8 @@
}
}
- private void scheduleOpStartedIfNeededLocked(int code, int uid, String pkgName, int result) {
+ private void scheduleOpStartedIfNeededLocked(int code, int uid, String pkgName,
+ @OpFlags int flags, @Mode int result) {
ArraySet<StartedCallback> dispatchedCallbacks = null;
final int callbackListCount = mStartedWatchers.size();
for (int i = 0; i < callbackListCount; i++) {
@@ -3761,18 +3764,18 @@
mHandler.sendMessage(PooledLambda.obtainMessage(
AppOpsService::notifyOpStarted,
- this, dispatchedCallbacks, code, uid, pkgName, result));
+ this, dispatchedCallbacks, code, uid, pkgName, flags, result));
}
private void notifyOpStarted(ArraySet<StartedCallback> callbacks,
- int code, int uid, String packageName, int result) {
+ int code, int uid, String packageName, @OpFlags int flags, @Mode int result) {
final long identity = Binder.clearCallingIdentity();
try {
final int callbackCount = callbacks.size();
for (int i = 0; i < callbackCount; i++) {
final StartedCallback callback = callbacks.valueAt(i);
try {
- callback.mCallback.opStarted(code, uid, packageName, result);
+ callback.mCallback.opStarted(code, uid, packageName, flags, result);
} catch (RemoteException e) {
/* do nothing */
}
@@ -3783,7 +3786,7 @@
}
private void scheduleOpNotedIfNeededLocked(int code, int uid, String packageName,
- int result) {
+ @OpFlags int flags, @Mode int result) {
ArraySet<NotedCallback> dispatchedCallbacks = null;
final int callbackListCount = mNotedWatchers.size();
for (int i = 0; i < callbackListCount; i++) {
@@ -3804,11 +3807,11 @@
}
mHandler.sendMessage(PooledLambda.obtainMessage(
AppOpsService::notifyOpChecked,
- this, dispatchedCallbacks, code, uid, packageName, result));
+ this, dispatchedCallbacks, code, uid, packageName, flags, result));
}
private void notifyOpChecked(ArraySet<NotedCallback> callbacks,
- int code, int uid, String packageName, int result) {
+ int code, int uid, String packageName, @OpFlags int flags, @Mode int result) {
// There are features watching for checks in our process. The callbacks in
// these features may require permissions our remote caller does not have.
final long identity = Binder.clearCallingIdentity();
@@ -3817,7 +3820,7 @@
for (int i = 0; i < callbackCount; i++) {
final NotedCallback callback = callbacks.valueAt(i);
try {
- callback.mCallback.opNoted(code, uid, packageName, result);
+ callback.mCallback.opNoted(code, uid, packageName, flags, result);
} catch (RemoteException e) {
/* do nothing */
}
diff --git a/services/core/java/com/android/server/appop/OWNERS b/services/core/java/com/android/server/appop/OWNERS
new file mode 100644
index 0000000..999ea0e
--- /dev/null
+++ b/services/core/java/com/android/server/appop/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/permission/OWNERS
diff --git a/services/core/java/com/android/server/attention/OWNERS b/services/core/java/com/android/server/attention/OWNERS
new file mode 100644
index 0000000..51fc9bd
--- /dev/null
+++ b/services/core/java/com/android/server/attention/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/attention/OWNERS
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index af00731..6bc927a 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -2108,6 +2108,12 @@
return getDevicesForAttributesInt(attributes);
}
+ /** @see AudioManager#isMusicActive() */
+ public boolean isMusicActive() {
+ // no permission required
+ return AudioSystem.isStreamActive(AudioSystem.STREAM_MUSIC, 0);
+ }
+
protected @NonNull ArrayList<AudioDeviceAttributes> getDevicesForAttributesInt(
@NonNull AudioAttributes attributes) {
Objects.requireNonNull(attributes);
diff --git a/services/core/java/com/android/server/audio/TEST_MAPPING b/services/core/java/com/android/server/audio/TEST_MAPPING
index 0d34c53..90246f8 100644
--- a/services/core/java/com/android/server/audio/TEST_MAPPING
+++ b/services/core/java/com/android/server/audio/TEST_MAPPING
@@ -1,5 +1,5 @@
{
- "presubmit": [
+ "presubmit-large": [
{
"name": "CtsMediaTestCases",
"options": [
diff --git a/services/core/java/com/android/server/backup/OWNERS b/services/core/java/com/android/server/backup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/services/core/java/com/android/server/backup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/services/core/java/com/android/server/camera/OWNERS b/services/core/java/com/android/server/camera/OWNERS
new file mode 100644
index 0000000..f48a95c
--- /dev/null
+++ b/services/core/java/com/android/server/camera/OWNERS
@@ -0,0 +1 @@
+include platform/frameworks/av:/camera/OWNERS
diff --git a/services/core/java/com/android/server/connectivity/DefaultNetworkMetrics.java b/services/core/java/com/android/server/connectivity/DefaultNetworkMetrics.java
index 4fb6607..995bb24 100644
--- a/services/core/java/com/android/server/connectivity/DefaultNetworkMetrics.java
+++ b/services/core/java/com/android/server/connectivity/DefaultNetworkMetrics.java
@@ -166,7 +166,7 @@
private static void fillLinkInfo(DefaultNetworkEvent ev, NetworkAgentInfo nai) {
LinkProperties lp = nai.linkProperties;
- ev.netId = nai.network().netId;
+ ev.netId = nai.network().getNetId();
ev.transports |= BitUtils.packBits(nai.networkCapabilities.getTransportTypes());
ev.ipv4 |= lp.hasIpv4Address() && lp.hasIpv4DefaultRoute();
ev.ipv6 |= lp.hasGlobalIpv6Address() && lp.hasIpv6DefaultRoute();
diff --git a/services/core/java/com/android/server/connectivity/DnsManager.java b/services/core/java/com/android/server/connectivity/DnsManager.java
index 1f0fb5e..c70bb08 100644
--- a/services/core/java/com/android/server/connectivity/DnsManager.java
+++ b/services/core/java/com/android/server/connectivity/DnsManager.java
@@ -34,7 +34,6 @@
import android.net.IDnsResolver;
import android.net.LinkProperties;
import android.net.Network;
-import android.net.NetworkUtils;
import android.net.ResolverOptionsParcel;
import android.net.ResolverParamsParcel;
import android.net.Uri;
@@ -50,6 +49,7 @@
import java.net.InetAddress;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -59,7 +59,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
-
/**
* Encapsulate the management of DNS settings for networks.
*
@@ -266,23 +265,23 @@
}
public void removeNetwork(Network network) {
- mPrivateDnsMap.remove(network.netId);
- mPrivateDnsValidationMap.remove(network.netId);
- mTransportsMap.remove(network.netId);
- mLinkPropertiesMap.remove(network.netId);
+ mPrivateDnsMap.remove(network.getNetId());
+ mPrivateDnsValidationMap.remove(network.getNetId());
+ mTransportsMap.remove(network.getNetId());
+ mLinkPropertiesMap.remove(network.getNetId());
}
// This is exclusively called by ConnectivityService#dumpNetworkDiagnostics() which
// is not on the ConnectivityService handler thread.
public PrivateDnsConfig getPrivateDnsConfig(@NonNull Network network) {
- return mPrivateDnsMap.getOrDefault(network.netId, PRIVATE_DNS_OFF);
+ return mPrivateDnsMap.getOrDefault(network.getNetId(), PRIVATE_DNS_OFF);
}
public PrivateDnsConfig updatePrivateDns(Network network, PrivateDnsConfig cfg) {
Log.w(TAG, "updatePrivateDns(" + network + ", " + cfg + ")");
return (cfg != null)
- ? mPrivateDnsMap.put(network.netId, cfg)
- : mPrivateDnsMap.remove(network.netId);
+ ? mPrivateDnsMap.put(network.getNetId(), cfg)
+ : mPrivateDnsMap.remove(network.getNetId());
}
public void updatePrivateDnsStatus(int netId, LinkProperties lp) {
@@ -309,8 +308,7 @@
}
public void updatePrivateDnsValidation(PrivateDnsValidationUpdate update) {
- final PrivateDnsValidationStatuses statuses =
- mPrivateDnsValidationMap.get(update.netId);
+ final PrivateDnsValidationStatuses statuses = mPrivateDnsValidationMap.get(update.netId);
if (statuses == null) return;
statuses.updateStatus(update);
}
@@ -364,12 +362,11 @@
paramsParcel.successThreshold = mSuccessThreshold;
paramsParcel.minSamples = mMinSamples;
paramsParcel.maxSamples = mMaxSamples;
- paramsParcel.servers =
- NetworkUtils.makeStrings(lp.getDnsServers());
+ paramsParcel.servers = makeStrings(lp.getDnsServers());
paramsParcel.domains = getDomainStrings(lp.getDomains());
paramsParcel.tlsName = strictMode ? privateDnsCfg.hostname : "";
paramsParcel.tlsServers =
- strictMode ? NetworkUtils.makeStrings(
+ strictMode ? makeStrings(
Arrays.stream(privateDnsCfg.ips)
.filter((ip) -> lp.isReachable(ip))
.collect(Collectors.toList()))
@@ -460,6 +457,21 @@
return Settings.Global.getInt(mContentResolver, which, dflt);
}
+ /**
+ * Create a string array of host addresses from a collection of InetAddresses
+ *
+ * @param addrs a Collection of InetAddresses
+ * @return an array of Strings containing their host addresses
+ */
+ private String[] makeStrings(Collection<InetAddress> addrs) {
+ String[] result = new String[addrs.size()];
+ int i = 0;
+ for (InetAddress addr : addrs) {
+ result[i++] = addr.getHostAddress();
+ }
+ return result;
+ }
+
private static String getPrivateDnsMode(ContentResolver cr) {
String mode = getStringSetting(cr, PRIVATE_DNS_MODE);
if (TextUtils.isEmpty(mode)) mode = getStringSetting(cr, PRIVATE_DNS_DEFAULT_MODE);
diff --git a/services/core/java/com/android/server/connectivity/KeepaliveTracker.java b/services/core/java/com/android/server/connectivity/KeepaliveTracker.java
index 8625a6f..96cbfde 100644
--- a/services/core/java/com/android/server/connectivity/KeepaliveTracker.java
+++ b/services/core/java/com/android/server/connectivity/KeepaliveTracker.java
@@ -40,11 +40,11 @@
import android.annotation.Nullable;
import android.content.Context;
import android.net.ISocketKeepaliveCallback;
+import android.net.InetAddresses;
import android.net.InvalidPacketException;
import android.net.KeepalivePacketData;
import android.net.NattKeepalivePacketData;
import android.net.NetworkAgent;
-import android.net.NetworkUtils;
import android.net.SocketKeepalive.InvalidSocketException;
import android.net.TcpKeepalivePacketData;
import android.net.util.KeepaliveUtils;
@@ -625,8 +625,8 @@
InetAddress srcAddress, dstAddress;
try {
- srcAddress = NetworkUtils.numericToInetAddress(srcAddrString);
- dstAddress = NetworkUtils.numericToInetAddress(dstAddrString);
+ srcAddress = InetAddresses.parseNumericAddress(srcAddrString);
+ dstAddress = InetAddresses.parseNumericAddress(dstAddrString);
} catch (IllegalArgumentException e) {
notifyErrorCallback(cb, ERROR_INVALID_IP_ADDRESS);
return;
diff --git a/services/core/java/com/android/server/connectivity/LingerMonitor.java b/services/core/java/com/android/server/connectivity/LingerMonitor.java
index f99f4c6..adec7ad 100644
--- a/services/core/java/com/android/server/connectivity/LingerMonitor.java
+++ b/services/core/java/com/android/server/connectivity/LingerMonitor.java
@@ -114,7 +114,7 @@
private int getNotificationSource(NetworkAgentInfo toNai) {
for (int i = 0; i < mNotifications.size(); i++) {
- if (mNotifications.valueAt(i) == toNai.network.netId) {
+ if (mNotifications.valueAt(i) == toNai.network.getNetId()) {
return mNotifications.keyAt(i);
}
}
@@ -122,7 +122,7 @@
}
private boolean everNotified(NetworkAgentInfo nai) {
- return mEverNotified.get(nai.network.netId, false);
+ return mEverNotified.get(nai.network.getNetId(), false);
}
@VisibleForTesting
@@ -153,7 +153,7 @@
}
private void showNotification(NetworkAgentInfo fromNai, NetworkAgentInfo toNai) {
- mNotifier.showNotification(fromNai.network.netId, NotificationType.NETWORK_SWITCH,
+ mNotifier.showNotification(fromNai.network.getNetId(), NotificationType.NETWORK_SWITCH,
fromNai, toNai, createNotificationIntent(), true);
}
@@ -208,8 +208,8 @@
+ " type=" + sNotifyTypeNames.get(notifyType, "unknown(" + notifyType + ")"));
}
- mNotifications.put(fromNai.network.netId, toNai.network.netId);
- mEverNotified.put(fromNai.network.netId, true);
+ mNotifications.put(fromNai.network.getNetId(), toNai.network.getNetId());
+ mEverNotified.put(fromNai.network.getNetId(), true);
}
/**
@@ -295,8 +295,8 @@
}
public void noteDisconnect(NetworkAgentInfo nai) {
- mNotifications.delete(nai.network.netId);
- mEverNotified.delete(nai.network.netId);
+ mNotifications.delete(nai.network.getNetId());
+ mEverNotified.delete(nai.network.getNetId());
maybeStopNotifying(nai);
// No need to cancel notifications on nai: NetworkMonitor does that on disconnect.
}
diff --git a/services/core/java/com/android/server/connectivity/Nat464Xlat.java b/services/core/java/com/android/server/connectivity/Nat464Xlat.java
index d9c2e80..c1b1b6a 100644
--- a/services/core/java/com/android/server/connectivity/Nat464Xlat.java
+++ b/services/core/java/com/android/server/connectivity/Nat464Xlat.java
@@ -528,6 +528,6 @@
@VisibleForTesting
protected int getNetId() {
- return mNetwork.network.netId;
+ return mNetwork.network.getNetId();
}
}
diff --git a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
index 3270dd5..52b9f5c 100644
--- a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
+++ b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
@@ -138,9 +138,10 @@
// not guaranteed to be current or correct, or even to exist.
public @Nullable Network[] declaredUnderlyingNetworks;
- // Whether this network is always metered even if its underlying networks are unmetered.
- // Only relevant if #supportsUnderlyingNetworks is true.
- public boolean declaredMetered;
+ // The capabilities originally announced by the NetworkAgent, regardless of any capabilities
+ // that were added or removed due to this network's underlying networks.
+ // Only set if #supportsUnderlyingNetworks is true.
+ public @Nullable NetworkCapabilities declaredCapabilities;
// Indicates if netd has been told to create this Network. From this point on the appropriate
// routing rules are setup and routes are added so packets can begin flowing over the Network.
@@ -610,7 +611,7 @@
if (newExpiry > 0) {
mLingerMessage = new WakeupMessage(
mContext, mHandler,
- "NETWORK_LINGER_COMPLETE." + network.netId /* cmdName */,
+ "NETWORK_LINGER_COMPLETE." + network.getNetId() /* cmdName */,
EVENT_NETWORK_LINGER_COMPLETE /* cmd */,
0 /* arg1 (unused) */, 0 /* arg2 (unused) */,
this /* obj (NetworkAgentInfo) */);
@@ -701,7 +702,7 @@
* This represents the network with something like "[100 WIFI|VPN]" or "[108 MOBILE]".
*/
public String toShortString() {
- return "[" + network.netId + " "
+ return "[" + network.getNetId() + " "
+ transportNamesOf(networkCapabilities.getTransportTypes()) + "]";
}
diff --git a/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java b/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
index 49c16ad..a7be657 100644
--- a/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
+++ b/services/core/java/com/android/server/connectivity/NetworkDiagnostics.java
@@ -20,10 +20,10 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.net.InetAddresses;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.net.Network;
-import android.net.NetworkUtils;
import android.net.RouteInfo;
import android.net.TrafficStats;
import android.net.shared.PrivateDnsConfig;
@@ -97,8 +97,8 @@
public class NetworkDiagnostics {
private static final String TAG = "NetworkDiagnostics";
- private static final InetAddress TEST_DNS4 = NetworkUtils.numericToInetAddress("8.8.8.8");
- private static final InetAddress TEST_DNS6 = NetworkUtils.numericToInetAddress(
+ private static final InetAddress TEST_DNS4 = InetAddresses.parseNumericAddress("8.8.8.8");
+ private static final InetAddress TEST_DNS6 = InetAddresses.parseNumericAddress(
"2001:4860:4860::8888");
// For brevity elsewhere.
diff --git a/services/core/java/com/android/server/connectivity/PermissionMonitor.java b/services/core/java/com/android/server/connectivity/PermissionMonitor.java
index 4c63eb4..d507b5f 100644
--- a/services/core/java/com/android/server/connectivity/PermissionMonitor.java
+++ b/services/core/java/com/android/server/connectivity/PermissionMonitor.java
@@ -35,7 +35,6 @@
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PackageManagerInternal;
-import android.content.pm.UserInfo;
import android.net.INetd;
import android.net.UidRange;
import android.os.Build;
@@ -174,11 +173,9 @@
netdPermsUids.put(uid, netdPermsUids.get(uid) | otherNetdPerms);
}
- List<UserInfo> users = mUserManager.getAliveUsers();
- if (users != null) {
- for (UserInfo user : users) {
- mUsers.add(user.id);
- }
+ final List<UserHandle> users = mUserManager.getUserHandles(true /* excludeDying */);
+ for (UserHandle user : users) {
+ mUsers.add(user.getIdentifier());
}
final SparseArray<ArraySet<String>> systemPermission =
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index 3445275..cabfbc0 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -48,6 +48,7 @@
import android.content.pm.UserInfo;
import android.net.ConnectivityManager;
import android.net.DnsResolver;
+import android.net.INetd;
import android.net.INetworkManagementEventObserver;
import android.net.Ikev2VpnProfile;
import android.net.IpPrefix;
@@ -68,6 +69,7 @@
import android.net.NetworkRequest;
import android.net.RouteInfo;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.VpnManager;
import android.net.VpnService;
import android.net.ipsec.ike.ChildSessionCallback;
@@ -188,7 +190,8 @@
private PendingIntent mStatusIntent;
private volatile boolean mEnableTeardown = true;
- private final INetworkManagementService mNetd;
+ private final INetworkManagementService mNms;
+ private final INetd mNetd;
@VisibleForTesting
protected VpnConfig mConfig;
private final NetworkProvider mNetworkProvider;
@@ -234,7 +237,7 @@
* @see mLockdown
*/
@GuardedBy("this")
- private final Set<UidRange> mBlockedUidsAsToldToNetd = new ArraySet<>();
+ private final Set<UidRangeParcel> mBlockedUidsAsToldToNetd = new ArraySet<>();
// The user id of initiating VPN.
private final int mUserId;
@@ -363,22 +366,23 @@
}
}
- public Vpn(Looper looper, Context context, INetworkManagementService netService,
+ public Vpn(Looper looper, Context context, INetworkManagementService netService, INetd netd,
@UserIdInt int userId, @NonNull KeyStore keyStore) {
- this(looper, context, new Dependencies(), netService, userId, keyStore,
+ this(looper, context, new Dependencies(), netService, netd, userId, keyStore,
new SystemServices(context), new Ikev2SessionCreator());
}
@VisibleForTesting
protected Vpn(Looper looper, Context context, Dependencies deps,
- INetworkManagementService netService,
+ INetworkManagementService netService, INetd netd,
int userId, @NonNull KeyStore keyStore, SystemServices systemServices,
Ikev2SessionCreator ikev2SessionCreator) {
mContext = context;
mConnectivityManager = mContext.getSystemService(ConnectivityManager.class);
mUserIdContext = context.createContextAsUser(UserHandle.of(userId), 0 /* flags */);
mDeps = deps;
- mNetd = netService;
+ mNms = netService;
+ mNetd = netd;
mUserId = userId;
mLooper = looper;
mSystemServices = systemServices;
@@ -912,7 +916,7 @@
}
try {
- mNetd.denyProtect(mOwnerUID);
+ mNms.denyProtect(mOwnerUID);
} catch (Exception e) {
Log.wtf(TAG, "Failed to disallow UID " + mOwnerUID + " to call protect() " + e);
}
@@ -922,7 +926,7 @@
mOwnerUID = getAppUid(newPackage, mUserId);
mIsPackageTargetingAtLeastQ = doesPackageTargetAtLeastQ(newPackage);
try {
- mNetd.allowProtect(mOwnerUID);
+ mNms.allowProtect(mOwnerUID);
} catch (Exception e) {
Log.wtf(TAG, "Failed to allow UID " + mOwnerUID + " to call protect() " + e);
}
@@ -1062,7 +1066,7 @@
if (null == agent) return NETID_UNSET;
final Network network = agent.getNetwork();
if (null == network) return NETID_UNSET;
- return network.netId;
+ return network.getNetId();
}
private LinkProperties makeLinkProperties() {
@@ -1253,7 +1257,7 @@
final PackageManager packageManager = mUserIdContext.getPackageManager();
if (packageManager == null) {
- throw new UnsupportedOperationException("Cannot get PackageManager.");
+ throw new IllegalStateException("Cannot get PackageManager.");
}
final ResolveInfo info = packageManager.resolveService(intent, 0 /* flags */);
if (info == null) {
@@ -1579,24 +1583,25 @@
exemptedPackages = new ArrayList<>(mLockdownAllowlist);
exemptedPackages.add(mPackage);
}
- final Set<UidRange> rangesToTellNetdToRemove = new ArraySet<>(mBlockedUidsAsToldToNetd);
+ final Set<UidRangeParcel> rangesToTellNetdToRemove =
+ new ArraySet<>(mBlockedUidsAsToldToNetd);
- final Set<UidRange> rangesToTellNetdToAdd;
+ final Set<UidRangeParcel> rangesToTellNetdToAdd;
if (enforce) {
- final Set<UidRange> rangesThatShouldBeBlocked =
+ final Set<UidRange> restrictedProfilesRanges =
createUserAndRestrictedProfilesRanges(mUserId,
- /* allowedApplications */ null,
- /* disallowedApplications */ exemptedPackages);
+ /* allowedApplications */ null,
+ /* disallowedApplications */ exemptedPackages);
+ final Set<UidRangeParcel> rangesThatShouldBeBlocked = new ArraySet<>();
// The UID range of the first user (0-99999) would block the IPSec traffic, which comes
// directly from the kernel and is marked as uid=0. So we adjust the range to allow
// it through (b/69873852).
- for (UidRange range : rangesThatShouldBeBlocked) {
- if (range.start == 0) {
- rangesThatShouldBeBlocked.remove(range);
- if (range.stop != 0) {
- rangesThatShouldBeBlocked.add(new UidRange(1, range.stop));
- }
+ for (UidRange range : restrictedProfilesRanges) {
+ if (range.start == 0 && range.stop != 0) {
+ rangesThatShouldBeBlocked.add(new UidRangeParcel(1, range.stop));
+ } else if (range.start != 0) {
+ rangesThatShouldBeBlocked.add(new UidRangeParcel(range.start, range.stop));
}
}
@@ -1628,13 +1633,13 @@
* including added ranges that already existed or removed ones that didn't.
*/
@GuardedBy("this")
- private boolean setAllowOnlyVpnForUids(boolean enforce, Collection<UidRange> ranges) {
+ private boolean setAllowOnlyVpnForUids(boolean enforce, Collection<UidRangeParcel> ranges) {
if (ranges.size() == 0) {
return true;
}
- final UidRange[] rangesArray = ranges.toArray(new UidRange[ranges.size()]);
+ final UidRangeParcel[] stableRanges = ranges.toArray(new UidRangeParcel[ranges.size()]);
try {
- mNetd.setAllowOnlyVpnForUids(enforce, rangesArray);
+ mNetd.networkRejectNonSecureVpn(enforce, stableRanges);
} catch (RemoteException | RuntimeException e) {
Log.e(TAG, "Updating blocked=" + enforce
+ " for UIDs " + Arrays.toString(ranges.toArray()) + " failed", e);
@@ -1778,7 +1783,7 @@
if (networks[i] == null) {
mConfig.underlyingNetworks[i] = null;
} else {
- mConfig.underlyingNetworks[i] = new Network(networks[i].netId);
+ mConfig.underlyingNetworks[i] = new Network(networks[i].getNetId());
}
}
}
@@ -1849,10 +1854,20 @@
if (mNetworkInfo.isConnected()) {
return !appliesToUid(uid);
} else {
- return UidRange.containsUid(mBlockedUidsAsToldToNetd, uid);
+ return containsUid(mBlockedUidsAsToldToNetd, uid);
}
}
+ private boolean containsUid(Collection<UidRangeParcel> ranges, int uid) {
+ if (ranges == null) return false;
+ for (UidRangeParcel range : ranges) {
+ if (range.start <= uid && uid <= range.stop) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private void updateAlwaysOnNotification(DetailedState networkState) {
final boolean visible = (mAlwaysOn && networkState != DetailedState.CONNECTED);
@@ -2495,7 +2510,7 @@
address /* unused */,
address /* unused */,
network);
- mNetd.setInterfaceUp(mTunnelIface.getInterfaceName());
+ mNms.setInterfaceUp(mTunnelIface.getInterfaceName());
mSession = mIkev2SessionCreator.createIkeSession(
mContext,
diff --git a/services/core/java/com/android/server/contentcapture/OWNERS b/services/core/java/com/android/server/contentcapture/OWNERS
new file mode 100644
index 0000000..a28e00a
--- /dev/null
+++ b/services/core/java/com/android/server/contentcapture/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/contentcapture/OWNERS
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index d4a19d6..2c7cd5b 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -403,7 +403,7 @@
mUiHandler = UiThread.getHandler();
mDisplayDeviceRepo = new DisplayDeviceRepository(mSyncRoot, mPersistentDataStore);
mLogicalDisplayMapper = new LogicalDisplayMapper(context, mDisplayDeviceRepo,
- new LogicalDisplayListener(), mPersistentDataStore);
+ new LogicalDisplayListener());
mDisplayModeDirector = new DisplayModeDirector(context, mHandler);
Resources resources = mContext.getResources();
mDefaultDisplayDefaultColorMode = mContext.getResources().getInteger(
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 74ea2d7..155b246 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -177,10 +177,10 @@
private final class LocalDisplayDevice extends DisplayDevice {
private final long mPhysicalDisplayId;
- private final LogicalLight mBacklight;
private final SparseArray<DisplayModeRecord> mSupportedModes = new SparseArray<>();
private final ArrayList<Integer> mSupportedColorModes = new ArrayList<>();
private final boolean mIsDefaultDisplay;
+ private final BacklightAdapter mBacklightAdapter;
private DisplayDeviceInfo mInfo;
private boolean mHavePendingChanges;
@@ -205,7 +205,6 @@
private SurfaceControl.DisplayConfig[] mDisplayConfigs;
private Spline mSystemBrightnessToNits;
private Spline mNitsToHalBrightness;
-
private DisplayDeviceConfig mDisplayDeviceConfig;
private DisplayEventReceiver.FrameRateOverride[] mFrameRateOverrides =
@@ -222,12 +221,7 @@
updateDisplayPropertiesLocked(info, configs, activeConfigId, configSpecs, colorModes,
activeColorMode, hdrCapabilities);
mSidekickInternal = LocalServices.getService(SidekickInternal.class);
- if (mIsDefaultDisplay) {
- LightsManager lights = LocalServices.getService(LightsManager.class);
- mBacklight = lights.getLight(LightsManager.LIGHT_ID_BACKLIGHT);
- } else {
- mBacklight = null;
- }
+ mBacklightAdapter = new BacklightAdapter(displayToken, isDefaultDisplay);
mAllmSupported = SurfaceControl.getAutoLowLatencyModeSupport(displayToken);
mGameContentTypeSupported = SurfaceControl.getGameContentTypeSupport(displayToken);
mDisplayDeviceConfig = null;
@@ -643,8 +637,7 @@
brightnessState, PowerManager.BRIGHTNESS_OFF_FLOAT);
final boolean stateChanged = (mState != state);
final boolean brightnessChanged = (!BrightnessSynchronizer.floatEquals(
- mBrightnessState, brightnessState))
- && mBacklight != null;
+ mBrightnessState, brightnessState));
if (stateChanged || brightnessChanged) {
final long physicalDisplayId = mPhysicalDisplayId;
final IBinder token = getDisplayTokenLocked();
@@ -712,9 +705,7 @@
+ "id=" + physicalDisplayId
+ ", state=" + Display.stateToString(state) + ")");
}
- if (mBacklight != null) {
- mBacklight.setVrMode(isVrEnabled);
- }
+ mBacklightAdapter.setVrMode(isVrEnabled);
}
private void setDisplayState(int state) {
@@ -770,13 +761,8 @@
Trace.traceBegin(Trace.TRACE_TAG_POWER, "setDisplayBrightness("
+ "id=" + physicalDisplayId + ", brightness=" + brightness + ")");
try {
- if (isHalBrightnessRangeSpecified()) {
- brightness = displayBrightnessToHalBrightness(
- BrightnessSynchronizer.brightnessFloatToIntRange(brightness));
- }
- if (mBacklight != null) {
- mBacklight.setBrightness(brightness);
- }
+ brightness = displayBrightnessToHalBrightness(brightness);
+ mBacklightAdapter.setBrightness(brightness);
Trace.traceCounter(Trace.TRACE_TAG_POWER,
"ScreenBrightness",
BrightnessSynchronizer.brightnessFloatToInt(brightness));
@@ -785,26 +771,33 @@
}
}
- private boolean isHalBrightnessRangeSpecified() {
- return !(mSystemBrightnessToNits == null || mNitsToHalBrightness == null);
- }
-
/**
* Converts brightness range from the framework's brightness space to the
* Hal brightness space if the HAL brightness space has been provided via
* a display device configuration file.
*/
private float displayBrightnessToHalBrightness(float brightness) {
- if (!isHalBrightnessRangeSpecified()) {
- return PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ // TODO: b/171380847 - This needs to be deprecated. The nits-to-brightness
+ // relationship should be specified in display-config OR config.xml, but not
+ // both, and no nits-space conversion should be necessary.
+ //
+ // Only do a conversion if there exists a unique system brightness and a
+ // unique HAL brightness-to-nits range defined.
+ if (mSystemBrightnessToNits == null || mNitsToHalBrightness == null) {
+ return brightness;
}
+ // Sys brightness in this conversion is always specified in the old 1-255
+ // range, so convert that here before the translation.
+ final float brightnessInt =
+ BrightnessSynchronizer.brightnessFloatToIntRange(brightness);
+
if (BrightnessSynchronizer.floatEquals(
- brightness, PowerManager.BRIGHTNESS_OFF)) {
+ brightnessInt, PowerManager.BRIGHTNESS_OFF)) {
return PowerManager.BRIGHTNESS_OFF_FLOAT;
}
- final float nits = mSystemBrightnessToNits.interpolate(brightness);
+ final float nits = mSystemBrightnessToNits.interpolate(brightnessInt);
final float halBrightness = mNitsToHalBrightness.interpolate(nits);
return halBrightness;
}
@@ -988,7 +981,7 @@
pw.println("mDefaultModeId=" + mDefaultModeId);
pw.println("mState=" + Display.stateToString(mState));
pw.println("mBrightnessState=" + mBrightnessState);
- pw.println("mBacklight=" + mBacklight);
+ pw.println("mBacklightAdapter=" + mBacklightAdapter);
pw.println("mAllmSupported=" + mAllmSupported);
pw.println("mAllmRequested=" + mAllmRequested);
pw.println("mGameContentTypeSupported=" + mGameContentTypeSupported);
@@ -1209,4 +1202,44 @@
}
}
}
+
+ static class BacklightAdapter {
+ private final IBinder mDisplayToken;
+ private final LogicalLight mBacklight;
+ private final boolean mUseSurfaceControlBrightness;
+
+ BacklightAdapter(IBinder displayToken, boolean isDefaultDisplay) {
+ mDisplayToken = displayToken;
+
+ mUseSurfaceControlBrightness =
+ SurfaceControl.getDisplayBrightnessSupport(mDisplayToken);
+
+ if (!mUseSurfaceControlBrightness && isDefaultDisplay) {
+ LightsManager lights = LocalServices.getService(LightsManager.class);
+ mBacklight = lights.getLight(LightsManager.LIGHT_ID_BACKLIGHT);
+ } else {
+ mBacklight = null;
+ }
+ }
+
+ public void setBrightness(float brightness) {
+ if (mUseSurfaceControlBrightness) {
+ SurfaceControl.setDisplayBrightness(mDisplayToken, brightness);
+ } else if (mBacklight != null) {
+ mBacklight.setBrightness(brightness);
+ }
+ }
+
+ public void setVrMode(boolean isVrModeEnabled) {
+ if (mBacklight != null) {
+ mBacklight.setVrMode(isVrModeEnabled);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "BacklightAdapter [useSurfaceControl=" + mUseSurfaceControlBrightness
+ + ", backlight=" + mBacklight + "]";
+ }
+ }
}
diff --git a/services/core/java/com/android/server/display/LogicalDisplayMapper.java b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
index cdcbb4f..a127858 100644
--- a/services/core/java/com/android/server/display/LogicalDisplayMapper.java
+++ b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
@@ -20,13 +20,13 @@
import android.os.Process;
import android.os.SystemProperties;
import android.text.TextUtils;
+import android.util.IndentingPrintWriter;
import android.util.Slog;
import android.util.SparseArray;
import android.view.Display;
import android.view.DisplayEventReceiver;
import android.view.DisplayInfo;
-import com.android.internal.util.IndentingPrintWriter;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -102,13 +102,10 @@
private final SparseArray<DisplayGroup> mDisplayGroups = new SparseArray<>();
private final DisplayDeviceRepository mDisplayDeviceRepo;
- private final PersistentDataStore mPersistentDataStore;
private final Listener mListener;
- LogicalDisplayMapper(Context context, DisplayDeviceRepository repo, Listener listener,
- PersistentDataStore persistentDataStore) {
+ LogicalDisplayMapper(Context context, DisplayDeviceRepository repo, Listener listener) {
mDisplayDeviceRepo = repo;
- mPersistentDataStore = persistentDataStore;
mListener = listener;
mSingleDisplayDemoMode = SystemProperties.getBoolean("persist.demo.singledisplay", false);
mDisplayDeviceRepo.addListener(this);
@@ -238,7 +235,7 @@
// Find the associated LogicalDisplays for the configured "folding" DeviceDisplays.
final LogicalDisplay displayFolded = getLocked(deviceFolded);
final LogicalDisplay displayUnfolded = getLocked(deviceUnfolded);
- if (displayFolded == null || displayFolded == null) {
+ if (displayFolded == null || displayUnfolded == null) {
// If the expected displays are not present, return early.
return;
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecConfig.java b/services/core/java/com/android/server/hdmi/HdmiCecConfig.java
index 98d130f..371fd3d 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecConfig.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecConfig.java
@@ -85,7 +85,7 @@
@NonNull private final Context mContext;
@NonNull private final StorageAdapter mStorageAdapter;
- @Nullable private final CecSettings mProductConfig;
+ @Nullable private final CecSettings mSystemConfig;
@Nullable private final CecSettings mVendorOverride;
/**
@@ -162,14 +162,14 @@
@VisibleForTesting
HdmiCecConfig(@NonNull Context context,
@NonNull StorageAdapter storageAdapter,
- @Nullable CecSettings productConfig,
+ @Nullable CecSettings systemConfig,
@Nullable CecSettings vendorOverride) {
mContext = context;
mStorageAdapter = storageAdapter;
- mProductConfig = productConfig;
+ mSystemConfig = systemConfig;
mVendorOverride = vendorOverride;
- if (mProductConfig == null) {
- Slog.i(TAG, "CEC master configuration XML missing.");
+ if (mSystemConfig == null) {
+ Slog.i(TAG, "CEC system configuration XML missing.");
}
if (mVendorOverride == null) {
Slog.i(TAG, "CEC OEM configuration override XML missing.");
@@ -178,7 +178,7 @@
HdmiCecConfig(@NonNull Context context) {
this(context, new StorageAdapter(context),
- readSettingsFromFile(Environment.buildPath(Environment.getProductDirectory(),
+ readSettingsFromFile(Environment.buildPath(Environment.getRootDirectory(),
ETC_DIR, CONFIG_FILE)),
readSettingsFromFile(Environment.buildPath(Environment.getVendorDirectory(),
ETC_DIR, CONFIG_FILE)));
@@ -226,7 +226,7 @@
@Nullable
private Setting getSetting(@NonNull String name) {
- if (mProductConfig == null) {
+ if (mSystemConfig == null) {
return null;
}
if (mVendorOverride != null) {
@@ -237,8 +237,8 @@
}
}
}
- // If not found, try the product config.
- for (Setting setting : mProductConfig.getSetting()) {
+ // If not found, try the system config.
+ for (Setting setting : mSystemConfig.getSetting()) {
if (setting.getName().equals(name)) {
return setting;
}
@@ -322,11 +322,11 @@
* Returns a list of all settings based on the XML metadata.
*/
public @CecSettingName List<String> getAllSettings() {
- if (mProductConfig == null) {
+ if (mSystemConfig == null) {
return new ArrayList<String>();
}
List<String> allSettings = new ArrayList<String>();
- for (Setting setting : mProductConfig.getSetting()) {
+ for (Setting setting : mSystemConfig.getSetting()) {
allSettings.add(setting.getName());
}
return allSettings;
@@ -336,12 +336,12 @@
* Returns a list of user-modifiable settings based on the XML metadata.
*/
public @CecSettingName List<String> getUserSettings() {
- if (mProductConfig == null) {
+ if (mSystemConfig == null) {
return new ArrayList<String>();
}
Set<String> userSettings = new HashSet<String>();
- // First read from the product config.
- for (Setting setting : mProductConfig.getSetting()) {
+ // First read from the system config.
+ for (Setting setting : mSystemConfig.getSetting()) {
if (setting.getUserConfigurable()) {
userSettings.add(setting.getName());
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
index 9b3f788..52121f3 100755
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -282,6 +282,8 @@
return handleGiveOsdName(message);
case Constants.MESSAGE_GIVE_DEVICE_VENDOR_ID:
return handleGiveDeviceVendorId(null);
+ case Constants.MESSAGE_CEC_VERSION:
+ return handleCecVersion();
case Constants.MESSAGE_GET_CEC_VERSION:
return handleGetCecVersion(message);
case Constants.MESSAGE_REPORT_PHYSICAL_ADDRESS:
@@ -406,6 +408,14 @@
}
@ServiceThreadOnly
+ private boolean handleCecVersion() {
+ assertRunOnServiceThread();
+
+ // Return true to avoid <Feature Abort> responses. Cec Version is tracked in HdmiCecNetwork.
+ return true;
+ }
+
+ @ServiceThreadOnly
protected boolean handleActiveSource(HdmiCecMessage message) {
return false;
}
@@ -613,6 +623,14 @@
return false;
}
+ if (isPowerOffOrToggleCommand(message) || isPowerOnOrToggleCommand(message)) {
+ // Power commands should already be handled above. Don't continue and convert the CEC
+ // keycode to Android keycode.
+ // Do not <Feature Abort> as the local device should already be in the correct power
+ // state.
+ return true;
+ }
+
final long downTime = SystemClock.uptimeMillis();
final byte[] params = message.getParams();
final int keycode = HdmiCecKeycode.cecKeycodeAndParamsToAndroidKey(params);
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java b/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java
index fc21724..b748ae0 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java
@@ -166,7 +166,6 @@
}
return false;
}
-
/**
* Clear all logical addresses registered in the device.
*
@@ -523,11 +522,32 @@
case Constants.MESSAGE_DEVICE_VENDOR_ID:
handleDeviceVendorId(message);
break;
-
+ case Constants.MESSAGE_CEC_VERSION:
+ handleCecVersion(message);
+ break;
+ case Constants.MESSAGE_REPORT_FEATURES:
+ handleReportFeatures(message);
+ break;
}
}
@ServiceThreadOnly
+ private void handleReportFeatures(HdmiCecMessage message) {
+ assertRunOnServiceThread();
+
+ int version = Byte.toUnsignedInt(message.getParams()[0]);
+ updateDeviceCecVersion(message.getSource(), version);
+ }
+
+ @ServiceThreadOnly
+ private void handleCecVersion(HdmiCecMessage message) {
+ assertRunOnServiceThread();
+
+ int version = Byte.toUnsignedInt(message.getParams()[0]);
+ updateDeviceCecVersion(message.getSource(), version);
+ }
+
+ @ServiceThreadOnly
private void handleReportPhysicalAddress(HdmiCecMessage message) {
assertRunOnServiceThread();
int logicalAddress = message.getSource();
@@ -543,7 +563,8 @@
HdmiDeviceInfo updatedDeviceInfo = new HdmiDeviceInfo(deviceInfo.getLogicalAddress(),
physicalAddress,
physicalAddressToPortId(physicalAddress), type, deviceInfo.getVendorId(),
- deviceInfo.getDisplayName(), deviceInfo.getDevicePowerStatus());
+ deviceInfo.getDisplayName(), deviceInfo.getDevicePowerStatus(),
+ deviceInfo.getCecVersion());
updateCecDevice(updatedDeviceInfo);
}
}
@@ -554,6 +575,31 @@
// Update power status of device
int newStatus = message.getParams()[0] & 0xFF;
updateDevicePowerStatus(message.getSource(), newStatus);
+
+ if (message.getDestination() == Constants.ADDR_BROADCAST) {
+ updateDeviceCecVersion(message.getSource(), HdmiControlManager.HDMI_CEC_VERSION_2_0);
+ }
+ }
+
+ @ServiceThreadOnly
+ private void updateDeviceCecVersion(int logicalAddress, int hdmiCecVersion) {
+ assertRunOnServiceThread();
+ HdmiDeviceInfo deviceInfo = getCecDeviceInfo(logicalAddress);
+ if (deviceInfo == null) {
+ Slog.w(TAG, "Can not update CEC version of non-existing device:" + logicalAddress);
+ return;
+ }
+
+ if (deviceInfo.getCecVersion() == hdmiCecVersion) {
+ return;
+ }
+
+ HdmiDeviceInfo updatedDeviceInfo = new HdmiDeviceInfo(deviceInfo.getLogicalAddress(),
+ deviceInfo.getPhysicalAddress(), deviceInfo.getPortId(), deviceInfo.getDeviceType(),
+ deviceInfo.getVendorId(),
+ deviceInfo.getDisplayName(), deviceInfo.getDevicePowerStatus(),
+ hdmiCecVersion);
+ updateCecDevice(updatedDeviceInfo);
}
@ServiceThreadOnly
@@ -586,7 +632,7 @@
updateCecDevice(new HdmiDeviceInfo(deviceInfo.getLogicalAddress(),
deviceInfo.getPhysicalAddress(), deviceInfo.getPortId(),
deviceInfo.getDeviceType(), deviceInfo.getVendorId(), osdName,
- deviceInfo.getDevicePowerStatus()));
+ deviceInfo.getDevicePowerStatus(), deviceInfo.getCecVersion()));
}
@ServiceThreadOnly
@@ -602,7 +648,8 @@
HdmiDeviceInfo updatedDeviceInfo = new HdmiDeviceInfo(deviceInfo.getLogicalAddress(),
deviceInfo.getPhysicalAddress(),
deviceInfo.getPortId(), deviceInfo.getDeviceType(), vendorId,
- deviceInfo.getDisplayName(), deviceInfo.getDevicePowerStatus());
+ deviceInfo.getDisplayName(), deviceInfo.getDevicePowerStatus(),
+ deviceInfo.getCecVersion());
updateCecDevice(updatedDeviceInfo);
}
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index a1d13e9..c943fbc 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -813,7 +813,7 @@
// with system.
HdmiDeviceInfo deviceInfo = createDeviceInfo(logicalAddress,
deviceType,
- HdmiControlManager.POWER_STATUS_ON);
+ HdmiControlManager.POWER_STATUS_ON, getCecVersion());
localDevice.setDeviceInfo(deviceInfo);
mHdmiCecNetwork.addLocalDevice(deviceType, localDevice);
mCecController.addLogicalAddress(logicalAddress);
@@ -1222,11 +1222,12 @@
}
}
- private HdmiDeviceInfo createDeviceInfo(int logicalAddress, int deviceType, int powerStatus) {
+ private HdmiDeviceInfo createDeviceInfo(int logicalAddress, int deviceType, int powerStatus,
+ int cecVersion) {
String displayName = readStringSetting(Global.DEVICE_NAME, Build.MODEL);
return new HdmiDeviceInfo(logicalAddress,
getPhysicalAddress(), pathToPortId(getPhysicalAddress()), deviceType,
- getVendorId(), displayName, powerStatus);
+ getVendorId(), displayName, powerStatus, cecVersion);
}
// Set the display name in HdmiDeviceInfo of the current devices to content provided by
@@ -1240,7 +1241,7 @@
device.setDeviceInfo(new HdmiDeviceInfo(
deviceInfo.getLogicalAddress(), deviceInfo.getPhysicalAddress(),
deviceInfo.getPortId(), deviceInfo.getDeviceType(), deviceInfo.getVendorId(),
- newDisplayName, deviceInfo.getDevicePowerStatus()));
+ newDisplayName, deviceInfo.getDevicePowerStatus(), deviceInfo.getCecVersion()));
sendCecCommand(HdmiCecMessageBuilder.buildSetOsdNameCommand(
device.mAddress, Constants.ADDR_TV, newDisplayName));
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiUtils.java b/services/core/java/com/android/server/hdmi/HdmiUtils.java
index 52a804a..03e5de8 100644
--- a/services/core/java/com/android/server/hdmi/HdmiUtils.java
+++ b/services/core/java/com/android/server/hdmi/HdmiUtils.java
@@ -396,7 +396,7 @@
static HdmiDeviceInfo cloneHdmiDeviceInfo(HdmiDeviceInfo info, int newPowerStatus) {
return new HdmiDeviceInfo(info.getLogicalAddress(),
info.getPhysicalAddress(), info.getPortId(), info.getDeviceType(),
- info.getVendorId(), info.getDisplayName(), newPowerStatus);
+ info.getVendorId(), info.getDisplayName(), newPowerStatus, info.getCecVersion());
}
/**
diff --git a/services/core/java/com/android/server/hdmi/OWNERS b/services/core/java/com/android/server/hdmi/OWNERS
new file mode 100644
index 0000000..c3c47ed
--- /dev/null
+++ b/services/core/java/com/android/server/hdmi/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/hdmi/OWNERS
diff --git a/services/core/java/com/android/server/hdmi/cec_config.xml b/services/core/java/com/android/server/hdmi/cec_config.xml
new file mode 100644
index 0000000..480e0ec
--- /dev/null
+++ b/services/core/java/com/android/server/hdmi/cec_config.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
+<cec-settings>
+ <setting name="hdmi_cec_enabled"
+ value-type="int"
+ user-configurable="true">
+ <allowed-values>
+ <value int-value="0" />
+ <value int-value="1" />
+ </allowed-values>
+ <default-value int-value="1" />
+ </setting>
+ <setting name="hdmi_cec_version"
+ value-type="int"
+ user-configurable="true">
+ <allowed-values>
+ <value int-value="0x05" />
+ <value int-value="0x06" />
+ </allowed-values>
+ <default-value int-value="0x05" />
+ </setting>
+ <setting name="send_standby_on_sleep"
+ value-type="string"
+ user-configurable="true">
+ <allowed-values>
+ <value string-value="to_tv" />
+ <value string-value="broadcast" />
+ <value string-value="none" />
+ </allowed-values>
+ <default-value string-value="to_tv" />
+ </setting>
+ <setting name="power_state_change_on_active_source_lost"
+ value-type="string"
+ user-configurable="true">
+ <allowed-values>
+ <value string-value="none" />
+ <value string-value="standby_now" />
+ </allowed-values>
+ <default-value string-value="none" />
+ </setting>
+ <setting name="system_audio_mode_muting"
+ value-type="int"
+ user-configurable="true">
+ <allowed-values>
+ <value int-value="0" />
+ <value int-value="1" />
+ </allowed-values>
+ <default-value int-value="1" />
+ </setting>
+</cec-settings>
diff --git a/services/core/java/com/android/server/incident/OWNERS b/services/core/java/com/android/server/incident/OWNERS
new file mode 100644
index 0000000..f766115
--- /dev/null
+++ b/services/core/java/com/android/server/incident/OWNERS
@@ -0,0 +1 @@
+include /cmds/incidentd/OWNERS
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index 42aad7d..46ccf1e 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -51,6 +51,7 @@
import android.media.AudioManager;
import android.os.Binder;
import android.os.Bundle;
+import android.os.CombinedVibrationEffect;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
@@ -203,7 +204,12 @@
private int mNextVibratorTokenValue;
// State for lid switch
+ // Lock for the lid switch state. Held when triggering callbacks to guarantee lid switch events
+ // are delivered in order. For ex, when a new lid switch callback is registered the lock is held
+ // while the callback is processing the initial lid switch event which guarantees that any
+ // events that occur at the same time are delivered after the callback has returned.
private final Object mLidSwitchLock = new Object();
+ @GuardedBy("mLidSwitchLock")
private List<LidSwitchCallback> mLidSwitchCallbacks = new ArrayList<>();
// State for the currently installed input filter.
@@ -264,7 +270,11 @@
private static native void nativeReloadCalibration(long ptr);
private static native void nativeVibrate(long ptr, int deviceId, long[] pattern,
int[] amplitudes, int repeat, int token);
+ private static native void nativeVibrateCombined(long ptr, int deviceId, long[] pattern,
+ SparseArray<int[]> amplitudes, int repeat, int token);
private static native void nativeCancelVibrate(long ptr, int deviceId, int token);
+ private static native boolean nativeIsVibrating(long ptr, int deviceId);
+ private static native int[] nativeGetVibratorIds(long ptr, int deviceId);
private static native void nativeReloadKeyboardLayouts(long ptr);
private static native void nativeReloadDeviceAliases(long ptr);
private static native String nativeDump(long ptr);
@@ -343,9 +353,6 @@
public static final int SW_CAMERA_LENS_COVER_BIT = 1 << SW_CAMERA_LENS_COVER;
public static final int SW_MUTE_DEVICE_BIT = 1 << SW_MUTE_DEVICE;
- /** Indicates an open state for the lid switch. */
- public static final int SW_STATE_LID_OPEN = 0;
-
/** Whether to use the dev/input/event or uevent subsystem for the audio jack. */
final boolean mUseDevInputEventForAudioJack;
@@ -381,13 +388,18 @@
}
void registerLidSwitchCallbackInternal(@NonNull LidSwitchCallback callback) {
- boolean lidOpen;
synchronized (mLidSwitchLock) {
mLidSwitchCallbacks.add(callback);
- lidOpen = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, SW_LID)
- == SW_STATE_LID_OPEN;
+
+ // Skip triggering the initial callback if the system is not yet ready as the switch
+ // state will be reported as KEY_STATE_UNKNOWN. The callback will be triggered in
+ // systemRunning().
+ if (mSystemReady) {
+ boolean lidOpen = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, SW_LID)
+ == KEY_STATE_UP;
+ callback.notifyLidSwitchChanged(0 /* whenNanos */, lidOpen);
+ }
}
- callback.notifyLidSwitchChanged(0 /* whenNanos */, lidOpen);
}
void unregisterLidSwitchCallbackInternal(@NonNull LidSwitchCallback callback) {
@@ -435,7 +447,18 @@
}
mNotificationManager = (NotificationManager)mContext.getSystemService(
Context.NOTIFICATION_SERVICE);
- mSystemReady = true;
+
+ synchronized (mLidSwitchLock) {
+ mSystemReady = true;
+
+ // Send the initial lid switch state to any callback registered before the system was
+ // ready.
+ int switchState = getSwitchState(-1 /* deviceId */, InputDevice.SOURCE_ANY, SW_LID);
+ for (int i = 0; i < mLidSwitchCallbacks.size(); i++) {
+ LidSwitchCallback callback = mLidSwitchCallbacks.get(i);
+ callback.notifyLidSwitchChanged(0 /* whenNanos */, switchState == KEY_STATE_UP);
+ }
+ }
IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
@@ -1801,43 +1824,57 @@
return result;
}
- // Binder call
- @Override
- public void vibrate(int deviceId, VibrationEffect effect, IBinder token) {
- long[] pattern;
- int[] amplitudes;
- int repeat;
- if (effect instanceof VibrationEffect.OneShot) {
- VibrationEffect.OneShot oneShot = (VibrationEffect.OneShot) effect;
- pattern = new long[] { 0, oneShot.getDuration() };
- int amplitude = oneShot.getAmplitude();
- // android framework uses DEFAULT_AMPLITUDE to signal that the vibration
- // should use some built-in default value, denoted here as DEFAULT_VIBRATION_MAGNITUDE
- if (amplitude == VibrationEffect.DEFAULT_AMPLITUDE) {
- amplitude = DEFAULT_VIBRATION_MAGNITUDE;
- }
- amplitudes = new int[] { 0, amplitude };
- repeat = -1;
- } else if (effect instanceof VibrationEffect.Waveform) {
- VibrationEffect.Waveform waveform = (VibrationEffect.Waveform) effect;
- pattern = waveform.getTimings();
- amplitudes = waveform.getAmplitudes();
- for (int i = 0; i < amplitudes.length; i++) {
- if (amplitudes[i] == VibrationEffect.DEFAULT_AMPLITUDE) {
- amplitudes[i] = DEFAULT_VIBRATION_MAGNITUDE;
+ private static class VibrationInfo {
+ private long[] mPattern = new long[0];
+ private int[] mAmplitudes = new int[0];
+ private int mRepeat = -1;
+
+ public long[] getPattern() {
+ return mPattern;
+ }
+
+ public int[] getAmplitudes() {
+ return mAmplitudes;
+ }
+
+ public int getRepeatIndex() {
+ return mRepeat;
+ }
+
+ VibrationInfo(VibrationEffect effect) {
+ if (effect instanceof VibrationEffect.OneShot) {
+ VibrationEffect.OneShot oneShot = (VibrationEffect.OneShot) effect;
+ mPattern = new long[] { 0, oneShot.getDuration() };
+ int amplitude = oneShot.getAmplitude();
+ // android framework uses DEFAULT_AMPLITUDE to signal that the vibration
+ // should use some built-in default value, denoted here as
+ // DEFAULT_VIBRATION_MAGNITUDE
+ if (amplitude == VibrationEffect.DEFAULT_AMPLITUDE) {
+ amplitude = DEFAULT_VIBRATION_MAGNITUDE;
}
+ mAmplitudes = new int[] { 0, amplitude };
+ mRepeat = -1;
+ } else if (effect instanceof VibrationEffect.Waveform) {
+ VibrationEffect.Waveform waveform = (VibrationEffect.Waveform) effect;
+ mPattern = waveform.getTimings();
+ mAmplitudes = waveform.getAmplitudes();
+ for (int i = 0; i < mAmplitudes.length; i++) {
+ if (mAmplitudes[i] == VibrationEffect.DEFAULT_AMPLITUDE) {
+ mAmplitudes[i] = DEFAULT_VIBRATION_MAGNITUDE;
+ }
+ }
+ mRepeat = waveform.getRepeatIndex();
+ if (mRepeat >= mPattern.length) {
+ throw new ArrayIndexOutOfBoundsException();
+ }
+ } else {
+ // TODO: Add support for prebaked effects
+ Slog.w(TAG, "Pre-baked effects aren't supported on input devices");
}
- repeat = waveform.getRepeatIndex();
- } else {
- // TODO: Add support for prebaked effects
- Log.w(TAG, "Pre-baked effects aren't supported on input devices");
- return;
}
+ }
- if (repeat >= pattern.length) {
- throw new ArrayIndexOutOfBoundsException();
- }
-
+ private VibratorToken getVibratorToken(int deviceId, IBinder token) {
VibratorToken v;
synchronized (mVibratorLock) {
v = mVibratorTokens.get(token);
@@ -1852,9 +1889,70 @@
mVibratorTokens.put(token, v);
}
}
+ return v;
+ }
+
+ // Binder call
+ @Override
+ public void vibrate(int deviceId, VibrationEffect effect, IBinder token) {
+ VibrationInfo info = new VibrationInfo(effect);
+ VibratorToken v = getVibratorToken(deviceId, token);
synchronized (v) {
v.mVibrating = true;
- nativeVibrate(mPtr, deviceId, pattern, amplitudes, repeat, v.mTokenValue);
+ nativeVibrate(mPtr, deviceId, info.getPattern(), info.getAmplitudes(),
+ info.getRepeatIndex(), v.mTokenValue);
+ }
+ }
+
+ // Binder call
+ @Override
+ public int[] getVibratorIds(int deviceId) {
+ return nativeGetVibratorIds(mPtr, deviceId);
+ }
+
+ // Binder call
+ @Override
+ public boolean isVibrating(int deviceId) {
+ return nativeIsVibrating(mPtr, deviceId);
+ }
+
+ // Binder call
+ @Override
+ public void vibrateCombined(int deviceId, CombinedVibrationEffect effect, IBinder token) {
+ VibratorToken v = getVibratorToken(deviceId, token);
+ synchronized (v) {
+ if (!(effect instanceof CombinedVibrationEffect.Mono)
+ && !(effect instanceof CombinedVibrationEffect.Stereo)) {
+ Slog.e(TAG, "Only Mono and Stereo effects are supported");
+ return;
+ }
+
+ v.mVibrating = true;
+ if (effect instanceof CombinedVibrationEffect.Mono) {
+ CombinedVibrationEffect.Mono mono = (CombinedVibrationEffect.Mono) effect;
+ VibrationInfo info = new VibrationInfo(mono.getEffect());
+ nativeVibrate(mPtr, deviceId, info.getPattern(), info.getAmplitudes(),
+ info.getRepeatIndex(), v.mTokenValue);
+ } else if (effect instanceof CombinedVibrationEffect.Stereo) {
+ CombinedVibrationEffect.Stereo stereo = (CombinedVibrationEffect.Stereo) effect;
+ SparseArray<VibrationEffect> effects = stereo.getEffects();
+ long[] pattern = new long[0];
+ int repeat = Integer.MIN_VALUE;
+ SparseArray<int[]> amplitudes = new SparseArray<int[]>(effects.size());
+ for (int i = 0; i < effects.size(); i++) {
+ VibrationInfo info = new VibrationInfo(effects.valueAt(i));
+ // Pattern of all effects should be same
+ if (pattern.length == 0) {
+ pattern = info.getPattern();
+ }
+ if (repeat == Integer.MIN_VALUE) {
+ repeat = info.getRepeatIndex();
+ }
+ amplitudes.put(effects.keyAt(i), info.getAmplitudes());
+ }
+ nativeVibrateCombined(mPtr, deviceId, pattern, amplitudes, repeat,
+ v.mTokenValue);
+ }
}
}
@@ -2045,14 +2143,13 @@
if ((switchMask & SW_LID_BIT) != 0) {
final boolean lidOpen = ((switchValues & SW_LID_BIT) == 0);
-
- ArrayList<LidSwitchCallback> callbacksCopy;
synchronized (mLidSwitchLock) {
- callbacksCopy = new ArrayList<>(mLidSwitchCallbacks);
- }
- for (int i = 0; i < callbacksCopy.size(); i++) {
- LidSwitchCallback callbacks = callbacksCopy.get(i);
- callbacks.notifyLidSwitchChanged(whenNanos, lidOpen);
+ if (mSystemReady) {
+ for (int i = 0; i < mLidSwitchCallbacks.size(); i++) {
+ LidSwitchCallback callbacks = mLidSwitchCallbacks.get(i);
+ callbacks.notifyLidSwitchChanged(whenNanos, lidOpen);
+ }
+ }
}
}
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
index d624019..43c965d 100644
--- a/services/core/java/com/android/server/lights/LightsService.java
+++ b/services/core/java/com/android/server/lights/LightsService.java
@@ -29,14 +29,12 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
-import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.Trace;
import android.provider.Settings;
import android.util.Slog;
import android.util.SparseArray;
-import android.view.SurfaceControl;
import com.android.internal.BrightnessSynchronizer;
import com.android.internal.annotations.GuardedBy;
@@ -262,25 +260,9 @@
}
private final class LightImpl extends LogicalLight {
- private final IBinder mDisplayToken;
- private final int mSurfaceControlMaximumBrightness;
private LightImpl(Context context, HwLight hwLight) {
mHwLight = hwLight;
- mDisplayToken = SurfaceControl.getInternalDisplayToken();
- final boolean brightnessSupport = SurfaceControl.getDisplayBrightnessSupport(
- mDisplayToken);
- if (DEBUG) {
- Slog.d(TAG, "Display brightness support: " + brightnessSupport);
- }
- int maximumBrightness = 0;
- if (brightnessSupport) {
- PowerManager pm = context.getSystemService(PowerManager.class);
- if (pm != null) {
- maximumBrightness = pm.getMaximumScreenBrightnessSetting();
- }
- }
- mSurfaceControlMaximumBrightness = maximumBrightness;
}
@Override
@@ -301,28 +283,10 @@
+ ": brightness=" + brightness);
return;
}
- // Ideally, we'd like to set the brightness mode through the SF/HWC as well, but
- // right now we just fall back to the old path through Lights brightessMode is
- // anything but USER or the device shouldBeInLowPersistenceMode().
- if (brightnessMode == BRIGHTNESS_MODE_USER && !shouldBeInLowPersistenceMode()
- && mSurfaceControlMaximumBrightness == 255) {
- // New system
- // TODO: the last check should be mSurfaceControlMaximumBrightness != 0; the
- // reason we enforce 255 right now is to stay consistent with the old path. In
- // the future, the framework should be refactored so that brightness is a float
- // between 0.0f and 1.0f, and the actual number of supported brightness levels
- // is determined in the device-specific implementation.
- if (DEBUG) {
- Slog.d(TAG, "Using new setBrightness path!");
- }
- SurfaceControl.setDisplayBrightness(mDisplayToken, brightness);
- } else {
- // Old system
- int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness);
- int color = brightnessInt & 0x000000ff;
- color = 0xff000000 | (color << 16) | (color << 8) | color;
- setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
- }
+ int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness);
+ int color = brightnessInt & 0x000000ff;
+ color = 0xff000000 | (color << 16) | (color << 8) | color;
+ setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
}
}
diff --git a/services/core/java/com/android/server/location/LocationManagerService.java b/services/core/java/com/android/server/location/LocationManagerService.java
index 3854f8c..324332f 100644
--- a/services/core/java/com/android/server/location/LocationManagerService.java
+++ b/services/core/java/com/android/server/location/LocationManagerService.java
@@ -519,9 +519,6 @@
public List<String> getAllProviders() {
ArrayList<String> providers = new ArrayList<>(mProviderManagers.size());
for (LocationProviderManager manager : mProviderManagers) {
- if (FUSED_PROVIDER.equals(manager.getName())) {
- continue;
- }
providers.add(manager.getName());
}
return providers;
@@ -538,9 +535,6 @@
ArrayList<String> providers = new ArrayList<>(mProviderManagers.size());
for (LocationProviderManager manager : mProviderManagers) {
String name = manager.getName();
- if (FUSED_PROVIDER.equals(name)) {
- continue;
- }
if (enabledOnly && !manager.isEnabled(UserHandle.getCallingUserId())) {
continue;
}
@@ -565,7 +559,9 @@
}
if (!providers.isEmpty()) {
- if (providers.contains(GPS_PROVIDER)) {
+ if (providers.contains(FUSED_PROVIDER)) {
+ return FUSED_PROVIDER;
+ } else if (providers.contains(GPS_PROVIDER)) {
return GPS_PROVIDER;
} else if (providers.contains(NETWORK_PROVIDER)) {
return NETWORK_PROVIDER;
@@ -1046,10 +1042,6 @@
@Override
public boolean isProviderEnabledForUser(String provider, int userId) {
- // fused provider is accessed indirectly via criteria rather than the provider-based APIs,
- // so we discourage its use
- if (FUSED_PROVIDER.equals(provider)) return false;
-
return mLocalService.isProviderEnabledForUser(provider, userId);
}
diff --git a/services/core/java/com/android/server/location/OWNERS b/services/core/java/com/android/server/location/OWNERS
index c2c95e6..696a0c2 100644
--- a/services/core/java/com/android/server/location/OWNERS
+++ b/services/core/java/com/android/server/location/OWNERS
@@ -1,8 +1 @@
-aadmal@google.com
-arthuri@google.com
-bduddie@google.com
-gomo@google.com
-sooniln@google.com
-weiwa@google.com
-wyattriley@google.com
-yuhany@google.com
+file:/location/java/android/location/OWNERS
diff --git a/services/core/java/com/android/server/location/contexthub/OWNERS b/services/core/java/com/android/server/location/contexthub/OWNERS
new file mode 100644
index 0000000..d4393d6
--- /dev/null
+++ b/services/core/java/com/android/server/location/contexthub/OWNERS
@@ -0,0 +1,2 @@
+arthuri@google.com
+bduddie@google.com
diff --git a/services/core/java/com/android/server/location/gnss/GnssPowerStats.java b/services/core/java/com/android/server/location/gnss/GnssPowerStats.java
index 70ab3c6..b924d1f 100644
--- a/services/core/java/com/android/server/location/gnss/GnssPowerStats.java
+++ b/services/core/java/com/android/server/location/gnss/GnssPowerStats.java
@@ -16,8 +16,8 @@
package com.android.server.location.gnss;
-import static android.hardware.gnss.IGnss.ELAPSED_REALTIME_HAS_TIMESTAMP_NS;
-import static android.hardware.gnss.IGnss.ELAPSED_REALTIME_HAS_TIME_UNCERTAINTY_NS;
+import static android.hardware.gnss.ElapsedRealtime.HAS_TIMESTAMP_NS;
+import static android.hardware.gnss.ElapsedRealtime.HAS_TIME_UNCERTAINTY_NS;
import com.android.internal.util.Preconditions;
@@ -57,12 +57,12 @@
/** Returns true if {@link #getElapsedRealtimeNanos()} is available. */
public boolean hasElapsedRealtimeNanos() {
- return (mElapsedRealtimeFlags & ELAPSED_REALTIME_HAS_TIMESTAMP_NS) != 0;
+ return (mElapsedRealtimeFlags & HAS_TIMESTAMP_NS) != 0;
}
/** Returns true if {@link #getElapsedRealtimeUncertaintyNanos()} is available. */
public boolean hasElapsedRealtimeUncertaintyNanos() {
- return (mElapsedRealtimeFlags & ELAPSED_REALTIME_HAS_TIME_UNCERTAINTY_NS) != 0;
+ return (mElapsedRealtimeFlags & HAS_TIME_UNCERTAINTY_NS) != 0;
}
/**
diff --git a/services/core/java/com/android/server/locksettings/OWNERS b/services/core/java/com/android/server/locksettings/OWNERS
new file mode 100644
index 0000000..dad6e39
--- /dev/null
+++ b/services/core/java/com/android/server/locksettings/OWNERS
@@ -0,0 +1,2 @@
+jaggies@google.com
+kchyn@google.com
diff --git a/services/core/java/com/android/server/media/BluetoothRouteProvider.java b/services/core/java/com/android/server/media/BluetoothRouteProvider.java
index 0b3cdae..7afa81a 100644
--- a/services/core/java/com/android/server/media/BluetoothRouteProvider.java
+++ b/services/core/java/com/android/server/media/BluetoothRouteProvider.java
@@ -165,11 +165,13 @@
private void buildBluetoothRoutes() {
mBluetoothRoutes.clear();
- for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
- if (device.isConnected()) {
- BluetoothRouteInfo newBtRoute = createBluetoothRoute(device);
- if (newBtRoute.connectedProfiles.size() > 0) {
- mBluetoothRoutes.put(device.getAddress(), newBtRoute);
+ if (mBluetoothAdapter.getBondedDevices() != null) {
+ for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
+ if (device.isConnected()) {
+ BluetoothRouteInfo newBtRoute = createBluetoothRoute(device);
+ if (newBtRoute.connectedProfiles.size() > 0) {
+ mBluetoothRoutes.put(device.getAddress(), newBtRoute);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/media/MediaRoute2Provider.java b/services/core/java/com/android/server/media/MediaRoute2Provider.java
index f882c57..edc9d7c 100644
--- a/services/core/java/com/android/server/media/MediaRoute2Provider.java
+++ b/services/core/java/com/android/server/media/MediaRoute2Provider.java
@@ -77,7 +77,7 @@
@NonNull
public List<RoutingSessionInfo> getSessionInfos() {
synchronized (mLock) {
- return mSessionInfos;
+ return new ArrayList<>(mSessionInfos);
}
}
diff --git a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
index 85af346..ab38dca 100644
--- a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
+++ b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
@@ -108,8 +108,8 @@
mLastDiscoveryPreference = discoveryPreference;
if (mConnectionReady) {
mActiveConnection.updateDiscoveryPreference(discoveryPreference);
- updateBinding();
}
+ updateBinding();
}
@Override
@@ -205,9 +205,11 @@
}
private boolean shouldBind() {
- //TODO: Binding could be delayed until it's necessary.
if (mRunning) {
- return true;
+ // Bind when there is a discovery preference or an active route session.
+ return (mLastDiscoveryPreference != null
+ && !mLastDiscoveryPreference.getPreferredFeatures().isEmpty())
+ || !getSessionInfos().isEmpty();
}
return false;
}
diff --git a/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java b/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
index 1114fe0..31edf43 100644
--- a/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
+++ b/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
@@ -16,6 +16,7 @@
package com.android.server.media;
+import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
import static android.media.MediaRoute2ProviderService.REASON_UNKNOWN_ERROR;
import static android.media.MediaRouter2Utils.getOriginalId;
import static android.media.MediaRouter2Utils.getProviderId;
@@ -73,10 +74,12 @@
// TODO: (In Android S or later) if we add callback methods for generic failures
// in MediaRouter2, remove this constant and replace the usages with the real request IDs.
private static final long DUMMY_REQUEST_ID = -1;
+ private static final int PACKAGE_IMPORTANCE_FOR_DISCOVERY = IMPORTANCE_FOREGROUND;
private final Context mContext;
private final Object mLock = new Object();
final AtomicInteger mNextRouterOrManagerId = new AtomicInteger(1);
+ final ActivityManager mActivityManager;
@GuardedBy("mLock")
private final SparseArray<UserRecord> mUserRecords = new SparseArray<>();
@@ -87,8 +90,21 @@
@GuardedBy("mLock")
private int mCurrentUserId = -1;
+ private final ActivityManager.OnUidImportanceListener mOnUidImportanceListener =
+ (uid, importance) -> {
+ synchronized (mLock) {
+ final int count = mUserRecords.size();
+ for (int i = 0; i < count; i++) {
+ mUserRecords.valueAt(i).mHandler.maybeUpdateDiscoveryPreferenceForUid(uid);
+ }
+ }
+ };
+
MediaRouter2ServiceImpl(Context context) {
mContext = context;
+ mActivityManager = mContext.getSystemService(ActivityManager.class);
+ mActivityManager.addOnUidImportanceListener(mOnUidImportanceListener,
+ PACKAGE_IMPORTANCE_FOR_DISCOVERY);
}
////////////////////////////////////////////////////////////////
@@ -388,6 +404,30 @@
}
}
+ public void startScan(IMediaRouter2Manager manager) {
+ Objects.requireNonNull(manager, "manager must not be null");
+ final long token = Binder.clearCallingIdentity();
+ try {
+ synchronized (mLock) {
+ startScanLocked(manager);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
+ public void stopScan(IMediaRouter2Manager manager) {
+ Objects.requireNonNull(manager, "manager must not be null");
+ final long token = Binder.clearCallingIdentity();
+ try {
+ synchronized (mLock) {
+ stopScanLocked(manager);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
public void setRouteVolumeWithManager(IMediaRouter2Manager manager, int requestId,
MediaRoute2Info route, int volume) {
Objects.requireNonNull(manager, "manager must not be null");
@@ -839,6 +879,24 @@
disposeUserIfNeededLocked(userRecord); // since manager removed from user
}
+ private void startScanLocked(@NonNull IMediaRouter2Manager manager) {
+ final IBinder binder = manager.asBinder();
+ ManagerRecord managerRecord = mAllManagerRecords.get(binder);
+ if (managerRecord == null) {
+ return;
+ }
+ managerRecord.startScan();
+ }
+
+ private void stopScanLocked(@NonNull IMediaRouter2Manager manager) {
+ final IBinder binder = manager.asBinder();
+ ManagerRecord managerRecord = mAllManagerRecords.get(binder);
+ if (managerRecord == null) {
+ return;
+ }
+ managerRecord.stopScan();
+ }
+
private void setRouteVolumeWithManagerLocked(int requestId,
@NonNull IMediaRouter2Manager manager,
@NonNull MediaRoute2Info route, int volume) {
@@ -1122,6 +1180,7 @@
public final String mPackageName;
public final int mManagerId;
public SessionCreationRequest mLastSessionCreationRequest;
+ public boolean mIsScanning;
ManagerRecord(UserRecord userRecord, IMediaRouter2Manager manager,
int uid, int pid, String packageName) {
@@ -1146,6 +1205,24 @@
pw.println(prefix + this);
}
+ public void startScan() {
+ if (mIsScanning) {
+ return;
+ }
+ mIsScanning = true;
+ mUserRecord.mHandler.sendMessage(PooledLambda.obtainMessage(
+ UserHandler::updateDiscoveryPreferenceOnHandler, mUserRecord.mHandler));
+ }
+
+ public void stopScan() {
+ if (!mIsScanning) {
+ return;
+ }
+ mIsScanning = false;
+ mUserRecord.mHandler.sendMessage(PooledLambda.obtainMessage(
+ UserHandler::updateDiscoveryPreferenceOnHandler, mUserRecord.mHandler));
+ }
+
@Override
public String toString() {
return "Manager " + mPackageName + " (pid " + mPid + ")";
@@ -1262,6 +1339,24 @@
return null;
}
+ public void maybeUpdateDiscoveryPreferenceForUid(int uid) {
+ MediaRouter2ServiceImpl service = mServiceRef.get();
+ if (service == null) {
+ return;
+ }
+ boolean isUidRelevant;
+ synchronized (service.mLock) {
+ isUidRelevant = mUserRecord.mRouterRecords.stream().anyMatch(
+ router -> router.mUid == uid)
+ | mUserRecord.mManagerRecords.stream().anyMatch(
+ manager -> manager.mUid == uid);
+ }
+ if (isUidRelevant) {
+ sendMessage(PooledLambda.obtainMessage(
+ UserHandler::updateDiscoveryPreferenceOnHandler, this));
+ }
+ }
+
private void onProviderStateChangedOnHandler(@NonNull MediaRoute2Provider provider) {
int providerInfoIndex = getLastProviderInfoIndex(provider.getUniqueId());
MediaRoute2ProviderInfo currentInfo = provider.getProviderInfo();
@@ -1767,6 +1862,16 @@
return managers;
}
+ private List<RouterRecord> getRouterRecords() {
+ MediaRouter2ServiceImpl service = mServiceRef.get();
+ if (service == null) {
+ return Collections.emptyList();
+ }
+ synchronized (service.mLock) {
+ return new ArrayList<>(mUserRecord.mRouterRecords);
+ }
+ }
+
private List<ManagerRecord> getManagerRecords() {
MediaRouter2ServiceImpl service = mServiceRef.get();
if (service == null) {
@@ -2001,13 +2106,28 @@
return;
}
List<RouteDiscoveryPreference> discoveryPreferences = new ArrayList<>();
- synchronized (service.mLock) {
- for (RouterRecord routerRecord : mUserRecord.mRouterRecords) {
+ List<RouterRecord> routerRecords = getRouterRecords();
+ List<ManagerRecord> managerRecords = getManagerRecords();
+ boolean isAnyManagerScanning =
+ managerRecords.stream().anyMatch(manager -> manager.mIsScanning
+ && service.mActivityManager.getPackageImportance(manager.mPackageName)
+ <= PACKAGE_IMPORTANCE_FOR_DISCOVERY);
+
+ for (RouterRecord routerRecord : routerRecords) {
+ if (isAnyManagerScanning
+ || service.mActivityManager.getPackageImportance(routerRecord.mPackageName)
+ <= PACKAGE_IMPORTANCE_FOR_DISCOVERY) {
discoveryPreferences.add(routerRecord.mDiscoveryPreference);
}
- mUserRecord.mCompositeDiscoveryPreference =
- new RouteDiscoveryPreference.Builder(discoveryPreferences)
- .build();
+ }
+
+ synchronized (service.mLock) {
+ RouteDiscoveryPreference newPreference =
+ new RouteDiscoveryPreference.Builder(discoveryPreferences).build();
+ if (newPreference.equals(mUserRecord.mCompositeDiscoveryPreference)) {
+ return;
+ }
+ mUserRecord.mCompositeDiscoveryPreference = newPreference;
}
for (MediaRoute2Provider provider : mRouteProviders) {
provider.updateDiscoveryPreference(mUserRecord.mCompositeDiscoveryPreference);
diff --git a/services/core/java/com/android/server/media/MediaRouterService.java b/services/core/java/com/android/server/media/MediaRouterService.java
index 0e52a67..b6d6cc4 100644
--- a/services/core/java/com/android/server/media/MediaRouterService.java
+++ b/services/core/java/com/android/server/media/MediaRouterService.java
@@ -544,6 +544,18 @@
// Binder call
@Override
+ public void startScan(IMediaRouter2Manager manager) {
+ mService2.startScan(manager);
+ }
+
+ // Binder call
+ @Override
+ public void stopScan(IMediaRouter2Manager manager) {
+ mService2.stopScan(manager);
+ }
+
+ // Binder call
+ @Override
public void setRouteVolumeWithManager(IMediaRouter2Manager manager, int requestId,
MediaRoute2Info route, int volume) {
mService2.setRouteVolumeWithManager(manager, requestId, route, volume);
diff --git a/services/core/java/com/android/server/net/IpConfigStore.java b/services/core/java/com/android/server/net/IpConfigStore.java
index f0bf5c0..9c5abd4 100644
--- a/services/core/java/com/android/server/net/IpConfigStore.java
+++ b/services/core/java/com/android/server/net/IpConfigStore.java
@@ -16,11 +16,11 @@
package com.android.server.net;
+import android.net.InetAddresses;
import android.net.IpConfiguration;
import android.net.IpConfiguration.IpAssignment;
import android.net.IpConfiguration.ProxySettings;
import android.net.LinkAddress;
-import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.RouteInfo;
import android.net.StaticIpConfiguration;
@@ -284,8 +284,10 @@
} else if (key.equals(IP_ASSIGNMENT_KEY)) {
ipAssignment = IpAssignment.valueOf(in.readUTF());
} else if (key.equals(LINK_ADDRESS_KEY)) {
- LinkAddress linkAddr = new LinkAddress(
- NetworkUtils.numericToInetAddress(in.readUTF()), in.readInt());
+ LinkAddress linkAddr =
+ new LinkAddress(
+ InetAddresses.parseNumericAddress(in.readUTF()),
+ in.readInt());
if (linkAddr.getAddress() instanceof Inet4Address &&
staticIpConfiguration.ipAddress == null) {
staticIpConfiguration.ipAddress = linkAddr;
@@ -297,7 +299,7 @@
InetAddress gateway = null;
if (version == 1) {
// only supported default gateways - leave the dest/prefix empty
- gateway = NetworkUtils.numericToInetAddress(in.readUTF());
+ gateway = InetAddresses.parseNumericAddress(in.readUTF());
if (staticIpConfiguration.gateway == null) {
staticIpConfiguration.gateway = gateway;
} else {
@@ -305,12 +307,13 @@
}
} else {
if (in.readInt() == 1) {
- dest = new LinkAddress(
- NetworkUtils.numericToInetAddress(in.readUTF()),
- in.readInt());
+ dest =
+ new LinkAddress(
+ InetAddresses.parseNumericAddress(in.readUTF()),
+ in.readInt());
}
if (in.readInt() == 1) {
- gateway = NetworkUtils.numericToInetAddress(in.readUTF());
+ gateway = InetAddresses.parseNumericAddress(in.readUTF());
}
RouteInfo route = new RouteInfo(dest, gateway);
if (route.isIPv4Default() &&
@@ -322,7 +325,7 @@
}
} else if (key.equals(DNS_KEY)) {
staticIpConfiguration.dnsServers.add(
- NetworkUtils.numericToInetAddress(in.readUTF()));
+ InetAddresses.parseNumericAddress(in.readUTF()));
} else if (key.equals(PROXY_SETTINGS_KEY)) {
proxySettings = ProxySettings.valueOf(in.readUTF());
} else if (key.equals(PROXY_HOST_KEY)) {
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index a44ddcb..5f8b31a 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -230,7 +230,6 @@
import com.android.internal.util.CollectionUtils;
import com.android.internal.util.ConcurrentUtils;
import com.android.internal.util.DumpUtils;
-import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.StatLogger;
import com.android.internal.util.XmlUtils;
@@ -243,9 +242,7 @@
import libcore.io.IoUtils;
-import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlSerializer;
import java.io.File;
import java.io.FileDescriptor;
@@ -256,7 +253,6 @@
import java.io.PrintWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.nio.charset.StandardCharsets;
import java.time.Clock;
import java.time.Instant;
import java.time.ZoneId;
@@ -271,6 +267,7 @@
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import java.util.function.IntConsumer;
/**
* Service that maintains low-level network policy rules, using
@@ -4034,7 +4031,8 @@
try {
updateRulesForDeviceIdleUL();
updateRulesForPowerSaveUL();
- updateRulesForAllAppsUL(TYPE_RESTRICT_POWER);
+ forEachUid("updateRulesForRestrictPower",
+ uid -> updateRulesForPowerRestrictionsUL(uid));
} finally {
Trace.traceEnd(Trace.TRACE_TAG_NETWORK);
}
@@ -4044,31 +4042,19 @@
private void updateRulesForRestrictBackgroundUL() {
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRulesForRestrictBackgroundUL");
try {
- updateRulesForAllAppsUL(TYPE_RESTRICT_BACKGROUND);
+ forEachUid("updateRulesForRestrictBackground",
+ uid -> updateRulesForDataUsageRestrictionsUL(uid));
} finally {
Trace.traceEnd(Trace.TRACE_TAG_NETWORK);
}
}
- private static final int TYPE_RESTRICT_BACKGROUND = 1;
- private static final int TYPE_RESTRICT_POWER = 2;
- @Retention(RetentionPolicy.SOURCE)
- @IntDef(flag = false, value = {
- TYPE_RESTRICT_BACKGROUND,
- TYPE_RESTRICT_POWER,
- })
- public @interface RestrictType {
- }
-
- // TODO: refactor / consolidate all those updateXyz methods, there are way too many of them...
- @GuardedBy("mUidRulesFirstLock")
- private void updateRulesForAllAppsUL(@RestrictType int type) {
+ private void forEachUid(String tag, IntConsumer consumer) {
if (Trace.isTagEnabled(Trace.TRACE_TAG_NETWORK)) {
- Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRulesForRestrictPowerUL-" + type);
+ Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "forEachUid-" + tag);
}
try {
// update rules for all installed applications
-
final PackageManager pm = mContext.getPackageManager();
final List<UserInfo> users;
final List<ApplicationInfo> apps;
@@ -4096,16 +4082,7 @@
for (int j = 0; j < appsSize; j++) {
final ApplicationInfo app = apps.get(j);
final int uid = UserHandle.getUid(user.id, app.uid);
- switch (type) {
- case TYPE_RESTRICT_BACKGROUND:
- updateRulesForDataUsageRestrictionsUL(uid);
- break;
- case TYPE_RESTRICT_POWER:
- updateRulesForPowerRestrictionsUL(uid);
- break;
- default:
- Slog.w(TAG, "Invalid type for updateRulesForAllApps: " + type);
- }
+ consumer.accept(uid);
}
}
} finally {
diff --git a/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java b/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java
index c1deb96..b9984a5 100644
--- a/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java
+++ b/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java
@@ -293,9 +293,7 @@
.appendPath(file.getAbsolutePath()).build())
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
.putExtra(EXTRA_KEY, file.getAbsolutePath()),
- // TODO(b/174161800) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, deletionTime, pi);
}
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 692e97a..525fca0 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -242,7 +242,6 @@
import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.compat.IPlatformCompat;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
import com.android.internal.logging.InstanceId;
import com.android.internal.logging.InstanceIdSequence;
@@ -468,7 +467,6 @@
private UriGrantsManagerInternal mUgmInternal;
private RoleObserver mRoleObserver;
private UserManager mUm;
- private IPlatformCompat mPlatformCompat;
private ShortcutHelper mShortcutHelper;
final IBinder mForegroundToken = new Binder();
@@ -1987,8 +1985,6 @@
mDeviceIdleManager = getContext().getSystemService(DeviceIdleManager.class);
mDpm = dpm;
mUm = userManager;
- mPlatformCompat = IPlatformCompat.Stub.asInterface(
- ServiceManager.getService(Context.PLATFORM_COMPAT_SERVICE));
mUiHandler = new Handler(UiThread.get().getLooper());
String[] extractorNames;
@@ -2886,16 +2882,16 @@
return userId == UserHandle.USER_ALL ? UserHandle.USER_SYSTEM : userId;
}
- private ToastRecord getToastRecord(int uid, int pid, String packageName, IBinder token,
- @Nullable CharSequence text, @Nullable ITransientNotification callback, int duration,
- Binder windowToken, int displayId,
+ private ToastRecord getToastRecord(int uid, int pid, String packageName, boolean isSystemToast,
+ IBinder token, @Nullable CharSequence text, @Nullable ITransientNotification callback,
+ int duration, Binder windowToken, int displayId,
@Nullable ITransientNotificationCallback textCallback) {
if (callback == null) {
- return new TextToastRecord(this, mStatusBar, uid, pid, packageName, token, text,
- duration, windowToken, displayId, textCallback);
+ return new TextToastRecord(this, mStatusBar, uid, pid, packageName,
+ isSystemToast, token, text, duration, windowToken, displayId, textCallback);
} else {
- return new CustomToastRecord(this, uid, pid, packageName, token, callback, duration,
- windowToken, displayId);
+ return new CustomToastRecord(this, uid, pid, packageName,
+ isSystemToast, token, callback, duration, windowToken, displayId);
}
}
@@ -2966,31 +2962,10 @@
}
boolean isAppRenderedToast = (callback != null);
- if (isAppRenderedToast && !isSystemToast && !isPackageInForegroundForToast(pkg,
- callingUid)) {
- boolean block;
- final long id = Binder.clearCallingIdentity();
- try {
- // CHANGE_BACKGROUND_CUSTOM_TOAST_BLOCK is gated on targetSdk, so block will be
- // false for apps with targetSdk < R. For apps with targetSdk R+, text toasts
- // are not app-rendered, so isAppRenderedToast == true means it's a custom
- // toast.
- block = mPlatformCompat.isChangeEnabledByPackageName(
- CHANGE_BACKGROUND_CUSTOM_TOAST_BLOCK, pkg,
- callingUser.getIdentifier());
- } catch (RemoteException e) {
- // Shouldn't happen have since it's a local local
- Slog.e(TAG, "Unexpected exception while checking block background custom toasts"
- + " change", e);
- block = false;
- } finally {
- Binder.restoreCallingIdentity(id);
- }
- if (block) {
- Slog.w(TAG, "Blocking custom toast from package " + pkg
- + " due to package not in the foreground");
- return;
- }
+ if (blockToast(callingUid, isSystemToast, isAppRenderedToast)) {
+ Slog.w(TAG, "Blocking custom toast from package " + pkg
+ + " due to package not in the foreground at time the toast was posted");
+ return;
}
synchronized (mToastQueue) {
@@ -3023,8 +2998,8 @@
Binder windowToken = new Binder();
mWindowManagerInternal.addWindowToken(windowToken, TYPE_TOAST, displayId);
- record = getToastRecord(callingUid, callingPid, pkg, token, text, callback,
- duration, windowToken, displayId, textCallback);
+ record = getToastRecord(callingUid, callingPid, pkg, isSystemToast, token,
+ text, callback, duration, windowToken, displayId, textCallback);
mToastQueue.add(record);
index = mToastQueue.size() - 1;
keepProcessAliveForToastIfNeededLocked(callingPid);
@@ -3042,28 +3017,6 @@
}
}
- /**
- * Implementation note: Our definition of foreground for toasts is an implementation matter
- * and should strike a balance between functionality and anti-abuse effectiveness. We
- * currently worry about the following cases:
- * <ol>
- * <li>App with fullscreen activity: Allow toasts
- * <li>App behind translucent activity from other app: Block toasts
- * <li>App in multi-window: Allow toasts
- * <li>App with expanded bubble: Allow toasts
- * <li>App posting toasts on onCreate(), onStart(), onResume(): Allow toasts
- * <li>App posting toasts on onPause(), onStop(), onDestroy(): Block toasts
- * </ol>
- * Checking if the UID has any resumed activities satisfy use-cases above.
- *
- * <p>Checking if {@code mActivityManager.getUidImportance(callingUid) ==
- * IMPORTANCE_FOREGROUND} does not work because it considers the app in foreground if it has
- * any visible activities, failing case 2 in list above.
- */
- private boolean isPackageInForegroundForToast(String pkg, int callingUid) {
- return mAtm.hasResumedActivity(callingUid);
- }
-
@Override
public void cancelToast(String pkg, IBinder token) {
Slog.i(TAG, "cancelToast pkg=" + pkg + " token=" + token);
@@ -7388,17 +7341,16 @@
CompatChanges.isChangeEnabled(RATE_LIMIT_TOASTS, record.uid);
boolean isWithinQuota =
mToastRateLimiter.isWithinQuota(userId, record.pkg, TOAST_QUOTA_TAG);
- if ((!rateLimitingEnabled || isWithinQuota) && record.show()) {
+
+ if (tryShowToast(record, rateLimitingEnabled, isWithinQuota)) {
scheduleDurationReachedLocked(record);
mIsCurrentToastShown = true;
if (rateLimitingEnabled) {
mToastRateLimiter.noteEvent(userId, record.pkg, TOAST_QUOTA_TAG);
}
return;
- } else if (rateLimitingEnabled && !isWithinQuota) {
- Slog.w(TAG, "Package " + record.pkg + " is above allowed toast quota, the "
- + "following toast was blocked and discarded: " + record);
}
+
int index = mToastQueue.indexOf(record);
if (index >= 0) {
mToastQueue.remove(index);
@@ -7407,6 +7359,22 @@
}
}
+ /** Returns true if it successfully showed the toast. */
+ private boolean tryShowToast(ToastRecord record, boolean rateLimitingEnabled,
+ boolean isWithinQuota) {
+ if (rateLimitingEnabled && !isWithinQuota) {
+ Slog.w(TAG, "Package " + record.pkg + " is above allowed toast quota, the "
+ + "following toast was blocked and discarded: " + record);
+ return false;
+ }
+ if (blockToast(record.uid, record.isSystemToast, record.isAppRendered())) {
+ Slog.w(TAG, "Blocking custom toast from package " + record.pkg
+ + " due to package not in the foreground at the time of showing the toast");
+ return false;
+ }
+ return record.show();
+ }
+
@GuardedBy("mToastQueue")
void cancelToastLocked(int index) {
ToastRecord record = mToastQueue.get(index);
@@ -7526,6 +7494,44 @@
}
}
+ /**
+ * Implementation note: Our definition of foreground for toasts is an implementation matter
+ * and should strike a balance between functionality and anti-abuse effectiveness. We
+ * currently worry about the following cases:
+ * <ol>
+ * <li>App with fullscreen activity: Allow toasts
+ * <li>App behind translucent activity from other app: Block toasts
+ * <li>App in multi-window: Allow toasts
+ * <li>App with expanded bubble: Allow toasts
+ * <li>App posting toasts on onCreate(), onStart(), onResume(): Allow toasts
+ * <li>App posting toasts on onPause(), onStop(), onDestroy(): Block toasts
+ * </ol>
+ * Checking if the UID has any resumed activities satisfy use-cases above.
+ *
+ * <p>Checking if {@code mActivityManager.getUidImportance(callingUid) ==
+ * IMPORTANCE_FOREGROUND} does not work because it considers the app in foreground if it has
+ * any visible activities, failing case 2 in list above.
+ */
+ private boolean isPackageInForegroundForToast(int callingUid) {
+ return mAtm.hasResumedActivity(callingUid);
+ }
+
+ /**
+ * True if the toast should be blocked. It will return true if all of the following conditions
+ * apply: it's a custom toast, it's not a system toast, the package that sent the toast is in
+ * the background and CHANGE_BACKGROUND_CUSTOM_TOAST_BLOCK is enabled.
+ *
+ * CHANGE_BACKGROUND_CUSTOM_TOAST_BLOCK is gated on targetSdk, so it will return false for apps
+ * with targetSdk < R. For apps with targetSdk R+, text toasts are not app-rendered, so
+ * isAppRenderedToast == true means it's a custom toast.
+ */
+ private boolean blockToast(int uid, boolean isSystemToast, boolean isAppRenderedToast) {
+ return isAppRenderedToast
+ && !isSystemToast
+ && !isPackageInForegroundForToast(uid)
+ && CompatChanges.isChangeEnabled(CHANGE_BACKGROUND_CUSTOM_TOAST_BLOCK, uid);
+ }
+
private void handleRankingReconsideration(Message message) {
if (!(message.obj instanceof RankingReconsideration)) return;
RankingReconsideration recon = (RankingReconsideration) message.obj;
@@ -9180,7 +9186,16 @@
@Override
protected void readExtraAttributes(String tag, TypedXmlPullParser parser, int userId)
throws IOException {
- boolean userSet = parser.getAttributeBoolean(null, ATT_USER_SET, false);
+ // TODO: this logic looks broken, since it's trying to convert a
+ // list into a boolean; for now we preserve the old parsing behavior
+ // to avoid a performance regression, but someone should investigate
+ final String value = parser.getAttributeValue(null, ATT_USER_SET);
+ final boolean userSet;
+ if (TextUtils.isEmpty(value)) {
+ userSet = false;
+ } else {
+ userSet = Boolean.parseBoolean(value);
+ }
setUserSet(userId, userSet);
}
diff --git a/services/core/java/com/android/server/notification/SnoozeHelper.java b/services/core/java/com/android/server/notification/SnoozeHelper.java
index 3e197fb..f078242 100644
--- a/services/core/java/com/android/server/notification/SnoozeHelper.java
+++ b/services/core/java/com/android/server/notification/SnoozeHelper.java
@@ -462,8 +462,6 @@
}
private PendingIntent createPendingIntent(String pkg, String key, int userId) {
- // TODO(b/174969959) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
return PendingIntent.getBroadcast(mContext,
REQUEST_CODE_REPOST,
new Intent(REPOST_ACTION)
@@ -471,7 +469,7 @@
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
.putExtra(EXTRA_KEY, key)
.putExtra(EXTRA_USER_ID, userId),
- PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
public void scheduleRepostsForPersistedNotifications(long currentTime) {
diff --git a/services/core/java/com/android/server/notification/toast/CustomToastRecord.java b/services/core/java/com/android/server/notification/toast/CustomToastRecord.java
index 17e0b39..30378ac 100644
--- a/services/core/java/com/android/server/notification/toast/CustomToastRecord.java
+++ b/services/core/java/com/android/server/notification/toast/CustomToastRecord.java
@@ -37,9 +37,10 @@
public final ITransientNotification callback;
public CustomToastRecord(NotificationManagerService notificationManager, int uid, int pid,
- String packageName, IBinder token, ITransientNotification callback, int duration,
- Binder windowToken, int displayId) {
- super(notificationManager, uid, pid, packageName, token, duration, windowToken, displayId);
+ String packageName, boolean isSystemToast, IBinder token,
+ ITransientNotification callback, int duration, Binder windowToken, int displayId) {
+ super(notificationManager, uid, pid, packageName, isSystemToast, token, duration,
+ windowToken, displayId);
this.callback = checkNotNull(callback);
}
@@ -78,10 +79,16 @@
}
@Override
+ public boolean isAppRendered() {
+ return true;
+ }
+
+ @Override
public String toString() {
return "CustomToastRecord{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + pid + ":" + pkg + "/" + UserHandle.formatUid(uid)
+ + " isSystemToast=" + isSystemToast
+ " token=" + token
+ " callback=" + callback
+ " duration=" + getDuration()
diff --git a/services/core/java/com/android/server/notification/toast/TextToastRecord.java b/services/core/java/com/android/server/notification/toast/TextToastRecord.java
index 544520e..7b36db2 100644
--- a/services/core/java/com/android/server/notification/toast/TextToastRecord.java
+++ b/services/core/java/com/android/server/notification/toast/TextToastRecord.java
@@ -43,9 +43,11 @@
public TextToastRecord(NotificationManagerService notificationManager,
@Nullable StatusBarManagerInternal statusBarManager, int uid, int pid,
- String packageName, IBinder token, CharSequence text, int duration, Binder windowToken,
- int displayId, @Nullable ITransientNotificationCallback callback) {
- super(notificationManager, uid, pid, packageName, token, duration, windowToken, displayId);
+ String packageName, boolean isSystemToast, IBinder token, CharSequence text,
+ int duration, Binder windowToken, int displayId,
+ @Nullable ITransientNotificationCallback callback) {
+ super(notificationManager, uid, pid, packageName, isSystemToast, token, duration,
+ windowToken, displayId);
mStatusBar = statusBarManager;
mCallback = callback;
this.text = checkNotNull(text);
@@ -73,10 +75,16 @@
}
@Override
+ public boolean isAppRendered() {
+ return false;
+ }
+
+ @Override
public String toString() {
return "TextToastRecord{"
+ Integer.toHexString(System.identityHashCode(this))
+ " " + pid + ":" + pkg + "/" + UserHandle.formatUid(uid)
+ + " isSystemToast=" + isSystemToast
+ " token=" + token
+ " text=" + text
+ " duration=" + getDuration()
diff --git a/services/core/java/com/android/server/notification/toast/ToastRecord.java b/services/core/java/com/android/server/notification/toast/ToastRecord.java
index 33906cc..1d5fc27 100644
--- a/services/core/java/com/android/server/notification/toast/ToastRecord.java
+++ b/services/core/java/com/android/server/notification/toast/ToastRecord.java
@@ -31,6 +31,7 @@
public final int uid;
public final int pid;
public final String pkg;
+ public final boolean isSystemToast;
public final IBinder token;
public final int displayId;
public final Binder windowToken;
@@ -38,11 +39,13 @@
private int mDuration;
protected ToastRecord(NotificationManagerService notificationManager, int uid, int pid,
- String pkg, IBinder token, int duration, Binder windowToken, int displayId) {
+ String pkg, boolean isSystemToast, IBinder token, int duration, Binder windowToken,
+ int displayId) {
this.mNotificationManager = notificationManager;
this.uid = uid;
this.pid = pid;
this.pkg = pkg;
+ this.isSystemToast = isSystemToast;
this.token = token;
this.windowToken = windowToken;
this.displayId = displayId;
@@ -95,4 +98,10 @@
// should override this method.
return false;
}
+
+ /**
+ * Returns true if the app is responsible for rendering the toast, false otherwise (for example,
+ * if it's rendered by the system).
+ */
+ public abstract boolean isAppRendered();
}
diff --git a/services/core/java/com/android/server/om/OWNERS b/services/core/java/com/android/server/om/OWNERS
new file mode 100644
index 0000000..afb98d4
--- /dev/null
+++ b/services/core/java/com/android/server/om/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/content/om/OWNERS
diff --git a/services/core/java/com/android/server/people/OWNERS b/services/core/java/com/android/server/people/OWNERS
new file mode 100644
index 0000000..3198a5e
--- /dev/null
+++ b/services/core/java/com/android/server/people/OWNERS
@@ -0,0 +1 @@
+include /services/people/OWNERS
diff --git a/services/core/java/com/android/server/pm/OWNERS b/services/core/java/com/android/server/pm/OWNERS
index cca2b83..004259b 100644
--- a/services/core/java/com/android/server/pm/OWNERS
+++ b/services/core/java/com/android/server/pm/OWNERS
@@ -30,9 +30,10 @@
per-file CrossProfileAppsService.java = omakoto@google.com, yamasani@google.com
per-file CrossProfileIntentFilter.java = omakoto@google.com, yamasani@google.com
per-file CrossProfileIntentResolver.java = omakoto@google.com, yamasani@google.com
+per-file RestrictionsSet.java = bookatz@google.com, omakoto@google.com, yamasani@google.com, rubinxu@google.com, sandness@google.com
+per-file UserManagerInternal.java = bookatz@google.com, omakoto@google.com, yamasani@google.com
per-file UserManagerService.java = bookatz@google.com, omakoto@google.com, yamasani@google.com
per-file UserRestrictionsUtils.java = omakoto@google.com, rubinxu@google.com, sandness@google.com, yamasani@google.com
-per-file RestrictionsSet.java = bookatz@google.com, omakoto@google.com, yamasani@google.com, rubinxu@google.com, sandness@google.com
per-file UserSystemPackageInstaller.java = bookatz@google.com, omakoto@google.com, yamasani@google.com
per-file UserTypeDetails.java = bookatz@google.com, omakoto@google.com, yamasani@google.com
per-file UserTypeFactory.java = bookatz@google.com, omakoto@google.com, yamasani@google.com
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index 34bee95..9f8f6e44 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -532,6 +532,20 @@
+ "to use a data loader");
}
+ // INSTALL_REASON_ROLLBACK allows an app to be rolled back without requiring the ROLLBACK
+ // capability; ensure if this is set as the install reason the app has one of the necessary
+ // signature permissions to perform the rollback.
+ if (params.installReason == PackageManager.INSTALL_REASON_ROLLBACK) {
+ if (mContext.checkCallingOrSelfPermission(Manifest.permission.MANAGE_ROLLBACKS)
+ != PackageManager.PERMISSION_GRANTED &&
+ mContext.checkCallingOrSelfPermission(Manifest.permission.TEST_MANAGE_ROLLBACKS)
+ != PackageManager.PERMISSION_GRANTED) {
+ throw new SecurityException(
+ "INSTALL_REASON_ROLLBACK requires the MANAGE_ROLLBACKS permission or the "
+ + "TEST_MANAGE_ROLLBACKS permission");
+ }
+ }
+
// App package name and label length is restricted so that really long strings aren't
// written to disk.
if (params.appPackageName != null
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 72dad61..d14baf5 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -24,6 +24,7 @@
import static android.app.AppOpsManager.MODE_DEFAULT;
import static android.app.AppOpsManager.MODE_IGNORED;
import static android.content.Intent.ACTION_MAIN;
+import static android.content.Intent.CATEGORY_BROWSABLE;
import static android.content.Intent.CATEGORY_DEFAULT;
import static android.content.Intent.CATEGORY_HOME;
import static android.content.Intent.EXTRA_LONG_VERSION_CODE;
@@ -238,6 +239,7 @@
import android.content.pm.dex.ArtManager;
import android.content.pm.dex.DexMetadataHelper;
import android.content.pm.dex.IArtManager;
+import android.content.pm.parsing.ApkLiteParseUtils;
import android.content.pm.parsing.ParsingPackageUtils;
import android.content.pm.parsing.component.ParsedActivity;
import android.content.pm.parsing.component.ParsedInstrumentation;
@@ -248,6 +250,8 @@
import android.content.pm.parsing.component.ParsedProcess;
import android.content.pm.parsing.component.ParsedProvider;
import android.content.pm.parsing.component.ParsedService;
+import android.content.pm.parsing.result.ParseResult;
+import android.content.pm.parsing.result.ParseTypeImpl;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.Bitmap;
@@ -8003,6 +8007,13 @@
Slog.i(TAG, " + always: " + info.activityInfo.packageName
+ " : linkgen=" + linkGeneration);
}
+
+ if (!intent.hasCategory(CATEGORY_BROWSABLE)
+ || !intent.hasCategory(CATEGORY_DEFAULT)) {
+ undefinedList.add(info);
+ continue;
+ }
+
// Use link-enabled generation as preferredOrder, i.e.
// prefer newly-enabled over earlier-enabled.
info.preferredOrder = linkGeneration;
@@ -15322,7 +15333,7 @@
InstallParams(OriginInfo origin, MoveInfo move, IPackageInstallObserver2 observer,
int installFlags, InstallSource installSource, String volumeUuid,
- UserHandle user, String packageAbiOverride) {
+ UserHandle user, String packageAbiOverride, PackageLite packageLite) {
super(user);
this.origin = origin;
this.move = move;
@@ -15341,7 +15352,7 @@
this.forceQueryableOverride = false;
this.mDataLoaderType = DataLoaderType.NONE;
this.requiredInstalledVersionCode = PackageManager.VERSION_CODE_HIGHEST;
- this.mPackageLite = null;
+ this.mPackageLite = packageLite;
}
InstallParams(File stagedDir, IPackageInstallObserver2 observer,
@@ -24182,8 +24193,12 @@
final Message msg = mHandler.obtainMessage(INIT_COPY);
final OriginInfo origin = OriginInfo.fromExistingFile(codeFile);
+ final ParseTypeImpl input = ParseTypeImpl.forDefaultParsing();
+ final ParseResult<PackageLite> ret = ApkLiteParseUtils.parsePackageLite(input,
+ new File(origin.resolvedPath), /* flags */ 0);
+ final PackageLite lite = ret.isSuccess() ? ret.getResult() : null;
final InstallParams params = new InstallParams(origin, move, installObserver, installFlags,
- installSource, volumeUuid, user, packageAbiOverride);
+ installSource, volumeUuid, user, packageAbiOverride, lite);
params.setTraceMethod("movePackage").setTraceCookie(System.identityHashCode(params));
msg.obj = params;
diff --git a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
index c77eda1..d3d7c60 100644
--- a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
+++ b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
@@ -822,7 +822,7 @@
public static PackageInfoLite getMinimalPackageInfo(Context context,
PackageParser.PackageLite pkg, String packagePath, int flags, String abiOverride) {
final PackageInfoLite ret = new PackageInfoLite();
- if (packagePath == null) {
+ if (packagePath == null || pkg == null) {
Slog.i(TAG, "Invalid package file " + packagePath);
ret.recommendedInstallLocation = PackageHelper.RECOMMEND_FAILED_INVALID_APK;
return ret;
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index 318b229..2f6756d 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -27,7 +27,6 @@
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
-import android.app.role.IRoleManager;
import android.app.role.RoleManager;
import android.content.ComponentName;
import android.content.Context;
@@ -80,7 +79,6 @@
import android.os.ParcelFileDescriptor.AutoCloseInputStream;
import android.os.PersistableBundle;
import android.os.Process;
-import android.os.RemoteCallback;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
@@ -106,6 +104,7 @@
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.Preconditions;
+import com.android.server.FgThread;
import com.android.server.LocalServices;
import com.android.server.SystemConfig;
import com.android.server.pm.PackageManagerShellCommandDataLoader.Metadata;
@@ -2971,12 +2970,10 @@
final int translatedUserId =
translateUserId(userId, UserHandle.USER_NULL, "runSetHomeActivity");
final CompletableFuture<Boolean> future = new CompletableFuture<>();
- final RemoteCallback callback = new RemoteCallback(res -> future.complete(res != null));
try {
- IRoleManager roleManager = android.app.role.IRoleManager.Stub.asInterface(
- ServiceManager.getServiceOrThrow(Context.ROLE_SERVICE));
- roleManager.addRoleHolderAsUser(RoleManager.ROLE_HOME, pkgName,
- 0, translatedUserId, callback);
+ RoleManager roleManager = mContext.getSystemService(RoleManager.class);
+ roleManager.addRoleHolderAsUser(RoleManager.ROLE_HOME, pkgName, 0,
+ UserHandle.of(translatedUserId), FgThread.getExecutor(), future::complete);
boolean success = future.get();
if (success) {
pw.println("Success");
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
index 0ac0c8d..9f07695 100644
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
@@ -737,7 +737,7 @@
|| ((pinnedByCallerSet != null) && pinnedByCallerSet.contains(si.getId()));
if (!getPinnedByAnyLauncher) {
- if (si.isFloating()) {
+ if (si.isFloating() && !si.isCached()) {
if (!isPinnedByCaller) {
continue;
}
diff --git a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java
index a098484..7ca9f05 100644
--- a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java
+++ b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java
@@ -99,52 +99,6 @@
*/
void scheduleReadDefaultPermissionExceptions();
- // TODO(zhanghai): The following methods should be moved to a new AIDL to support
- // the legacy PermissionManager directly in a later CL.
-
- /**
- * Grant default permissions to currently active LUI app
- * @param packageName The package name for the LUI app
- * @param userId The user ID
- */
- void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId);
-
- /**
- * Revoke default permissions to currently active LUI app
- * @param packageNames The package names for the LUI apps
- * @param userId The user ID
- */
- void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId);
-
- /**
- * Grant default permissions to currently active Ims services
- * @param packageNames The package names for the Ims services
- * @param userId The user ID
- */
- void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId);
-
- /**
- * Grant default permissions to currently enabled telephony data services
- * @param packageNames The package name for the services
- * @param userId The user ID
- */
- void grantDefaultPermissionsToEnabledTelephonyDataServices(String[] packageNames, int userId);
-
- /**
- * Revoke default permissions to currently active telephony data services
- * @param packageNames The package name for the services
- * @param userId The IDhandle
- */
- void revokeDefaultPermissionsFromDisabledTelephonyDataServices(String[] packageNames,
- int userId);
-
- /**
- * Grant default permissions to currently enabled carrier apps
- * @param packageNames Package names of the apps to be granted permissions
- * @param userId The user ID
- */
- void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId);
-
/**
* Provider for package names.
*/
diff --git a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java
index 0c0a8df..f453d74 100644
--- a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java
@@ -17,16 +17,31 @@
package com.android.server.pm.permission;
import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.app.AppOpsManager;
+import android.app.admin.DevicePolicyManager;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.os.Binder;
+import android.os.Process;
+import android.os.ServiceManager;
+import android.os.UserHandle;
+import android.permission.ILegacyPermissionManager;
+import android.util.Log;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.server.LocalServices;
import com.android.server.pm.PackageManagerServiceUtils;
/**
* Legacy permission manager service.
*/
-public class LegacyPermissionManagerService {
+public class LegacyPermissionManagerService extends ILegacyPermissionManager.Stub {
+ private static final String TAG = "PackageManager";
+
+ /** Injector that can be used to facilitate testing. */
+ private final Injector mInjector;
+
@NonNull
private final DefaultPermissionGrantPolicy mDefaultPermissionGrantPolicy;
@@ -51,8 +66,126 @@
}
private LegacyPermissionManagerService(@NonNull Context context) {
- mDefaultPermissionGrantPolicy = new DefaultPermissionGrantPolicy(context);
+ this(context, new Injector(context));
+
LocalServices.addService(LegacyPermissionManagerInternal.class, new Internal());
+ ServiceManager.addService("legacy_permission", this);
+ }
+
+ @VisibleForTesting
+ LegacyPermissionManagerService(@NonNull Context context, @NonNull Injector injector) {
+ mInjector = injector;
+ mDefaultPermissionGrantPolicy = new DefaultPermissionGrantPolicy(context);
+ }
+
+ @Override
+ public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
+ @Nullable String callingFeatureId, int pid, int uid) {
+ // If the check is being requested by an app then only allow the app to query its own
+ // access status.
+ int callingUid = mInjector.getCallingUid();
+ int callingPid = mInjector.getCallingPid();
+ if (UserHandle.getAppId(callingUid) >= Process.FIRST_APPLICATION_UID && (callingUid != uid
+ || callingPid != pid)) {
+ String response = String.format(
+ "Calling uid %d, pid %d cannot check device identifier access for package %s "
+ + "(uid=%d, pid=%d)",
+ callingUid, callingPid, packageName, uid, pid);
+ Log.w(TAG, response);
+ throw new SecurityException(response);
+ }
+ // Allow system and root access to the device identifiers.
+ final int appId = UserHandle.getAppId(uid);
+ if (appId == Process.SYSTEM_UID || appId == Process.ROOT_UID) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ // Allow access to packages that have the READ_PRIVILEGED_PHONE_STATE permission.
+ if (mInjector.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, pid,
+ uid) == PackageManager.PERMISSION_GRANTED) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ // If the calling package is not null then perform the appop and device / profile owner
+ // check.
+ if (packageName != null) {
+ // Allow access to a package that has been granted the READ_DEVICE_IDENTIFIERS appop.
+ final long token = mInjector.clearCallingIdentity();
+ AppOpsManager appOpsManager = (AppOpsManager) mInjector.getSystemService(
+ Context.APP_OPS_SERVICE);
+ try {
+ if (appOpsManager.noteOpNoThrow(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS, uid,
+ packageName, callingFeatureId, message) == AppOpsManager.MODE_ALLOWED) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ } finally {
+ mInjector.restoreCallingIdentity(token);
+ }
+ // Check if the calling packages meets the device / profile owner requirements for
+ // identifier access.
+ DevicePolicyManager devicePolicyManager =
+ (DevicePolicyManager) mInjector.getSystemService(Context.DEVICE_POLICY_SERVICE);
+ if (devicePolicyManager != null && devicePolicyManager.hasDeviceIdentifierAccess(
+ packageName, pid, uid)) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ }
+ return PackageManager.PERMISSION_DENIED;
+ }
+
+ @Override
+ public void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantDefaultPermissionsToActiveLuiApp", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToActiveLuiApp(packageName, userId));
+ }
+
+ @Override
+ public void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "revokeDefaultPermissionsFromLuiApps", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .revokeDefaultPermissionsFromLuiApps(packageNames, userId));
+ }
+
+ @Override
+ public void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantDefaultPermissionsToEnabledImsServices", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToEnabledImsServices(packageNames, userId));
+ }
+
+ @Override
+ public void grantDefaultPermissionsToEnabledTelephonyDataServices(
+ String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantDefaultPermissionsToEnabledTelephonyDataServices", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToEnabledTelephonyDataServices(packageNames, userId));
+ }
+
+ @Override
+ public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "revokeDefaultPermissionsFromDisabledTelephonyDataServices", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .revokeDefaultPermissionsFromDisabledTelephonyDataServices(packageNames,
+ userId));
+ }
+
+ @Override
+ public void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantPermissionsToEnabledCarrierApps", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToEnabledCarrierApps(packageNames, userId));
}
private class Internal implements LegacyPermissionManagerInternal {
@@ -117,65 +250,74 @@
public void scheduleReadDefaultPermissionExceptions() {
mDefaultPermissionGrantPolicy.scheduleReadDefaultPermissionExceptions();
}
+ }
- // TODO(zhanghai): The following methods should be moved to a new AIDL to support
- // the legacy PermissionManager directly in a later CL.
+ /**
+ * Allows injection of services and method responses to facilitate testing.
+ *
+ * <p>Test classes can create a mock of this class and pass it to the PermissionManagerService
+ * constructor to control behavior of services and external methods during execution.
+ * @hide
+ */
+ @VisibleForTesting
+ public static class Injector {
+ private final Context mContext;
- @Override
- public void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantDefaultPermissionsToActiveLuiApp", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToActiveLuiApp(packageName, userId));
+ /**
+ * Public constructor that accepts a {@code context} within which to operate.
+ */
+ public Injector(@NonNull Context context) {
+ mContext = context;
}
- @Override
- public void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "revokeDefaultPermissionsFromLuiApps", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .revokeDefaultPermissionsFromLuiApps(packageNames, userId));
+ /**
+ * Returns the UID of the calling package.
+ */
+ public int getCallingUid() {
+ return Binder.getCallingUid();
}
- @Override
- public void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantDefaultPermissionsToEnabledImsServices", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToEnabledImsServices(packageNames, userId));
+ /**
+ * Returns the process ID of the calling package.
+ */
+ public int getCallingPid() {
+ return Binder.getCallingPid();
}
- @Override
- public void grantDefaultPermissionsToEnabledTelephonyDataServices(
- String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantDefaultPermissionsToEnabledTelephonyDataServices", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToEnabledTelephonyDataServices(packageNames, userId));
+ /**
+ * Checks if the package running under the specified {@code pid} and {@code uid} has been
+ * granted the provided {@code permission}.
+ *
+ * @return {@link PackageManager#PERMISSION_GRANTED} if the package has been granted the
+ * permission, {@link PackageManager#PERMISSION_DENIED} otherwise
+ */
+ public int checkPermission(@NonNull String permission, int pid, int uid) {
+ return mContext.checkPermission(permission, pid, uid);
}
- @Override
- public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "revokeDefaultPermissionsFromDisabledTelephonyDataServices", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .revokeDefaultPermissionsFromDisabledTelephonyDataServices(packageNames,
- userId));
+ /**
+ * Clears the calling identity to allow subsequent calls to be treated as coming from this
+ * package.
+ *
+ * @return a token that can be used to restore the calling identity
+ */
+ public long clearCallingIdentity() {
+ return Binder.clearCallingIdentity();
}
- @Override
- public void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantPermissionsToEnabledCarrierApps", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToEnabledCarrierApps(packageNames, userId));
+ /**
+ * Restores the calling identity to that of the calling package based on the provided
+ * {@code token}.
+ */
+ public void restoreCallingIdentity(long token) {
+ Binder.restoreCallingIdentity(token);
+ }
+
+ /**
+ * Returns the system service with the provided {@code name}.
+ */
+ public Object getSystemService(@NonNull String name) {
+ return mContext.getSystemService(name);
}
}
}
diff --git a/services/core/java/com/android/server/pm/permission/Permission.java b/services/core/java/com/android/server/pm/permission/Permission.java
index 995b59e..30c334d 100644
--- a/services/core/java/com/android/server/pm/permission/Permission.java
+++ b/services/core/java/com/android/server/pm/permission/Permission.java
@@ -61,6 +61,7 @@
PermissionInfo.PROTECTION_NORMAL,
PermissionInfo.PROTECTION_SIGNATURE,
PermissionInfo.PROTECTION_SIGNATURE_OR_SYSTEM,
+ PermissionInfo.PROTECTION_INTERNAL,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ProtectionLevel {}
@@ -246,6 +247,11 @@
== PermissionInfo.PROTECTION_SIGNATURE;
}
+ public boolean isInternal() {
+ return (mPermissionInfo.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE)
+ == PermissionInfo.PROTECTION_INTERNAL;
+ }
+
public boolean isAppOp() {
return (mPermissionInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_APPOP) != 0;
}
@@ -335,6 +341,10 @@
return (mPermissionInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_RECENTS) != 0;
}
+ public boolean isRole() {
+ return (mPermissionInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_ROLE) != 0;
+ }
+
public void transfer(@NonNull String oldPackageName, @NonNull String newPackageName) {
if (!oldPackageName.equals(mPermissionInfo.packageName)) {
return;
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index 389010a..1dbf839 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -66,9 +66,7 @@
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.AppOpsManager;
-import android.app.ApplicationPackageManager;
import android.app.IActivityManager;
-import android.app.admin.DevicePolicyManager;
import android.app.admin.DevicePolicyManagerInternal;
import android.app.role.RoleManager;
import android.compat.annotation.ChangeId;
@@ -126,7 +124,6 @@
import android.util.SparseBooleanArray;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.compat.IPlatformCompat;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -160,6 +157,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -263,9 +261,6 @@
@NonNull
private final PermissionRegistry mRegistry = new PermissionRegistry();
- /** Injector that can be used to facilitate testing. */
- private final Injector mInjector;
-
@GuardedBy("mLock")
@Nullable
private ArraySet<String> mPrivappPermissionsViolations;
@@ -363,17 +358,11 @@
};
PermissionManagerService(@NonNull Context context) {
- this(context, new Injector(context));
- }
-
- @VisibleForTesting
- PermissionManagerService(@NonNull Context context, @NonNull Injector injector) {
- mInjector = injector;
// The package info cache is the cache for package and permission information.
// Disable the package info and package permission caches locally but leave the
// checkPermission cache active.
- mInjector.invalidatePackageInfoCache();
- mInjector.disablePackageNamePermissionCache();
+ PackageManager.invalidatePackageInfoCache();
+ PermissionManager.disablePackageNamePermissionCache();
mContext = context;
mPackageManagerInt = LocalServices.getService(PackageManagerInternal.class);
@@ -805,8 +794,8 @@
private void updatePermissionFlagsInternal(String permName, String packageName, int flagMask,
int flagValues, int callingUid, int userId, boolean overridePolicy,
PermissionCallback callback) {
- if (ApplicationPackageManager.DEBUG_TRACE_PERMISSION_UPDATES
- && ApplicationPackageManager.shouldTraceGrant(packageName, permName, userId)) {
+ if (PermissionManager.DEBUG_TRACE_PERMISSION_UPDATES
+ && PermissionManager.shouldTraceGrant(packageName, permName, userId)) {
Log.i(TAG, "System is updating flags for " + packageName + " "
+ permName + " for user " + userId + " "
+ DebugUtils.flagsToString(
@@ -1112,59 +1101,6 @@
}
@Override
- public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
- @Nullable String callingFeatureId, int pid, int uid) {
- // If the check is being requested by an app then only allow the app to query its own
- // access status.
- int callingUid = mInjector.getCallingUid();
- int callingPid = mInjector.getCallingPid();
- if (UserHandle.getAppId(callingUid) >= Process.FIRST_APPLICATION_UID && (callingUid != uid
- || callingPid != pid)) {
- String response = String.format(
- "Calling uid %d, pid %d cannot check device identifier access for package %s "
- + "(uid=%d, pid=%d)",
- callingUid, callingPid, packageName, uid, pid);
- Log.w(TAG, response);
- throw new SecurityException(response);
- }
- // Allow system and root access to the device identifiers.
- final int appId = UserHandle.getAppId(uid);
- if (appId == Process.SYSTEM_UID || appId == Process.ROOT_UID) {
- return PackageManager.PERMISSION_GRANTED;
- }
- // Allow access to packages that have the READ_PRIVILEGED_PHONE_STATE permission.
- if (mInjector.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, pid,
- uid) == PackageManager.PERMISSION_GRANTED) {
- return PackageManager.PERMISSION_GRANTED;
- }
- // If the calling package is not null then perform the appop and device / profile owner
- // check.
- if (packageName != null) {
- // Allow access to a package that has been granted the READ_DEVICE_IDENTIFIERS appop.
- final long token = mInjector.clearCallingIdentity();
- AppOpsManager appOpsManager = (AppOpsManager) mInjector.getSystemService(
- Context.APP_OPS_SERVICE);
- try {
- if (appOpsManager.noteOpNoThrow(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS, uid,
- packageName, callingFeatureId, message) == AppOpsManager.MODE_ALLOWED) {
- return PackageManager.PERMISSION_GRANTED;
- }
- } finally {
- mInjector.restoreCallingIdentity(token);
- }
- // Check if the calling packages meets the device / profile owner requirements for
- // identifier access.
- DevicePolicyManager devicePolicyManager =
- (DevicePolicyManager) mInjector.getSystemService(Context.DEVICE_POLICY_SERVICE);
- if (devicePolicyManager != null && devicePolicyManager.hasDeviceIdentifierAccess(
- packageName, pid, uid)) {
- return PackageManager.PERMISSION_GRANTED;
- }
- }
- return PackageManager.PERMISSION_DENIED;
- }
-
- @Override
public void addOnPermissionsChangeListener(IOnPermissionsChangeListener listener) {
mContext.enforceCallingOrSelfPermission(
Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS,
@@ -1519,8 +1455,8 @@
// TODO swap permission name and package name
private void grantRuntimePermissionInternal(String permName, String packageName,
boolean overridePolicy, int callingUid, final int userId, PermissionCallback callback) {
- if (ApplicationPackageManager.DEBUG_TRACE_GRANTS
- && ApplicationPackageManager.shouldTraceGrant(packageName, permName, userId)) {
+ if (PermissionManager.DEBUG_TRACE_GRANTS
+ && PermissionManager.shouldTraceGrant(packageName, permName, userId)) {
Log.i(TAG, "System is granting " + packageName + " "
+ permName + " for user " + userId + " on behalf of uid " + callingUid
+ " " + mPackageManagerInt.getNameForUid(callingUid),
@@ -1550,18 +1486,24 @@
throw new IllegalArgumentException("Unknown package: " + packageName);
}
+ final boolean isRolePermission;
final boolean isSoftRestrictedPermission;
synchronized (mLock) {
final Permission permission = mRegistry.getPermission(permName);
- isSoftRestrictedPermission = permission != null && permission.isSoftRestricted();
+ if (permission == null) {
+ throw new IllegalArgumentException("Unknown permission: " + permName);
+ }
+ isRolePermission = permission.isRole();
+ isSoftRestrictedPermission = permission.isSoftRestricted();
}
+ final boolean mayGrantRolePermission = isRolePermission
+ && mayManageRolePermission(callingUid);
final boolean mayGrantSoftRestrictedPermission = isSoftRestrictedPermission
&& SoftRestrictedPermissionPolicy.forPermission(mContext,
pkg.toAppInfoWithoutState(), pkg, UserHandle.of(userId), permName)
.mayGrantPermission();
final boolean isRuntimePermission;
- final boolean isDevelopmentPermission;
final boolean permissionHasGids;
synchronized (mLock) {
final Permission bp = mRegistry.getPermission(permName);
@@ -1570,9 +1512,14 @@
}
isRuntimePermission = bp.isRuntime();
- isDevelopmentPermission = bp.isDevelopment();
permissionHasGids = bp.hasGids();
- if (!(isRuntimePermission || isDevelopmentPermission)) {
+ if (isRuntimePermission || bp.isDevelopment()) {
+ // Good.
+ } else if (bp.isRole()) {
+ if (!mayGrantRolePermission) {
+ throw new SecurityException("Permission " + permName + " is managed by role");
+ }
+ } else {
throw new SecurityException("Permission " + permName + " requested by "
+ pkg.getPackageName() + " is not a changeable permission type");
}
@@ -1623,7 +1570,7 @@
return;
}
- if (bp.isDevelopment()) {
+ if (bp.isDevelopment() || bp.isRole()) {
// Development permissions must be handled specially, since they are not
// normal runtime permissions. For now they apply to all users.
// TODO(zhanghai): We are breaking the behavior above by making all permission state
@@ -1654,10 +1601,10 @@
final int uid = UserHandle.getUid(userId, pkg.getUid());
if (callback != null) {
- if (isDevelopmentPermission) {
- callback.onInstallPermissionGranted();
- } else {
+ if (isRuntimePermission) {
callback.onPermissionGranted(uid, userId);
+ } else {
+ callback.onInstallPermissionGranted();
}
if (permissionHasGids) {
callback.onGidsChanged(UserHandle.getAppId(pkg.getUid()), userId);
@@ -1685,8 +1632,8 @@
private void revokeRuntimePermissionInternal(String permName, String packageName,
boolean overridePolicy, int callingUid, final int userId, String reason,
PermissionCallback callback) {
- if (ApplicationPackageManager.DEBUG_TRACE_PERMISSION_UPDATES
- && ApplicationPackageManager.shouldTraceGrant(packageName, permName, userId)) {
+ if (PermissionManager.DEBUG_TRACE_PERMISSION_UPDATES
+ && PermissionManager.shouldTraceGrant(packageName, permName, userId)) {
Log.i(TAG, "System is revoking " + packageName + " "
+ permName + " for user " + userId + " on behalf of uid " + callingUid
+ " " + mPackageManagerInt.getNameForUid(callingUid),
@@ -1715,8 +1662,18 @@
throw new IllegalArgumentException("Unknown package: " + packageName);
}
+ final boolean isRolePermission;
+ synchronized (mLock) {
+ final Permission permission = mRegistry.getPermission(permName);
+ if (permission == null) {
+ throw new IllegalArgumentException("Unknown permission: " + permName);
+ }
+ isRolePermission = permission.isRole();
+ }
+ final boolean mayRevokeRolePermission = isRolePermission
+ && mayManageRolePermission(callingUid);
+
final boolean isRuntimePermission;
- final boolean isDevelopmentPermission;
synchronized (mLock) {
final Permission bp = mRegistry.getPermission(permName);
if (bp == null) {
@@ -1724,8 +1681,13 @@
}
isRuntimePermission = bp.isRuntime();
- isDevelopmentPermission = bp.isDevelopment();
- if (!(isRuntimePermission || isDevelopmentPermission)) {
+ if (isRuntimePermission || bp.isDevelopment()) {
+ // Good.
+ } else if (bp.isRole()) {
+ if (!mayRevokeRolePermission) {
+ throw new SecurityException("Permission " + permName + " is managed by role");
+ }
+ } else {
throw new SecurityException("Permission " + permName + " requested by "
+ pkg.getPackageName() + " is not a changeable permission type");
}
@@ -1777,11 +1739,11 @@
}
if (callback != null) {
- if (isDevelopmentPermission) {
- mDefaultPermissionCallback.onInstallPermissionRevoked();
- } else {
+ if (isRuntimePermission) {
callback.onPermissionRevoked(UserHandle.getUid(userId, pkg.getUid()), userId,
reason);
+ } else {
+ mDefaultPermissionCallback.onInstallPermissionRevoked();
}
}
@@ -1790,6 +1752,17 @@
}
}
+ private boolean mayManageRolePermission(int uid) {
+ final PackageManager packageManager = mContext.getPackageManager();
+ final String[] packageNames = packageManager.getPackagesForUid(uid);
+ if (packageNames == null) {
+ return false;
+ }
+ final String permissionControllerPackageName =
+ packageManager.getPermissionControllerPackageName();
+ return Arrays.asList(packageNames).contains(permissionControllerPackageName);
+ }
+
@Override
public void resetRuntimePermissions() {
mContext.enforceCallingOrSelfPermission(
@@ -1999,44 +1972,6 @@
mPackageManagerInt.writePermissionSettings(asyncUpdatedUsers.toArray(), true);
}
- @Override
- public void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToEnabledCarrierApps(packageNames, userId);
- }
-
- @Override
- public void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToEnabledImsServices(packageNames, userId);
- }
-
- @Override
- public void grantDefaultPermissionsToEnabledTelephonyDataServices(
- String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToEnabledTelephonyDataServices(packageNames, userId);
- }
-
- @Override
- public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .revokeDefaultPermissionsFromDisabledTelephonyDataServices(packageNames, userId);
- }
-
- @Override
- public void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToActiveLuiApp(packageName, userId);
- }
-
- @Override
- public void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .revokeDefaultPermissionsFromLuiApps(packageNames, userId);
- }
-
/**
* This change makes it so that apps are told to show rationale for asking for background
* location access every time they request.
@@ -2679,7 +2614,8 @@
boolean runtimePermissionsRevoked = false;
int[] updatedUserIds = EMPTY_INT_ARRAY;
- final ArraySet<String> shouldGrantSignaturePermission = new ArraySet<>();
+ ArraySet<String> shouldGrantSignaturePermission = null;
+ ArraySet<String> shouldGrantInternalPermission = null;
final List<String> requestedPermissions = pkg.getRequestedPermissions();
final int requestedPermissionsSize = requestedPermissions.size();
for (int i = 0; i < requestedPermissionsSize; i++) {
@@ -2692,9 +2628,20 @@
if (permission == null) {
continue;
}
- if (permission.isSignature() && shouldGrantSignaturePermission(pkg, ps, permission)) {
+ if (permission.isSignature() && (shouldGrantSignaturePermission(pkg, permission)
+ || shouldGrantPermissionByProtectionFlags(pkg, ps, permission))) {
+ if (shouldGrantSignaturePermission == null) {
+ shouldGrantSignaturePermission = new ArraySet<>();
+ }
shouldGrantSignaturePermission.add(permissionName);
}
+ if (permission.isInternal()
+ && shouldGrantPermissionByProtectionFlags(pkg, ps, permission)) {
+ if (shouldGrantInternalPermission == null) {
+ shouldGrantInternalPermission = new ArraySet<>();
+ }
+ shouldGrantInternalPermission.add(permissionName);
+ }
}
final SparseBooleanArray isPermissionPolicyInitialized = new SparseBooleanArray();
@@ -2835,12 +2782,13 @@
// TODO(zhanghai): This calls into SystemConfig, which generally
// shouldn't cause deadlock, but maybe we should keep a cache of the
// split permission list and just eliminate the possibility.
- final List<SplitPermissionInfoParcelable> permissionList =
- getSplitPermissions();
+ final List<PermissionManager.SplitPermissionInfo> permissionList =
+ getSplitPermissionInfos();
int numSplitPerms = permissionList.size();
for (int splitPermNum = 0; splitPermNum < numSplitPerms;
splitPermNum++) {
- SplitPermissionInfoParcelable sp = permissionList.get(splitPermNum);
+ PermissionManager.SplitPermissionInfo sp = permissionList.get(
+ splitPermNum);
String splitPermName = sp.getSplitPermission();
if (sp.getNewPermissions().contains(permName)
&& origState.isPermissionGranted(splitPermName)) {
@@ -2904,9 +2852,17 @@
+ pkg.getPackageName());
}
- if ((bp.isNormal() && shouldGrantNormalPermission) || (bp.isSignature()
- && (shouldGrantSignaturePermission.contains(permName)
- || (bp.isDevelopment() && origState.isPermissionGranted(permName))))) {
+ if ((bp.isNormal() && shouldGrantNormalPermission)
+ || (bp.isSignature()
+ && ((shouldGrantSignaturePermission != null
+ && shouldGrantSignaturePermission.contains(permName))
+ || ((bp.isDevelopment() || bp.isRole())
+ && origState.isPermissionGranted(permName))))
+ || (bp.isInternal()
+ && ((shouldGrantInternalPermission != null
+ && shouldGrantInternalPermission.contains(permName))
+ || ((bp.isDevelopment() || bp.isRole())
+ && origState.isPermissionGranted(permName))))) {
// Grant an install permission.
if (uidState.grantPermission(bp)) {
changedInstallPermission = true;
@@ -3229,10 +3185,11 @@
String pkgName = pkg.getPackageName();
ArrayMap<String, ArraySet<String>> newToSplitPerms = new ArrayMap<>();
- final List<SplitPermissionInfoParcelable> permissionList = getSplitPermissions();
+ final List<PermissionManager.SplitPermissionInfo> permissionList =
+ getSplitPermissionInfos();
int numSplitPerms = permissionList.size();
for (int splitPermNum = 0; splitPermNum < numSplitPerms; splitPermNum++) {
- SplitPermissionInfoParcelable spi = permissionList.get(splitPermNum);
+ PermissionManager.SplitPermissionInfo spi = permissionList.get(splitPermNum);
List<String> newPerms = spi.getNewPermissions();
int numNewPerms = newPerms.size();
@@ -3298,10 +3255,15 @@
return updatedUserIds;
}
+ @NonNull
@Override
public List<SplitPermissionInfoParcelable> getSplitPermissions() {
- return PermissionManager.splitPermissionInfoListToParcelableList(
- SystemConfig.getInstance().getSplitPermissions());
+ return PermissionManager.splitPermissionInfoListToParcelableList(getSplitPermissionInfos());
+ }
+
+ @NonNull
+ private List<PermissionManager.SplitPermissionInfo> getSplitPermissionInfos() {
+ return SystemConfig.getInstance().getSplitPermissions();
}
@NonNull
@@ -3406,7 +3368,7 @@
}
private boolean shouldGrantSignaturePermission(@NonNull AndroidPackage pkg,
- @NonNull PackageSetting pkgSetting, @NonNull Permission bp) {
+ @NonNull Permission bp) {
// expect single system package
String systemPackageName = ArrayUtils.firstOrNull(mPackageManagerInt.getKnownPackageNames(
PackageManagerInternal.PACKAGE_SYSTEM, UserHandle.USER_SYSTEM));
@@ -3421,8 +3383,7 @@
// - or it shares the above relationships with the system package
final PackageParser.SigningDetails sourceSigningDetails =
getSourcePackageSigningDetails(bp);
- boolean allowed =
- pkg.getSigningDetails().hasAncestorOrSelf(sourceSigningDetails)
+ return pkg.getSigningDetails().hasAncestorOrSelf(sourceSigningDetails)
|| sourceSigningDetails.checkCapability(
pkg.getSigningDetails(),
PackageParser.SigningDetails.CertCapabilities.PERMISSION)
@@ -3430,6 +3391,11 @@
|| systemPackage.getSigningDetails().checkCapability(
pkg.getSigningDetails(),
PackageParser.SigningDetails.CertCapabilities.PERMISSION);
+ }
+
+ private boolean shouldGrantPermissionByProtectionFlags(@NonNull AndroidPackage pkg,
+ @NonNull PackageSetting pkgSetting, @NonNull Permission bp) {
+ boolean allowed = false;
final boolean isVendorPrivilegedPermission = bp.isVendorPrivileged();
final boolean isPrivilegedPermission = bp.isPrivileged() || isVendorPrivilegedPermission;
final boolean isOemPermission = bp.isOem();
@@ -3472,12 +3438,12 @@
// need a separate flag anymore. Hence we need to check which
// permissions are needed by the permission controller
if (!allowed && bp.isInstaller()
- && ArrayUtils.contains(mPackageManagerInt.getKnownPackageNames(
+ && (ArrayUtils.contains(mPackageManagerInt.getKnownPackageNames(
PackageManagerInternal.PACKAGE_INSTALLER, UserHandle.USER_SYSTEM),
pkg.getPackageName()) || ArrayUtils.contains(
mPackageManagerInt.getKnownPackageNames(
PackageManagerInternal.PACKAGE_PERMISSION_CONTROLLER,
- UserHandle.USER_SYSTEM), pkg.getPackageName())) {
+ UserHandle.USER_SYSTEM), pkg.getPackageName()))) {
// If this permission is to be granted to the system installer and
// this app is an installer, then it gets the permission.
allowed = true;
@@ -5394,94 +5360,4 @@
|| mDelegatedPermissionNames.contains(permissionName);
}
}
-
- /**
- * Allows injection of services and method responses to facilitate testing.
- *
- * <p>Test classes can create a mock of this class and pass it to the PermissionManagerService
- * constructor to control behavior of services and external methods during execution.
- * @hide
- */
- @VisibleForTesting
- public static class Injector {
- private final Context mContext;
-
- /**
- * Public constructor that accepts a {@code context} within which to operate.
- */
- public Injector(@NonNull Context context) {
- mContext = context;
- }
-
- /**
- * Returns the UID of the calling package.
- */
- public int getCallingUid() {
- return Binder.getCallingUid();
- }
-
- /**
- * Returns the process ID of the calling package.
- */
- public int getCallingPid() {
- return Binder.getCallingPid();
- }
-
- /**
- * Invalidates the package info cache.
- */
- public void invalidatePackageInfoCache() {
- PackageManager.invalidatePackageInfoCache();
- }
-
- /**
- * Disables the permission cache.
- */
- public void disablePermissionCache() {
- PermissionManager.disablePermissionCache();
- }
-
- /**
- * Disables the package name permission cache.
- */
- public void disablePackageNamePermissionCache() {
- PermissionManager.disablePackageNamePermissionCache();
- }
-
- /**
- * Checks if the package running under the specified {@code pid} and {@code uid} has been
- * granted the provided {@code permission}.
- *
- * @return {@link PackageManager#PERMISSION_GRANTED} if the package has been granted the
- * permission, {@link PackageManager#PERMISSION_DENIED} otherwise
- */
- public int checkPermission(@NonNull String permission, int pid, int uid) {
- return mContext.checkPermission(permission, pid, uid);
- }
-
- /**
- * Clears the calling identity to allow subsequent calls to be treated as coming from this
- * package.
- *
- * @return a token that can be used to restore the calling identity
- */
- public long clearCallingIdentity() {
- return Binder.clearCallingIdentity();
- }
-
- /**
- * Restores the calling identity to that of the calling package based on the provided
- * {@code token}.
- */
- public void restoreCallingIdentity(long token) {
- Binder.restoreCallingIdentity(token);
- }
-
- /**
- * Returns the system service with the provided {@code name}.
- */
- public Object getSystemService(@NonNull String name) {
- return mContext.getSystemService(name);
- }
- }
}
diff --git a/services/core/java/com/android/server/policy/DisplayFoldController.java b/services/core/java/com/android/server/policy/DisplayFoldController.java
index b007a75..ff51237 100644
--- a/services/core/java/com/android/server/policy/DisplayFoldController.java
+++ b/services/core/java/com/android/server/policy/DisplayFoldController.java
@@ -20,12 +20,10 @@
import android.content.Context;
import android.graphics.Rect;
import android.hardware.ICameraService;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
+import android.hardware.devicestate.DeviceStateManager;
import android.hardware.display.DisplayManagerInternal;
import android.os.Handler;
+import android.os.HandlerExecutor;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.util.Slog;
@@ -63,7 +61,8 @@
private String mFocusedApp;
private final DisplayFoldDurationLogger mDurationLogger = new DisplayFoldDurationLogger();
- DisplayFoldController(WindowManagerInternal windowManagerInternal,
+ DisplayFoldController(
+ Context context, WindowManagerInternal windowManagerInternal,
DisplayManagerInternal displayManagerInternal,
@Nullable CameraServiceProxy cameraServiceProxy, int displayId, Rect foldedArea,
Handler handler) {
@@ -73,6 +72,10 @@
mDisplayId = displayId;
mFoldedArea = new Rect(foldedArea);
mHandler = handler;
+
+ DeviceStateManager deviceStateManager = context.getSystemService(DeviceStateManager.class);
+ deviceStateManager.registerDeviceStateListener(new DeviceStateListener(context),
+ new HandlerExecutor(handler));
}
void finishedGoingToSleep() {
@@ -83,11 +86,7 @@
mDurationLogger.onFinishedWakingUp(mFolded);
}
- void requestDeviceFolded(boolean folded) {
- mHandler.post(() -> setDeviceFolded(folded));
- }
-
- void setDeviceFolded(boolean folded) {
+ private void setDeviceFolded(boolean folded) {
if (mFolded != null && mFolded == folded) {
return;
}
@@ -179,33 +178,6 @@
}
}
- /**
- * Only used for the case that persist.debug.force_foldable is set.
- * This is using proximity sensor to simulate the fold state switch.
- */
- static DisplayFoldController createWithProxSensor(Context context, int displayId) {
- final SensorManager sensorManager = context.getSystemService(SensorManager.class);
- final Sensor proxSensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
- if (proxSensor == null) {
- return null;
- }
-
- final DisplayFoldController result = create(context, displayId);
- sensorManager.registerListener(new SensorEventListener() {
- @Override
- public void onSensorChanged(SensorEvent event) {
- result.requestDeviceFolded(event.values[0] < 1f);
- }
-
- @Override
- public void onAccuracyChanged(Sensor sensor, int accuracy) {
- // Ignore.
- }
- }, proxSensor, SensorManager.SENSOR_DELAY_NORMAL);
-
- return result;
- }
-
void onDefaultDisplayFocusChanged(String pkg) {
mFocusedApp = pkg;
}
@@ -227,7 +199,26 @@
foldedArea = Rect.unflattenFromString(configFoldedArea);
}
- return new DisplayFoldController(windowManagerService, displayService, cameraServiceProxy,
- displayId, foldedArea, DisplayThread.getHandler());
+ return new DisplayFoldController(context, windowManagerService, displayService,
+ cameraServiceProxy, displayId, foldedArea, DisplayThread.getHandler());
+ }
+
+ /**
+ * Listens to changes in device state and reports the state as folded if the device state
+ * matches the value in the {@link com.android.internal.R.integer.config_foldedDeviceState}
+ * resource.
+ */
+ private class DeviceStateListener implements DeviceStateManager.DeviceStateListener {
+ private final int mFoldedDeviceState;
+
+ DeviceStateListener(Context context) {
+ mFoldedDeviceState = context.getResources().getInteger(
+ com.android.internal.R.integer.config_foldedDeviceState);
+ }
+
+ @Override
+ public void onDeviceStateChanged(int deviceState) {
+ setDeviceFolded(deviceState == mFoldedDeviceState);
+ }
}
}
diff --git a/services/core/java/com/android/server/policy/OWNERS b/services/core/java/com/android/server/policy/OWNERS
new file mode 100644
index 0000000..d25ec4a
--- /dev/null
+++ b/services/core/java/com/android/server/policy/OWNERS
@@ -0,0 +1,2 @@
+include /services/core/java/com/android/server/wm/OWNERS
+include /services/core/java/com/android/server/input/OWNERS
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 5ecf2df..6919cea 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -472,7 +472,6 @@
int mLidKeyboardAccessibility;
int mLidNavigationAccessibility;
- private boolean mLidControlsDisplayFold;
int mShortPressOnPowerBehavior;
int mLongPressOnPowerBehavior;
int mVeryLongPressOnPowerBehavior;
@@ -648,8 +647,8 @@
break;
case MSG_LAUNCH_ASSIST:
final int deviceId = msg.arg1;
- final String hint = (String) msg.obj;
- launchAssistAction(hint, deviceId);
+ final Long eventTime = (Long) msg.obj;
+ launchAssistAction(null /* hint */, deviceId, eventTime);
break;
case MSG_LAUNCH_VOICE_ASSIST_WITH_WAKE_LOCK:
launchVoiceAssistWithWakeLock();
@@ -659,7 +658,7 @@
finishPowerKeyPress();
break;
case MSG_POWER_LONG_PRESS:
- powerLongPress();
+ powerLongPress((Long) msg.obj /* eventTime */);
break;
case MSG_POWER_VERY_LONG_PRESS:
powerVeryLongPress();
@@ -934,9 +933,10 @@
// Wait for a long press or for the button to be released to decide what to do.
if (hasLongPressOnPowerBehavior()) {
if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
- powerLongPress();
+ powerLongPress(event.getEventTime());
} else {
- Message msg = mHandler.obtainMessage(MSG_POWER_LONG_PRESS);
+ Message msg = mHandler.obtainMessage(MSG_POWER_LONG_PRESS,
+ event.getEventTime());
msg.setAsynchronous(true);
mHandler.sendMessageDelayed(msg,
ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
@@ -953,9 +953,10 @@
if (mSupportLongPressPowerWhenNonInteractive && hasLongPressOnPowerBehavior()) {
if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
- powerLongPress();
+ powerLongPress(event.getEventTime());
} else {
- Message msg = mHandler.obtainMessage(MSG_POWER_LONG_PRESS);
+ Message msg = mHandler.obtainMessage(MSG_POWER_LONG_PRESS,
+ event.getEventTime());
msg.setAsynchronous(true);
mHandler.sendMessageDelayed(msg,
ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
@@ -1188,7 +1189,7 @@
return 1;
}
- private void powerLongPress() {
+ private void powerLongPress(long eventTime) {
final int behavior = getResolvedLongPressOnPowerBehavior();
switch (behavior) {
case LONG_PRESS_POWER_NOTHING:
@@ -1221,7 +1222,7 @@
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, false,
"Power - Long Press - Go To Assistant");
final int powerKeyDeviceId = Integer.MIN_VALUE;
- launchAssistAction(null, powerKeyDeviceId);
+ launchAssistAction(null, powerKeyDeviceId, eventTime);
break;
}
}
@@ -1624,7 +1625,8 @@
} else if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
if (!keyguardOn) {
// Post to main thread to avoid blocking input pipeline.
- mHandler.post(() -> handleLongPressOnHome(event.getDeviceId()));
+ mHandler.post(() -> handleLongPressOnHome(event.getDeviceId(),
+ event.getEventTime()));
}
}
return -1;
@@ -1637,7 +1639,7 @@
}
}
- private void handleLongPressOnHome(int deviceId) {
+ private void handleLongPressOnHome(int deviceId, long eventTime) {
if (mLongPressOnHomeBehavior == LONG_PRESS_HOME_NOTHING) {
return;
}
@@ -1649,7 +1651,7 @@
launchAllAppsAction();
break;
case LONG_PRESS_HOME_ASSIST:
- launchAssistAction(null, deviceId);
+ launchAssistAction(null, deviceId, eventTime);
break;
case LONG_PRESS_HOME_NOTIFICATION_PANEL:
toggleNotificationPanel();
@@ -1789,8 +1791,6 @@
com.android.internal.R.integer.config_lidKeyboardAccessibility);
mLidNavigationAccessibility = mContext.getResources().getInteger(
com.android.internal.R.integer.config_lidNavigationAccessibility);
- mLidControlsDisplayFold = mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_lidControlsDisplayFold);
mAllowTheaterModeWakeFromKey = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_allowTheaterModeWakeFromKey);
@@ -1847,12 +1847,7 @@
readConfigurationDependentBehaviors();
- if (mLidControlsDisplayFold) {
- mDisplayFoldController = DisplayFoldController.create(context, DEFAULT_DISPLAY);
- } else if (SystemProperties.getBoolean("persist.debug.force_foldable", false)) {
- mDisplayFoldController = DisplayFoldController.createWithProxSensor(context,
- DEFAULT_DISPLAY);
- }
+ mDisplayFoldController = DisplayFoldController.create(context, DEFAULT_DISPLAY);
mAccessibilityManager = (AccessibilityManager) context.getSystemService(
Context.ACCESSIBILITY_SERVICE);
@@ -2791,7 +2786,8 @@
if (down) {
mPendingMetaAction = true;
} else if (mPendingMetaAction) {
- launchAssistAction(Intent.EXTRA_ASSIST_INPUT_HINT_KEYBOARD, event.getDeviceId());
+ launchAssistAction(Intent.EXTRA_ASSIST_INPUT_HINT_KEYBOARD, event.getDeviceId(),
+ event.getEventTime());
}
return -1;
}
@@ -3134,7 +3130,8 @@
}
}
- private int handleStartTransitionForKeyguardLw(boolean keyguardGoingAway, long duration) {
+ @Override
+ public int applyKeyguardOcclusionChange() {
if (mKeyguardOccludedChanged) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "transition/occluded changed occluded="
+ mPendingKeyguardOccluded);
@@ -3143,6 +3140,12 @@
return FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_WALLPAPER;
}
}
+ return 0;
+ }
+
+ private int handleStartTransitionForKeyguardLw(boolean keyguardGoingAway, long duration) {
+ final int res = applyKeyguardOcclusionChange();
+ if (res != 0) return res;
if (keyguardGoingAway) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "Starting keyguard exit animation");
startKeyguardExitAnimation(SystemClock.uptimeMillis(), duration);
@@ -3154,22 +3157,24 @@
// various parts of the UI.
/** Asks the status bar to startAssist(), usually a full "assistant" interface */
- private void launchAssistAction(String hint, int deviceId) {
+ private void launchAssistAction(String hint, int deviceId, long eventTime) {
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_ASSIST);
if (!isUserSetupComplete()) {
// Disable opening assist window during setup
return;
}
+
+ // Add Intent Extra data.
Bundle args = null;
- if (deviceId > Integer.MIN_VALUE || hint != null) {
- args = new Bundle();
- if (deviceId > Integer.MIN_VALUE) {
- args.putInt(Intent.EXTRA_ASSIST_INPUT_DEVICE_ID, deviceId);
- }
- if (hint != null) {
- args.putBoolean(hint, true);
- }
+ args = new Bundle();
+ if (deviceId > Integer.MIN_VALUE) {
+ args.putInt(Intent.EXTRA_ASSIST_INPUT_DEVICE_ID, deviceId);
}
+ if (hint != null) {
+ args.putBoolean(hint, true);
+ }
+ args.putLong(Intent.EXTRA_TIME, eventTime);
+
((SearchManager) mContext.createContextAsUser(UserHandle.of(mCurrentUserId), 0)
.getSystemService(Context.SEARCH_SERVICE)).launchAssist(args);
}
@@ -3791,7 +3796,7 @@
final boolean longPressed = event.getRepeatCount() > 0;
if (down && !longPressed) {
Message msg = mHandler.obtainMessage(MSG_LAUNCH_ASSIST, event.getDeviceId(),
- 0 /* unused */, null /* hint */);
+ 0 /* unused */, event.getEventTime() /* eventTime */);
msg.setAsynchronous(true);
msg.sendToTarget();
}
@@ -4856,9 +4861,7 @@
private void applyLidSwitchState() {
final int lidState = mDefaultDisplayPolicy.getLidState();
- if (mLidControlsDisplayFold && mDisplayFoldController != null) {
- mDisplayFoldController.requestDeviceFolded(lidState == LID_CLOSED);
- } else if (lidState == LID_CLOSED) {
+ if (lidState == LID_CLOSED) {
int lidBehavior = getLidBehavior();
switch (lidBehavior) {
case LID_BEHAVIOR_LOCK:
diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
index 6934e5c..977b31e 100644
--- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java
+++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
@@ -172,6 +172,9 @@
*/
void onKeyguardOccludedChangedLw(boolean occluded);
+ /** Applies a keyguard occlusion change if one happened. */
+ int applyKeyguardOcclusionChange();
+
/**
* Interface to the Window Manager state associated with a particular
* window. You can hold on to an instance of this interface from the call
diff --git a/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java b/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java
index 68d038b..16f5069 100644
--- a/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java
+++ b/services/core/java/com/android/server/power/batterysaver/BatterySaverController.java
@@ -113,11 +113,6 @@
private boolean mIsInteractive;
/**
- * Read-only list of plugins. No need for synchronization.
- */
- private final Plugin[] mPlugins;
-
- /**
* Package name that will receive an explicit manifest broadcast for
* {@link PowerManager#ACTION_POWER_SAVE_MODE_CHANGED}. It's {@code null} if it hasn't been
* retrieved yet.
@@ -172,15 +167,6 @@
}
}
- /**
- * Plugin interface. All methods are guaranteed to be called on the same (handler) thread.
- */
- public interface Plugin {
- void onSystemReady(BatterySaverController caller);
-
- void onBatterySaverChanged(BatterySaverController caller);
- }
-
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -194,6 +180,7 @@
updateBatterySavingStats();
return; // No need to send it if not enabled.
}
+ // We currently evaluate state only for CPU frequency changes.
// Don't send the broadcast, because we never did so in this case.
mHandler.postStateChanged(/*sendBroadcast=*/ false,
REASON_INTERACTIVE_CHANGED);
@@ -224,9 +211,6 @@
mFileUpdater = new FileUpdater(context);
mBatterySavingStats = batterySavingStats;
- // TODO(79580230): remove plugin code and maybe screen on/off listeners?
- // Initialize plugins.
- mPlugins = new Plugin[0];
PowerManager.invalidatePowerSaveModeCaches();
}
@@ -300,12 +284,6 @@
msg.arg1 == ARG_SEND_BROADCAST,
msg.arg2);
break;
-
- case MSG_SYSTEM_READY:
- for (Plugin p : mPlugins) {
- p.onSystemReady(BatterySaverController.this);
- }
- break;
}
}
}
@@ -479,10 +457,6 @@
mFileUpdater.writeFiles(fileValues);
}
- for (Plugin p : mPlugins) {
- p.onBatterySaverChanged(this);
- }
-
if (sendBroadcast) {
if (DEBUG) {
diff --git a/services/core/java/com/android/server/powerstats/OWNERS b/services/core/java/com/android/server/powerstats/OWNERS
new file mode 100644
index 0000000..c22f6a4
--- /dev/null
+++ b/services/core/java/com/android/server/powerstats/OWNERS
@@ -0,0 +1,2 @@
+include /BATTERY_STATS_OWNERS
+include /services/core/java/com/android/server/power/OWNERS
diff --git a/services/core/java/com/android/server/role/RoleManagerService.java b/services/core/java/com/android/server/role/RoleManagerService.java
index eb15c80..caa275d 100644
--- a/services/core/java/com/android/server/role/RoleManagerService.java
+++ b/services/core/java/com/android/server/role/RoleManagerService.java
@@ -34,7 +34,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PackageManagerInternal;
import android.content.pm.Signature;
@@ -754,18 +753,6 @@
dumpOutputStream.flush();
}
-
- private int getUidForPackage(String packageName) {
- final long ident = Binder.clearCallingIdentity();
- try {
- return getContext().getPackageManager().getApplicationInfo(packageName,
- PackageManager.MATCH_ANY_USER).uid;
- } catch (NameNotFoundException nnfe) {
- return -1;
- } finally {
- Binder.restoreCallingIdentity(ident);
- }
- }
}
private class Internal extends RoleManagerInternal {
diff --git a/services/core/java/com/android/server/rollback/OWNERS b/services/core/java/com/android/server/rollback/OWNERS
new file mode 100644
index 0000000..7feb85f
--- /dev/null
+++ b/services/core/java/com/android/server/rollback/OWNERS
@@ -0,0 +1 @@
+olilan@google.com
diff --git a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
index 192a003..bd66aa3 100644
--- a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
+++ b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
@@ -1316,7 +1316,7 @@
private SparseIntArray getExtensionVersions() {
// This list must be updated whenever the current API level is increased, or should be
// replaced when we have another way of determining the relevant SDK versions.
- final int[] relevantSdkVersions = { Build.VERSION_CODES.R };
+ final int[] relevantSdkVersions = { Build.VERSION_CODES.R, Build.VERSION_CODES.S };
SparseIntArray result = new SparseIntArray(relevantSdkVersions.length);
for (int i = 0; i < relevantSdkVersions.length; i++) {
diff --git a/services/core/java/com/android/server/slice/OWNERS b/services/core/java/com/android/server/slice/OWNERS
new file mode 100644
index 0000000..3d0859f
--- /dev/null
+++ b/services/core/java/com/android/server/slice/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/app/slice/OWNERS
diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
index cf20cf4..ac3816e 100644
--- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
+++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
@@ -31,6 +31,7 @@
import static android.net.NetworkTemplate.buildTemplateWifiWildcard;
import static android.net.NetworkTemplate.getAllCollapsedRatTypes;
import static android.os.Debug.getIonHeapsSizeKb;
+import static android.os.Process.LAST_SHARED_APPLICATION_GID;
import static android.os.Process.getUidForPid;
import static android.os.storage.VolumeInfo.TYPE_PRIVATE;
import static android.os.storage.VolumeInfo.TYPE_PUBLIC;
@@ -168,7 +169,6 @@
import com.android.server.storage.DiskStatsFileLogger;
import com.android.server.storage.DiskStatsLoggingService;
-import java.util.concurrent.ExecutionException;
import libcore.io.IoUtils;
import org.json.JSONArray;
@@ -191,6 +191,7 @@
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
@@ -1517,14 +1518,53 @@
}
int pullCpuTimePerUidFreqLocked(int atomTag, List<StatsEvent> pulledData) {
+ // Aggregate times for the same uids.
+ SparseArray<long[]> aggregated = new SparseArray<>();
mCpuUidFreqTimeReader.readAbsolute((uid, cpuFreqTimeMs) -> {
- for (int freqIndex = 0; freqIndex < cpuFreqTimeMs.length; ++freqIndex) {
- if (cpuFreqTimeMs[freqIndex] >= MIN_CPU_TIME_PER_UID_FREQ) {
- pulledData.add(FrameworkStatsLog.buildStatsEvent(
- atomTag, uid, freqIndex, cpuFreqTimeMs[freqIndex]));
+ // For uids known to be aggregated from many entries allow mutating in place to avoid
+ // many copies. Otherwise, copy before aggregating.
+ boolean mutateInPlace = false;
+ if (UserHandle.isIsolated(uid)) {
+ // Skip individual isolated uids because they are recycled and quickly removed from
+ // the underlying data source.
+ return;
+ } else if (UserHandle.isSharedAppGid(uid)) {
+ // All shared app gids are accounted together.
+ uid = LAST_SHARED_APPLICATION_GID;
+ mutateInPlace = true;
+ } else {
+ // Everything else is accounted under their base uid.
+ uid = UserHandle.getAppId(uid);
+ }
+
+ long[] aggCpuFreqTimeMs = aggregated.get(uid);
+ if (aggCpuFreqTimeMs != null) {
+ if (!mutateInPlace) {
+ aggCpuFreqTimeMs = Arrays.copyOf(aggCpuFreqTimeMs, cpuFreqTimeMs.length);
+ aggregated.put(uid, aggCpuFreqTimeMs);
}
+ for (int freqIndex = 0; freqIndex < cpuFreqTimeMs.length; ++freqIndex) {
+ aggCpuFreqTimeMs[freqIndex] += cpuFreqTimeMs[freqIndex];
+ }
+ } else {
+ if (mutateInPlace) {
+ cpuFreqTimeMs = Arrays.copyOf(cpuFreqTimeMs, cpuFreqTimeMs.length);
+ }
+ aggregated.put(uid, cpuFreqTimeMs);
}
});
+
+ int size = aggregated.size();
+ for (int i = 0; i < size; ++i) {
+ int uid = aggregated.keyAt(i);
+ long[] aggCpuFreqTimeMs = aggregated.valueAt(i);
+ for (int freqIndex = 0; freqIndex < aggCpuFreqTimeMs.length; ++freqIndex) {
+ if (aggCpuFreqTimeMs[freqIndex] >= MIN_CPU_TIME_PER_UID_FREQ) {
+ pulledData.add(FrameworkStatsLog.buildStatsEvent(
+ atomTag, uid, freqIndex, aggCpuFreqTimeMs[freqIndex]));
+ }
+ }
+ }
return StatsManager.PULL_SUCCESS;
}
diff --git a/services/core/java/com/android/server/statusbar/OWNERS b/services/core/java/com/android/server/statusbar/OWNERS
new file mode 100644
index 0000000..2e96c97
--- /dev/null
+++ b/services/core/java/com/android/server/statusbar/OWNERS
@@ -0,0 +1 @@
+include /packages/SystemUI/OWNERS
diff --git a/services/core/java/com/android/server/storage/OWNERS b/services/core/java/com/android/server/storage/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/services/core/java/com/android/server/storage/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/services/core/java/com/android/server/textclassifier/OWNERS b/services/core/java/com/android/server/textclassifier/OWNERS
new file mode 100644
index 0000000..46b3cb8
--- /dev/null
+++ b/services/core/java/com/android/server/textclassifier/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/textclassifier/OWNERS
diff --git a/services/core/java/com/android/server/timedetector/OWNERS b/services/core/java/com/android/server/timedetector/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/services/core/java/com/android/server/timedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/core/java/com/android/server/timedetector/TimeDetectorService.java b/services/core/java/com/android/server/timedetector/TimeDetectorService.java
index 7de0e87..c7fe204 100644
--- a/services/core/java/com/android/server/timedetector/TimeDetectorService.java
+++ b/services/core/java/com/android/server/timedetector/TimeDetectorService.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ITimeDetectorService;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
@@ -129,6 +130,14 @@
mHandler.post(() -> mTimeDetectorStrategy.suggestNetworkTime(timeSignal));
}
+ @Override
+ public void suggestGnssTime(@NonNull GnssTimeSuggestion timeSignal) {
+ enforceSuggestGnssTimePermission();
+ Objects.requireNonNull(timeSignal);
+
+ mHandler.post(() -> mTimeDetectorStrategy.suggestGnssTime(timeSignal));
+ }
+
/** Internal method for handling the auto time setting being changed. */
@VisibleForTesting
public void handleAutoTimeDetectionChanged() {
@@ -162,4 +171,10 @@
android.Manifest.permission.SET_TIME,
"set time");
}
+
+ private void enforceSuggestGnssTimePermission() {
+ mContext.enforceCallingOrSelfPermission(
+ android.Manifest.permission.SET_TIME,
+ "suggest gnss time");
+ }
}
diff --git a/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java b/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java
index f278ef6..b539f01 100644
--- a/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java
+++ b/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java
@@ -18,6 +18,7 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -41,7 +42,7 @@
*/
public interface TimeDetectorStrategy extends Dumpable {
- @IntDef({ ORIGIN_TELEPHONY, ORIGIN_MANUAL, ORIGIN_NETWORK })
+ @IntDef({ ORIGIN_TELEPHONY, ORIGIN_MANUAL, ORIGIN_NETWORK, ORIGIN_GNSS })
@Retention(RetentionPolicy.SOURCE)
@interface Origin {}
@@ -57,6 +58,10 @@
@Origin
int ORIGIN_NETWORK = 3;
+ /** Used when a time value originated from a gnss signal. */
+ @Origin
+ int ORIGIN_GNSS = 4;
+
/** Processes the suggested time from telephony sources. */
void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion);
@@ -71,6 +76,9 @@
/** Processes the suggested time from network sources. */
void suggestNetworkTime(@NonNull NetworkTimeSuggestion timeSuggestion);
+ /** Processes the suggested time from gnss sources. */
+ void suggestGnssTime(@NonNull GnssTimeSuggestion timeSuggestion);
+
/**
* Handles the auto-time configuration changing For example, when the auto-time setting is
* toggled on or off.
@@ -100,6 +108,8 @@
return "network";
case ORIGIN_TELEPHONY:
return "telephony";
+ case ORIGIN_GNSS:
+ return "gnss";
default:
throw new IllegalArgumentException("origin=" + origin);
}
@@ -117,6 +127,8 @@
return ORIGIN_NETWORK;
case "telephony":
return ORIGIN_TELEPHONY;
+ case "gnss":
+ return ORIGIN_GNSS;
default:
throw new IllegalArgumentException("originString=" + originString);
}
diff --git a/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java b/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java
index b5d49cf..48af81e5 100644
--- a/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java
+++ b/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java
@@ -23,6 +23,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.AlarmManager;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -108,6 +109,10 @@
private final ReferenceWithHistory<NetworkTimeSuggestion> mLastNetworkSuggestion =
new ReferenceWithHistory<>(KEEP_SUGGESTION_HISTORY_SIZE);
+ @GuardedBy("this")
+ private final ReferenceWithHistory<GnssTimeSuggestion> mLastGnssSuggestion =
+ new ReferenceWithHistory<>(KEEP_SUGGESTION_HISTORY_SIZE);
+
/**
* The interface used by the strategy to interact with the surrounding service.
*
@@ -165,6 +170,20 @@
}
@Override
+ public synchronized void suggestGnssTime(@NonNull GnssTimeSuggestion timeSuggestion) {
+ final TimestampedValue<Long> newUtcTime = timeSuggestion.getUtcTime();
+
+ if (!validateAutoSuggestionTime(newUtcTime, timeSuggestion)) {
+ return;
+ }
+
+ mLastGnssSuggestion.set(timeSuggestion);
+
+ String reason = "GNSS time suggestion received: suggestion=" + timeSuggestion;
+ doAutoTimeDetection(reason);
+ }
+
+ @Override
public synchronized boolean suggestManualTime(@NonNull ManualTimeSuggestion suggestion) {
final TimestampedValue<Long> newUtcTime = suggestion.getUtcTime();
@@ -278,6 +297,11 @@
mLastNetworkSuggestion.dump(ipw);
ipw.decreaseIndent(); // level 2
+ ipw.println("Gnss suggestion history:");
+ ipw.increaseIndent(); // level 2
+ mLastGnssSuggestion.dump(ipw);
+ ipw.decreaseIndent(); // level 2
+
ipw.decreaseIndent(); // level 1
}
@@ -383,6 +407,14 @@
+ ", networkSuggestion=" + networkSuggestion
+ ", detectionReason=" + detectionReason;
}
+ } else if (origin == ORIGIN_GNSS) {
+ GnssTimeSuggestion gnssTimeSuggestion = findLatestValidGnssSuggestion();
+ if (gnssTimeSuggestion != null) {
+ newUtcTime = gnssTimeSuggestion.getUtcTime();
+ cause = "Found good gnss suggestion."
+ + ", gnssTimeSuggestion=" + gnssTimeSuggestion
+ + ", detectionReason=" + detectionReason;
+ }
} else {
Slog.w(LOG_TAG, "Unknown or unsupported origin=" + origin
+ " in " + Arrays.toString(originPriorities)
@@ -524,6 +556,26 @@
return networkSuggestion;
}
+ /** Returns the latest, valid, gnss suggestion. Returns {@code null} if there isn't one. */
+ @GuardedBy("this")
+ @Nullable
+ private GnssTimeSuggestion findLatestValidGnssSuggestion() {
+ GnssTimeSuggestion gnssTimeSuggestion = mLastGnssSuggestion.get();
+ if (gnssTimeSuggestion == null) {
+ // No gnss suggestions received. This is normal if there's no gnss signal.
+ return null;
+ }
+
+ TimestampedValue<Long> utcTime = gnssTimeSuggestion.getUtcTime();
+ long elapsedRealTimeMillis = mCallback.elapsedRealtimeMillis();
+ if (!validateSuggestionUtcTime(elapsedRealTimeMillis, utcTime)) {
+ // The latest suggestion is not valid, usually due to its age.
+ return null;
+ }
+
+ return gnssTimeSuggestion;
+ }
+
@GuardedBy("this")
private boolean setSystemClockIfRequired(
@Origin int origin, @NonNull TimestampedValue<Long> time, @NonNull String cause) {
@@ -652,6 +704,16 @@
}
/**
+ * Returns the latest valid gnss suggestion. Not intended for general use: it is used during
+ * tests to check strategy behavior.
+ */
+ @VisibleForTesting
+ @Nullable
+ public synchronized GnssTimeSuggestion findLatestValidGnssSuggestionForTests() {
+ return findLatestValidGnssSuggestion();
+ }
+
+ /**
* A method used to inspect state during tests. Not intended for general use.
*/
@VisibleForTesting
@@ -669,6 +731,15 @@
return mLastNetworkSuggestion.get();
}
+ /**
+ * A method used to inspect state during tests. Not intended for general use.
+ */
+ @VisibleForTesting
+ @Nullable
+ public synchronized GnssTimeSuggestion getLatestGnssSuggestion() {
+ return mLastGnssSuggestion.get();
+ }
+
private static boolean validateSuggestionUtcTime(
long elapsedRealtimeMillis, TimestampedValue<Long> utcTime) {
long referenceTimeMillis = utcTime.getReferenceTimeMillis();
diff --git a/services/core/java/com/android/server/timezone/OWNERS b/services/core/java/com/android/server/timezone/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/services/core/java/com/android/server/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/core/java/com/android/server/timezonedetector/OWNERS b/services/core/java/com/android/server/timezonedetector/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/services/core/java/com/android/server/timezonedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/core/java/com/android/server/trust/OWNERS b/services/core/java/com/android/server/trust/OWNERS
new file mode 100644
index 0000000..b039c4b
--- /dev/null
+++ b/services/core/java/com/android/server/trust/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/app/trust/OWNERS
diff --git a/services/core/java/com/android/server/tv/OWNERS b/services/core/java/com/android/server/tv/OWNERS
new file mode 100644
index 0000000..305027c
--- /dev/null
+++ b/services/core/java/com/android/server/tv/OWNERS
@@ -0,0 +1 @@
+include /media/java/android/media/tv/OWNERS
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java
index 1754e59..ff5b65b 100755
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -77,6 +77,7 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.text.TextUtils;
+import android.util.ArrayMap;
import android.util.Pair;
import android.util.Slog;
import android.util.SparseArray;
@@ -100,6 +101,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -329,18 +331,27 @@
userState.packageSet.add(si.packageName);
}
+ // sort the input list by input id so that TvInputState.inputNumber is stable.
+ Collections.sort(inputList, Comparator.comparing(TvInputInfo::getId));
Map<String, TvInputState> inputMap = new HashMap<>();
+ ArrayMap<String, Integer> tisInputCount = new ArrayMap<>(inputMap.size());
for (TvInputInfo info : inputList) {
+ String inputId = info.getId();
if (DEBUG) {
- Slog.d(TAG, "add " + info.getId());
+ Slog.d(TAG, "add " + inputId);
}
- TvInputState inputState = userState.inputMap.get(info.getId());
+ // Running count of input for each input service
+ Integer count = tisInputCount.get(inputId);
+ count = count == null ? Integer.valueOf(1) : count + 1;
+ tisInputCount.put(inputId, count);
+ TvInputState inputState = userState.inputMap.get(inputId);
if (inputState == null) {
inputState = new TvInputState();
}
inputState.info = info;
inputState.uid = getInputUid(info);
- inputMap.put(info.getId(), inputState);
+ inputMap.put(inputId, inputState);
+ inputState.inputNumber = count;
}
for (String inputId : inputMap.keySet()) {
@@ -2452,11 +2463,31 @@
*/
private void logTuneStateChanged(int state, SessionState sessionState,
@Nullable TvInputState inputState) {
- // TODO(b/173536904): log input type and id
+ int tisUid = Process.INVALID_UID;
+ int inputType = FrameworkStatsLog.TIF_TUNE_STATE_CHANGED__TYPE__TIF_INPUT_TYPE_UNKNOWN;
+ int inputId = 0;
+ int hdmiPort = 0;
+ if (inputState != null) {
+ tisUid = inputState.uid;
+ inputType = inputState.info.getType();
+ if (inputType == TvInputInfo.TYPE_TUNER) {
+ inputType = FrameworkStatsLog.TIF_TUNE_STATE_CHANGED__TYPE__TUNER;
+ }
+ inputId = inputState.inputNumber;
+ HdmiDeviceInfo hdmiDeviceInfo = inputState.info.getHdmiDeviceInfo();
+ if (hdmiDeviceInfo != null) {
+ hdmiPort = hdmiDeviceInfo.getPortId();
+ }
+ }
FrameworkStatsLog.write(FrameworkStatsLog.TIF_TUNE_CHANGED,
new int[]{sessionState.callingUid,
- inputState == null ? Process.INVALID_UID : inputState.uid},
- new String[]{"tif_player", "tv_input_service"}, state, sessionState.sessionId);
+ tisUid},
+ new String[]{"tif_player", "tv_input_service"},
+ state,
+ sessionState.sessionId,
+ inputType,
+ inputId,
+ hdmiPort);
}
private static final class UserState {
@@ -2569,6 +2600,11 @@
private TvInputInfo info;
/**
+ * ID unique to a specific TvInputService.
+ */
+ private int inputNumber;
+
+ /**
* The kernel user-ID that has been assigned to the application the TvInput is a part of.
*
* <p>
diff --git a/services/core/java/com/android/server/uri/OWNERS b/services/core/java/com/android/server/uri/OWNERS
new file mode 100644
index 0000000..cdc07ed
--- /dev/null
+++ b/services/core/java/com/android/server/uri/OWNERS
@@ -0,0 +1,3 @@
+jsharkey@android.com
+jsharkey@google.com
+varunshah@google.com
diff --git a/services/core/java/com/android/server/vibrator/OWNERS b/services/core/java/com/android/server/vibrator/OWNERS
new file mode 100644
index 0000000..7e7335d
--- /dev/null
+++ b/services/core/java/com/android/server/vibrator/OWNERS
@@ -0,0 +1 @@
+michaelwr@google.com
diff --git a/services/core/java/com/android/server/vibrator/Vibration.java b/services/core/java/com/android/server/vibrator/Vibration.java
index e2cdd02..b0266d0 100644
--- a/services/core/java/com/android/server/vibrator/Vibration.java
+++ b/services/core/java/com/android/server/vibrator/Vibration.java
@@ -47,7 +47,7 @@
FINISHED,
FORWARDED_TO_INPUT_DEVICES,
CANCELLED,
- ERROR_APP_OPS,
+ IGNORED_ERROR_APP_OPS,
IGNORED,
IGNORED_APP_OPS,
IGNORED_BACKGROUND,
diff --git a/services/core/java/com/android/server/vibrator/VibrationSettings.java b/services/core/java/com/android/server/vibrator/VibrationSettings.java
index 6a5d1c4..a34a507 100644
--- a/services/core/java/com/android/server/vibrator/VibrationSettings.java
+++ b/services/core/java/com/android/server/vibrator/VibrationSettings.java
@@ -16,12 +16,18 @@
package com.android.server.vibrator;
+import android.app.ActivityManager;
+import android.app.IUidObserver;
import android.content.Context;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Handler;
+import android.os.PowerManager;
+import android.os.PowerManagerInternal;
+import android.os.PowerSaveState;
+import android.os.RemoteException;
import android.os.UserHandle;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
@@ -30,7 +36,7 @@
import android.util.SparseArray;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.LocalServices;
import java.util.ArrayList;
import java.util.List;
@@ -53,6 +59,7 @@
private final Vibrator mVibrator;
private final AudioManager mAudioManager;
private final SettingsObserver mSettingObserver;
+ private final UidObserver mUidObserver;
@GuardedBy("mLock")
private final List<OnVibratorSettingsChanged> mListeners = new ArrayList<>();
@@ -72,12 +79,15 @@
private int mNotificationIntensity;
@GuardedBy("mLock")
private int mRingIntensity;
+ @GuardedBy("mLock")
+ private boolean mLowPowerMode;
public VibrationSettings(Context context, Handler handler) {
mContext = context;
mVibrator = context.getSystemService(Vibrator.class);
mAudioManager = context.getSystemService(AudioManager.class);
mSettingObserver = new SettingsObserver(handler);
+ mUidObserver = new UidObserver();
registerSettingsObserver(Settings.System.getUriFor(Settings.System.VIBRATE_INPUT_DEVICES));
registerSettingsObserver(Settings.System.getUriFor(Settings.System.VIBRATE_WHEN_RINGING));
@@ -107,6 +117,35 @@
mFallbackEffects.put(VibrationEffect.EFFECT_TEXTURE_TICK,
VibrationEffect.get(VibrationEffect.EFFECT_TICK, false));
+ try {
+ ActivityManager.getService().registerUidObserver(mUidObserver,
+ ActivityManager.UID_OBSERVER_PROCSTATE | ActivityManager.UID_OBSERVER_GONE,
+ ActivityManager.PROCESS_STATE_UNKNOWN, null);
+ } catch (RemoteException e) {
+ // ignored; both services live in system_server
+ }
+
+ PowerManagerInternal pm = LocalServices.getService(PowerManagerInternal.class);
+ pm.registerLowPowerModeObserver(
+ new PowerManagerInternal.LowPowerModeListener() {
+ @Override
+ public int getServiceType() {
+ return PowerManager.ServiceType.VIBRATION;
+ }
+
+ @Override
+ public void onLowPowerModeChanged(PowerSaveState result) {
+ boolean shouldNotifyListeners;
+ synchronized (mLock) {
+ shouldNotifyListeners = result.batterySaverEnabled != mLowPowerMode;
+ mLowPowerMode = result.batterySaverEnabled;
+ }
+ if (shouldNotifyListeners) {
+ notifyListeners();
+ }
+ }
+ });
+
// Update with current values from settings.
updateSettings();
}
@@ -184,12 +223,15 @@
}
/**
- * Return {@code true} if the device should vibrate for ringtones.
+ * Return {@code true} if the device should vibrate for current ringer mode.
*
* <p>This checks the current {@link AudioManager#getRingerModeInternal()} against user settings
- * for vibrations while ringing.
+ * for ringtone usage only. All other usages are allowed independently of ringer mode.
*/
- public boolean shouldVibrateForRingtone() {
+ public boolean shouldVibrateForRingerMode(int usageHint) {
+ if (!isRingtone(usageHint)) {
+ return true;
+ }
int ringerMode = mAudioManager.getRingerModeInternal();
synchronized (mLock) {
if (mVibrateWhenRinging) {
@@ -202,6 +244,28 @@
}
}
+ /**
+ * Returns {@code true} if this vibration is allowed for given {@code uid}.
+ *
+ * <p>This checks if the user is aware of this foreground process, or if the vibration usage is
+ * allowed to play in the background (i.e. it's a notification, ringtone or alarm vibration).
+ */
+ public boolean shouldVibrateForUid(int uid, int usageHint) {
+ return mUidObserver.isUidForeground(uid) || isNotification(usageHint)
+ || isRingtone(usageHint) || isAlarm(usageHint);
+ }
+
+ /**
+ * Returns {@code true} if this vibration is allowed for current power mode state.
+ *
+ * <p>This checks if the device is in battery saver mode, in which case only alarm, ringtone and
+ * {@link VibrationAttributes#USAGE_COMMUNICATION_REQUEST} usages are allowed to vibrate.
+ */
+ public boolean shouldVibrateForPowerMode(int usageHint) {
+ return !mLowPowerMode || isRingtone(usageHint) || isAlarm(usageHint)
+ || usageHint == VibrationAttributes.USAGE_COMMUNICATION_REQUEST;
+ }
+
/** Return {@code true} if input devices should vibrate instead of this device. */
public boolean shouldVibrateInputDevices() {
return mVibrateInputDevices;
@@ -229,9 +293,7 @@
}
/** Updates all vibration settings and triggers registered listeners. */
- @VisibleForTesting
public void updateSettings() {
- List<OnVibratorSettingsChanged> currentListeners;
synchronized (mLock) {
mVibrateWhenRinging = getSystemSetting(Settings.System.VIBRATE_WHEN_RINGING, 0) != 0;
mApplyRampingRinger = getGlobalSetting(Settings.Global.APPLY_RAMPING_RINGER, 0) != 0;
@@ -244,12 +306,8 @@
mVibrator.getDefaultRingVibrationIntensity());
mVibrateInputDevices = getSystemSetting(Settings.System.VIBRATE_INPUT_DEVICES, 0) > 0;
mZenMode = getGlobalSetting(Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF);
- currentListeners = new ArrayList<>(mListeners);
}
-
- for (OnVibratorSettingsChanged listener : currentListeners) {
- listener.onChange();
- }
+ notifyListeners();
}
@Override
@@ -258,9 +316,11 @@
+ "mVibrateInputDevices=" + mVibrateInputDevices
+ ", mVibrateWhenRinging=" + mVibrateWhenRinging
+ ", mApplyRampingRinger=" + mApplyRampingRinger
+ + ", mLowPowerMode=" + mLowPowerMode
+ ", mZenMode=" + Settings.Global.zenModeToString(mZenMode)
+ + ", mProcStatesCache=" + mUidObserver.mProcStatesCache
+ ", mHapticFeedbackIntensity="
- + intensityToString(getCurrentIntensity(VibrationAttributes.USAGE_TOUCH))
+ + intensityToString(getCurrentIntensity(VibrationAttributes.USAGE_TOUCH))
+ ", mHapticFeedbackDefaultIntensity="
+ intensityToString(getDefaultIntensity(VibrationAttributes.USAGE_TOUCH))
+ ", mNotificationIntensity="
@@ -274,6 +334,16 @@
+ '}';
}
+ private void notifyListeners() {
+ List<OnVibratorSettingsChanged> currentListeners;
+ synchronized (mLock) {
+ currentListeners = new ArrayList<>(mListeners);
+ }
+ for (OnVibratorSettingsChanged listener : currentListeners) {
+ listener.onChange();
+ }
+ }
+
private static String intensityToString(int intensity) {
switch (intensity) {
case Vibrator.VIBRATION_INTENSITY_OFF:
@@ -342,4 +412,36 @@
updateSettings();
}
}
+
+ /** Implementation of {@link ContentObserver} to be registered to a setting {@link Uri}. */
+ private final class UidObserver extends IUidObserver.Stub {
+ private final SparseArray<Integer> mProcStatesCache = new SparseArray<>();
+
+ public boolean isUidForeground(int uid) {
+ return mProcStatesCache.get(uid, ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND)
+ <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
+ }
+
+ @Override
+ public void onUidGone(int uid, boolean disabled) {
+ mProcStatesCache.delete(uid);
+ }
+
+ @Override
+ public void onUidActive(int uid) {
+ }
+
+ @Override
+ public void onUidIdle(int uid, boolean disabled) {
+ }
+
+ @Override
+ public void onUidStateChanged(int uid, int procState, long procStateSeq, int capability) {
+ mProcStatesCache.put(uid, procState);
+ }
+
+ @Override
+ public void onUidCachedChanged(int uid, boolean cached) {
+ }
+ }
}
diff --git a/services/core/java/com/android/server/vibrator/VibratorController.java b/services/core/java/com/android/server/vibrator/VibratorController.java
index f76c1a1..311c73b 100644
--- a/services/core/java/com/android/server/vibrator/VibratorController.java
+++ b/services/core/java/com/android/server/vibrator/VibratorController.java
@@ -23,7 +23,7 @@
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.VibrationEffect;
-import android.os.Vibrator;
+import android.os.VibratorInfo;
import android.util.Slog;
import com.android.internal.annotations.GuardedBy;
@@ -31,10 +31,6 @@
import libcore.util.NativeAllocationRegistry;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
/** Controls a single vibrator. */
// TODO(b/159207608): Make this package-private once vibrator services are moved to this package
public final class VibratorController {
@@ -42,12 +38,7 @@
private final Object mLock = new Object();
private final NativeWrapper mNativeWrapper;
- private final int mVibratorId;
- private final long mCapabilities;
- @Nullable
- private final Set<Integer> mSupportedEffects;
- @Nullable
- private final Set<Integer> mSupportedPrimitives;
+ private final VibratorInfo mVibratorInfo;
@GuardedBy("mLock")
private final RemoteCallbackList<IVibratorStateListener> mVibratorStateListeners =
@@ -115,13 +106,11 @@
@VisibleForTesting
public VibratorController(int vibratorId, OnVibrationCompleteListener listener,
NativeWrapper nativeWrapper) {
- mVibratorId = vibratorId;
mNativeWrapper = nativeWrapper;
+ mNativeWrapper.init(vibratorId, listener);
- nativeWrapper.init(vibratorId, listener);
- mCapabilities = nativeWrapper.getCapabilities();
- mSupportedEffects = asSet(nativeWrapper.getSupportedEffects());
- mSupportedPrimitives = asSet(nativeWrapper.getSupportedPrimitives());
+ mVibratorInfo = new VibratorInfo(vibratorId, nativeWrapper.getCapabilities(),
+ nativeWrapper.getSupportedEffects(), nativeWrapper.getSupportedPrimitives());
}
/** Register state listener for this vibrator. */
@@ -153,9 +142,9 @@
}
}
- /** Return the id of the vibrator controlled by this instance. */
- public int getVibratorId() {
- return mVibratorId;
+ /** Return the {@link VibratorInfo} representing the vibrator controlled by this instance. */
+ public VibratorInfo getVibratorInfo() {
+ return mVibratorInfo;
}
/**
@@ -184,43 +173,7 @@
* @return true if this vibrator has this capability, false otherwise
*/
public boolean hasCapability(long capability) {
- return (mCapabilities & capability) == capability;
- }
-
- /**
- * Check against this vibrator supported effects.
- *
- * @param effectIds list of effects, one of VibrationEffect.EFFECT_*
- * @return one entry per requested effectId, with one of Vibrator.VIBRATION_EFFECT_SUPPORT_*
- */
- public int[] areEffectsSupported(int[] effectIds) {
- int[] supported = new int[effectIds.length];
- if (mSupportedEffects == null) {
- Arrays.fill(supported, Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN);
- } else {
- for (int i = 0; i < effectIds.length; i++) {
- supported[i] = mSupportedEffects.contains(effectIds[i])
- ? Vibrator.VIBRATION_EFFECT_SUPPORT_YES
- : Vibrator.VIBRATION_EFFECT_SUPPORT_NO;
- }
- }
- return supported;
- }
-
- /**
- * Check against this vibrator supported primitives.
- *
- * @param primitiveIds list of primitives, one of VibrationEffect.Composition.EFFECT_*
- * @return one entry per requested primitiveId, with true if it is supported
- */
- public boolean[] arePrimitivesSupported(int[] primitiveIds) {
- boolean[] supported = new boolean[primitiveIds.length];
- if (mSupportedPrimitives != null && hasCapability(IVibrator.CAP_COMPOSE_EFFECTS)) {
- for (int i = 0; i < primitiveIds.length; i++) {
- supported[i] = mSupportedPrimitives.contains(primitiveIds[i]);
- }
- }
- return supported;
+ return mVibratorInfo.hasCapability(capability);
}
/** Return {@code true} if the underlying vibrator is currently available, false otherwise. */
@@ -234,7 +187,7 @@
* <p>This will affect the state of {@link #isUnderExternalControl()}.
*/
public void setExternalControl(boolean externalControl) {
- if (!hasCapability(IVibrator.CAP_EXTERNAL_CONTROL)) {
+ if (!mVibratorInfo.hasCapability(IVibrator.CAP_EXTERNAL_CONTROL)) {
return;
}
synchronized (mLock) {
@@ -248,7 +201,7 @@
* if given {@code effect} is {@code null}.
*/
public void updateAlwaysOn(int id, @Nullable VibrationEffect.Prebaked effect) {
- if (!hasCapability(IVibrator.CAP_ALWAYS_ON_CONTROL)) {
+ if (!mVibratorInfo.hasCapability(IVibrator.CAP_ALWAYS_ON_CONTROL)) {
return;
}
synchronized (mLock) {
@@ -263,7 +216,7 @@
/** Set the vibration amplitude. This will NOT affect the state of {@link #isVibrating()}. */
public void setAmplitude(int amplitude) {
synchronized (mLock) {
- if (hasCapability(IVibrator.CAP_AMPLITUDE_CONTROL)) {
+ if (mVibratorInfo.hasCapability(IVibrator.CAP_AMPLITUDE_CONTROL)) {
mNativeWrapper.setAmplitude(amplitude);
}
}
@@ -306,7 +259,7 @@
* <p>This will affect the state of {@link #isVibrating()}.
*/
public void on(VibrationEffect.Composed effect, long vibrationId) {
- if (!hasCapability(IVibrator.CAP_COMPOSE_EFFECTS)) {
+ if (!mVibratorInfo.hasCapability(IVibrator.CAP_COMPOSE_EFFECTS)) {
return;
}
synchronized (mLock) {
@@ -327,10 +280,7 @@
@Override
public String toString() {
return "VibratorController{"
- + "mVibratorId=" + mVibratorId
- + ", mCapabilities=" + mCapabilities
- + ", mSupportedEffects=" + mSupportedEffects
- + ", mSupportedPrimitives=" + mSupportedPrimitives
+ + "mVibratorInfo=" + mVibratorInfo
+ ", mIsVibrating=" + mIsVibrating
+ ", mIsUnderExternalControl=" + mIsUnderExternalControl
+ ", mVibratorStateListeners count="
@@ -375,18 +325,6 @@
}
}
- @Nullable
- private static Set<Integer> asSet(int[] values) {
- if (values == null) {
- return null;
- }
- HashSet<Integer> set = new HashSet<>();
- for (int value : values) {
- set.add(value);
- }
- return set;
- }
-
/** Wrapper around the static-native methods of {@link VibratorController} for tests. */
@VisibleForTesting
public static class NativeWrapper {
diff --git a/services/core/java/com/android/server/wallpaper/IWallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/IWallpaperManagerService.java
index 60b08dd..a4ddf11 100644
--- a/services/core/java/com/android/server/wallpaper/IWallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/IWallpaperManagerService.java
@@ -29,7 +29,7 @@
void onBootPhase(int phase);
/**
- * @see com.android.server.SystemService#onUnlockUser(int)
+ * @see com.android.server.SystemService#onUserUnlocking
*/
void onUnlockUser(final int userId);
}
\ No newline at end of file
diff --git a/services/core/java/com/android/server/wallpaper/OWNERS b/services/core/java/com/android/server/wallpaper/OWNERS
new file mode 100644
index 0000000..8ff0f74
--- /dev/null
+++ b/services/core/java/com/android/server/wallpaper/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/wallpaper/OWNERS
diff --git a/services/core/java/com/android/server/wm/ActivityClientController.java b/services/core/java/com/android/server/wm/ActivityClientController.java
index 9f1152c..85fcd3d 100644
--- a/services/core/java/com/android/server/wm/ActivityClientController.java
+++ b/services/core/java/com/android/server/wm/ActivityClientController.java
@@ -538,6 +538,22 @@
}
@Override
+ public int getLaunchedFromUid(IBinder token) {
+ synchronized (mGlobalLock) {
+ final ActivityRecord r = ActivityRecord.forTokenLocked(token);
+ return r != null ? r.launchedFromUid : android.os.Process.INVALID_UID;
+ }
+ }
+
+ @Override
+ public String getLaunchedFromPackage(IBinder token) {
+ synchronized (mGlobalLock) {
+ final ActivityRecord r = ActivityRecord.forTokenLocked(token);
+ return r != null ? r.launchedFromPackage : null;
+ }
+ }
+
+ @Override
public Bundle getActivityOptions(IBinder token) {
final long origId = Binder.clearCallingIdentity();
try {
diff --git a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
index 6a50b79..b084787 100644
--- a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
@@ -631,6 +631,10 @@
if (info.mLoggedTransitionStarting && info.allDrawn()) {
done(false /* abort */, info, "notifyWindowsDrawn - all windows drawn", timestampNs);
}
+ if (r.mWmService.isRecentsAnimationTarget(r)) {
+ r.mWmService.getRecentsAnimationController().logRecentsAnimationStartTime(
+ info.mSourceEventDelayMs + info.mWindowsDrawnDelayMs);
+ }
return infoSnapshot;
}
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 743796b..4c18310 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -95,18 +95,18 @@
import static android.view.Display.INVALID_DISPLAY;
import static android.view.Surface.ROTATION_270;
import static android.view.Surface.ROTATION_90;
-import static android.view.WindowManager.TRANSIT_CLOSE;
-import static android.view.WindowManager.TRANSIT_OLD_ACTIVITY_CLOSE;
-import static android.view.WindowManager.TRANSIT_OLD_TASK_CLOSE;
-import static android.view.WindowManager.TRANSIT_OLD_TASK_OPEN_BEHIND;
-import static android.view.WindowManager.TRANSIT_OLD_UNSET;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_OPEN_BEHIND;
+import static android.view.WindowManager.TRANSIT_OLD_ACTIVITY_CLOSE;
+import static android.view.WindowManager.TRANSIT_OLD_TASK_CLOSE;
+import static android.view.WindowManager.TRANSIT_OLD_UNSET;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
@@ -182,7 +182,6 @@
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;
-import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
import static com.android.server.wm.Task.ActivityState.DESTROYED;
import static com.android.server.wm.Task.ActivityState.DESTROYING;
import static com.android.server.wm.Task.ActivityState.FINISHING;
@@ -194,6 +193,7 @@
import static com.android.server.wm.Task.ActivityState.STARTED;
import static com.android.server.wm.Task.ActivityState.STOPPED;
import static com.android.server.wm.Task.ActivityState.STOPPING;
+import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
import static com.android.server.wm.TaskPersister.DEBUG;
import static com.android.server.wm.TaskPersister.IMAGE_EXTENSION;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
@@ -1366,7 +1366,6 @@
} else if (mLetterbox != null) {
mLetterbox.hide();
}
- task.maybeUpdateLetterboxBounds(this, getLetterboxParams(w));
}
void updateLetterboxSurface(WindowState winHint) {
@@ -1380,12 +1379,6 @@
}
}
- @Nullable
- private Rect getLetterboxParams(WindowState w) {
- boolean isLetterboxed = w.isLetterboxedAppWindow() && fillsParent();
- return isLetterboxed ? getBounds() : null;
- }
-
Rect getLetterboxInsets() {
if (mLetterbox != null) {
return mLetterbox.getInsets();
@@ -2562,7 +2555,7 @@
}
final Task rootTask = getRootTask();
- final boolean mayAdjustTop = (isState(RESUMED) || rootTask.mResumedActivity == null)
+ final boolean mayAdjustTop = (isState(RESUMED) || rootTask.getResumedActivity() == null)
&& rootTask.isFocusedStackOnDisplay()
// Do not adjust focus task because the task will be reused to launch new activity.
&& !task.isClearingToReuseTask();
@@ -2634,12 +2627,12 @@
// Tell window manager to prepare for this one to be removed.
setVisibility(false);
- if (rootTask.mPausingActivity == null) {
+ if (task.getPausingActivity() == null) {
ProtoLog.v(WM_DEBUG_STATES, "Finish needs to pause: %s", this);
if (DEBUG_USER_LEAVING) {
Slog.v(TAG_USER_LEAVING, "finish() => pause with userLeaving=false");
}
- rootTask.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
+ task.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
null /* resuming */, "finish");
}
@@ -2727,7 +2720,7 @@
final boolean isCurrentVisible = mVisibleRequested || isState(PAUSED);
if (isCurrentVisible) {
final Task stack = getStack();
- final ActivityRecord activity = stack.mResumedActivity;
+ final ActivityRecord activity = stack.getResumedActivity();
boolean ensureVisibility = false;
if (activity != null && !activity.occludesParent()) {
// If the resume activity is not opaque, we need to make sure the visibilities of
@@ -2955,10 +2948,10 @@
boolean safelyDestroy(String reason) {
if (isDestroyable()) {
if (DEBUG_SWITCH) {
- final Task stack = getRootTask();
+ final Task task = getTask();
Slog.v(TAG_SWITCH, "Safely destroying " + this + " in state " + getState()
- + " resumed=" + stack.mResumedActivity
- + " pausing=" + stack.mPausingActivity
+ + " resumed=" + task.getResumedActivity()
+ + " pausing=" + task.getPausingActivity()
+ " for reason " + reason);
}
return destroyImmediately(reason);
@@ -3131,7 +3124,7 @@
SurfaceControl.openTransaction();
for (int i = mChildren.size() - 1; i >= 0; i--) {
final WindowState w = mChildren.get(i);
- w.mWinAnimator.detachChildren();
+ w.mWinAnimator.detachChildren(getGlobalTransaction());
}
SurfaceControl.closeTransaction();
}
@@ -4443,7 +4436,8 @@
SurfaceControl.openTransaction();
try {
forAllWindows(win -> {
- win.mWinAnimator.hide("immediately hidden"); }, true);
+ win.mWinAnimator.hide(getGlobalTransaction(), "immediately hidden");
+ }, true);
} finally {
SurfaceControl.closeTransaction();
}
@@ -4835,7 +4829,7 @@
// If the app is capable of entering PIP, we should try pausing it now
// so it can PIP correctly.
if (deferHidingClient) {
- getRootTask().startPausingLocked(userLeaving, false /* uiSleeping */,
+ task.startPausingLocked(userLeaving, false /* uiSleeping */,
null /* resuming */, "makeInvisible");
break;
}
@@ -5066,25 +5060,24 @@
ProtoLog.v(WM_DEBUG_STATES, "Activity paused: token=%s, timeout=%b", appToken,
timeout);
- final Task stack = getStack();
-
- if (stack != null) {
+ if (task != null) {
removePauseTimeout();
- if (stack.mPausingActivity == this) {
+ final ActivityRecord pausingActivity = task.getPausingActivity();
+ if (pausingActivity == this) {
ProtoLog.v(WM_DEBUG_STATES, "Moving to PAUSED: %s %s", this,
(timeout ? "(due to timeout)" : " (pause complete)"));
mAtmService.deferWindowLayout();
try {
- stack.completePauseLocked(true /* resumeNext */, null /* resumingActivity */);
+ task.completePauseLocked(true /* resumeNext */, null /* resumingActivity */);
} finally {
mAtmService.continueWindowLayout();
}
return;
} else {
EventLogTags.writeWmFailedToPause(mUserId, System.identityHashCode(this),
- shortComponentName, stack.mPausingActivity != null
- ? stack.mPausingActivity.shortComponentName : "(none)");
+ shortComponentName, pausingActivity != null
+ ? pausingActivity.shortComponentName : "(none)");
if (isState(PAUSING)) {
setState(PAUSED, "activityPausedLocked");
if (finishing) {
@@ -5182,10 +5175,9 @@
void activityStopped(Bundle newIcicle, PersistableBundle newPersistentState,
CharSequence description) {
- final Task stack = getRootTask();
final boolean isStopping = mState == STOPPING;
if (!isStopping && mState != RESTARTING_PROCESS) {
- Slog.i(TAG, "Activity reported stop, but no longer stopping: " + this);
+ Slog.i(TAG, "Activity reported stop, but no longer stopping: " + this + " " + mState);
removeStopTimeout();
return;
}
@@ -5222,6 +5214,7 @@
mRootWindowContainer.updatePreviousProcess(this);
}
}
+ mTaskSupervisor.checkReadyForSleepLocked(true /* allowDelay */);
}
}
@@ -5714,14 +5707,14 @@
// First find the real culprit... if this activity has stopped, then the key dispatching
// timeout should not be caused by this.
if (stopped) {
- final Task stack = mRootWindowContainer.getTopDisplayFocusedRootTask();
- if (stack == null) {
+ final Task rootTask = mRootWindowContainer.getTopDisplayFocusedRootTask();
+ if (rootTask == null) {
return this;
}
// Try to use the one which is closest to top.
- ActivityRecord r = stack.getResumedActivity();
+ ActivityRecord r = rootTask.getResumedActivity();
if (r == null) {
- r = stack.mPausingActivity;
+ r = rootTask.getPausingActivity();
}
if (r != null) {
return r;
@@ -5799,9 +5792,8 @@
// This would be redundant.
return false;
}
- final Task stack = getRootTask();
- if (isState(RESUMED) || stack == null || this == stack.mPausingActivity || !mHaveState
- || !stopped) {
+ if (isState(RESUMED) || getRootTask() == null || this == task.getPausingActivity()
+ || !mHaveState || !stopped) {
// We're not ready for this kind of thing.
return false;
}
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 1ff3a3f..ecbf266 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -2647,7 +2647,11 @@
if (next != null) {
next.setCurrentLaunchCanTurnScreenOn(true);
}
- mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetStack, null, mOptions);
+ if (mTargetStack.isFocusable()) {
+ mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetStack, null, mOptions);
+ } else {
+ mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
+ }
} else {
ActivityOptions.abort(mOptions);
}
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java b/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java
index a5df2a6..f8b3c1b 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java
@@ -386,6 +386,10 @@
public abstract void clearPendingResultForActivity(
IBinder activityToken, WeakReference<PendingIntentRecord> pir);
+ /** Returns the component name of the activity token. */
+ @Nullable
+ public abstract ComponentName getActivityName(IBinder activityToken);
+
/**
* @return the activity token and IApplicationThread for the top activity in the task or null
* if there isn't a top activity with a valid process.
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 8298dfd..a2b0990 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -1133,9 +1133,10 @@
synchronized (mGlobalLock) {
// If this is coming from the currently resumed activity, it is
// effectively saying that app switches are allowed at this point.
- final Task stack = getTopDisplayFocusedRootTask();
- if (stack != null && stack.mResumedActivity != null
- && stack.mResumedActivity.info.applicationInfo.uid == Binder.getCallingUid()) {
+ final Task topFocusedRootTask = getTopDisplayFocusedRootTask();
+ if (topFocusedRootTask != null && topFocusedRootTask.getResumedActivity() != null
+ && topFocusedRootTask.getResumedActivity().info.applicationInfo.uid
+ == Binder.getCallingUid()) {
mAppSwitchesAllowedTime = 0;
}
}
@@ -1743,29 +1744,6 @@
}
}
- @Override
- public int getLaunchedFromUid(IBinder activityToken) {
- ActivityRecord srec;
- synchronized (mGlobalLock) {
- srec = ActivityRecord.forTokenLocked(activityToken);
- }
- if (srec == null) {
- return -1;
- }
- return srec.launchedFromUid;
- }
-
- @Override
- public String getLaunchedFromPackage(IBinder activityToken) {
- ActivityRecord srec;
- synchronized (mGlobalLock) {
- srec = ActivityRecord.forTokenLocked(activityToken);
- }
- if (srec == null) {
- return null;
- }
- return srec.launchedFromPackage;
- }
@Override
public RootTaskInfo getFocusedRootTaskInfo() throws RemoteException {
@@ -2560,9 +2538,7 @@
@Override
public int getLockTaskModeState() {
- synchronized (mGlobalLock) {
- return getLockTaskController().getLockTaskModeState();
- }
+ return getLockTaskController().getLockTaskModeState();
}
@Override
@@ -3228,28 +3204,6 @@
}
@Override
- public ComponentName getActivityClassForToken(IBinder token) {
- synchronized (mGlobalLock) {
- ActivityRecord r = ActivityRecord.isInStackLocked(token);
- if (r == null) {
- return null;
- }
- return r.intent.getComponent();
- }
- }
-
- @Override
- public String getPackageForToken(IBinder token) {
- synchronized (mGlobalLock) {
- ActivityRecord r = ActivityRecord.isInStackLocked(token);
- if (r == null) {
- return null;
- }
- return r.packageName;
- }
- }
-
- @Override
public void keyguardGoingAway(int flags) {
enforceNotIsolatedCaller("keyguardGoingAway");
final long token = Binder.clearCallingIdentity();
@@ -4708,8 +4662,11 @@
.setContentTitle(text)
.setContentText(
mContext.getText(R.string.heavy_weight_notification_detail))
+ // TODO(b/175194709) Please replace FLAG_MUTABLE_UNAUDITED below
+ // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
.setContentIntent(PendingIntent.getActivityAsUser(mContext, 0,
- intent, PendingIntent.FLAG_CANCEL_CURRENT, null,
+ intent, PendingIntent.FLAG_CANCEL_CURRENT
+ | PendingIntent.FLAG_MUTABLE_UNAUDITED, null,
new UserHandle(userId)))
.build();
try {
@@ -5596,6 +5553,14 @@
}
@Override
+ public ComponentName getActivityName(IBinder activityToken) {
+ synchronized (mGlobalLock) {
+ final ActivityRecord r = ActivityRecord.isInStackLocked(activityToken);
+ return r != null ? r.intent.getComponent() : null;
+ }
+ }
+
+ @Override
public ActivityTokens getTopActivityForTask(int taskId) {
synchronized (mGlobalLock) {
final Task task = mRootWindowContainer.anyTaskForId(taskId);
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index 73d9972..400633c 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -88,6 +88,7 @@
import android.app.ActivityManagerInternal;
import android.app.ActivityOptions;
import android.app.AppOpsManager;
+import android.app.IActivityClientController;
import android.app.ProfilerInfo;
import android.app.ResultInfo;
import android.app.WaitResult;
@@ -795,6 +796,11 @@
+ " old=" + r.app + " new=" + proc);
}
+ // Send the controller to client if the process is the first time to launch activity.
+ // So the client can save binder transactions of getting the controller from activity
+ // task manager service.
+ final IActivityClientController activityClientController =
+ proc.hasEverLaunchedActivity() ? null : mService.mActivityClientController;
r.launchCount++;
r.lastLaunchTime = SystemClock.uptimeMillis();
proc.setLastActivityLaunchTime(r.lastLaunchTime);
@@ -863,7 +869,8 @@
r.launchedFromPackage, task.voiceInteractor, proc.getReportedProcState(),
r.getSavedState(), r.getPersistentSavedState(), results, newIntents,
dc.isNextTransitionForward(), proc.createProfilerInfoIfNeeded(),
- r.assistToken, r.createFixedRotationAdjustmentsIfNeeded()));
+ r.assistToken, activityClientController,
+ r.createFixedRotationAdjustmentsIfNeeded()));
// Set desired final state.
final ActivityLifecycleItem lifecycleItem;
@@ -2059,7 +2066,7 @@
void updateTopResumedActivityIfNeeded() {
final ActivityRecord prevTopActivity = mTopResumedActivity;
final Task topStack = mRootWindowContainer.getTopDisplayFocusedRootTask();
- if (topStack == null || topStack.mResumedActivity == prevTopActivity) {
+ if (topStack == null || topStack.getResumedActivity() == prevTopActivity) {
if (mService.isSleepingLocked()) {
// There won't be a next resumed activity. The top process should still be updated
// according to the current top focused activity.
@@ -2081,7 +2088,7 @@
}
// Update the current top activity.
- mTopResumedActivity = topStack.mResumedActivity;
+ mTopResumedActivity = topStack.getResumedActivity();
scheduleTopResumedActivityStateIfNeeded();
mService.updateTopApp(mTopResumedActivity);
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 758aaa0..605a23e 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -17,7 +17,7 @@
package com.android.server.wm;
import static android.view.WindowManager.LayoutParams;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
@@ -2092,8 +2092,8 @@
case TRANSIT_RELAUNCH: {
return "TRANSIT_RELAUNCH";
}
- case TRANSIT_CHANGE_WINDOWING_MODE: {
- return "TRANSIT_CHANGE_WINDOWING_MODE";
+ case TRANSIT_CHANGE: {
+ return "TRANSIT_CHANGE";
}
case TRANSIT_KEYGUARD_GOING_AWAY: {
return "TRANSIT_KEYGUARD_GOING_AWAY";
diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java
index 64cbb0de..dde527d 100644
--- a/services/core/java/com/android/server/wm/AppTransitionController.java
+++ b/services/core/java/com/android/server/wm/AppTransitionController.java
@@ -17,7 +17,7 @@
package com.android.server.wm;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
@@ -303,7 +303,7 @@
// Special transitions
// TODO(new-app-transitions): Revisit if those can be rewritten by using flags.
- if (appTransition.containsTransitRequest(TRANSIT_CHANGE_WINDOWING_MODE)) {
+ if (appTransition.containsTransitRequest(TRANSIT_CHANGE)) {
return TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE;
}
if ((flags & TRANSIT_FLAG_APP_CRASHED) != 0) {
diff --git a/services/core/java/com/android/server/wm/DisplayAreaPolicy.java b/services/core/java/com/android/server/wm/DisplayAreaPolicy.java
index d4b319a..f8c3754 100644
--- a/services/core/java/com/android/server/wm/DisplayAreaPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayAreaPolicy.java
@@ -99,23 +99,41 @@
// Define the features that will be supported under the root of the whole logical
// display. The policy will build the DisplayArea hierarchy based on this.
- HierarchyBuilder rootHierarchy = new HierarchyBuilder(root)
- // WindowedMagnification should be on the top so that there is only one surface
- // to be magnified.
- .addFeature(new Feature.Builder(wmService.mPolicy, "WindowedMagnification",
- FEATURE_WINDOWED_MAGNIFICATION)
- .upTo(TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY)
- .except(TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY)
- // Make the DA dimmable so that the magnify window also mirrors the dim
- // layer
- .setNewDisplayAreaSupplier(DisplayArea.Dimmable::new)
- .build())
- .addFeature(new Feature.Builder(wmService.mPolicy, "HideDisplayCutout",
- FEATURE_HIDE_DISPLAY_CUTOUT)
- .all()
- .except(TYPE_NAVIGATION_BAR, TYPE_NAVIGATION_BAR_PANEL, TYPE_STATUS_BAR,
- TYPE_NOTIFICATION_SHADE)
- .build())
+ final HierarchyBuilder rootHierarchy = new HierarchyBuilder(root);
+ if (content.isTrusted()) {
+ // Only trusted display can have system decorations.
+ configureTrustedHierarchyBuilder(rootHierarchy, wmService, content);
+ }
+ // Set the essential containers (even the display doesn't support IME).
+ rootHierarchy.setImeContainer(imeContainer).setTaskDisplayAreas(tdaList);
+
+ // Instantiate the policy with the hierarchy defined above. This will create and attach
+ // all the necessary DisplayAreas to the root.
+ return new DisplayAreaPolicyBuilder().setRootHierarchy(rootHierarchy).build(wmService);
+ }
+
+ private void configureTrustedHierarchyBuilder(HierarchyBuilder rootHierarchy,
+ WindowManagerService wmService, DisplayContent content) {
+ // WindowedMagnification should be on the top so that there is only one surface
+ // to be magnified.
+ rootHierarchy.addFeature(new Feature.Builder(wmService.mPolicy, "WindowedMagnification",
+ FEATURE_WINDOWED_MAGNIFICATION)
+ .upTo(TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY)
+ .except(TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY)
+ // Make the DA dimmable so that the magnify window also mirrors the dim layer.
+ .setNewDisplayAreaSupplier(DisplayArea.Dimmable::new)
+ .build());
+ if (content.isDefaultDisplay) {
+ // Only default display can have cutout.
+ // See LocalDisplayAdapter.LocalDisplayDevice#getDisplayDeviceInfoLocked.
+ rootHierarchy.addFeature(new Feature.Builder(wmService.mPolicy, "HideDisplayCutout",
+ FEATURE_HIDE_DISPLAY_CUTOUT)
+ .all()
+ .except(TYPE_NAVIGATION_BAR, TYPE_NAVIGATION_BAR_PANEL,
+ TYPE_STATUS_BAR, TYPE_NOTIFICATION_SHADE)
+ .build());
+ }
+ rootHierarchy
.addFeature(new Feature.Builder(wmService.mPolicy, "OneHanded",
FEATURE_ONE_HANDED)
.all()
@@ -131,13 +149,7 @@
.addFeature(new Feature.Builder(wmService.mPolicy, "ImePlaceholder",
FEATURE_IME_PLACEHOLDER)
.and(TYPE_INPUT_METHOD, TYPE_INPUT_METHOD_DIALOG)
- .build())
- .setImeContainer(imeContainer)
- .setTaskDisplayAreas(tdaList);
-
- // Instantiate the policy with the hierarchy defined above. This will create and attach
- // all the necessary DisplayAreas to the root.
- return new DisplayAreaPolicyBuilder().setRootHierarchy(rootHierarchy).build(wmService);
+ .build());
}
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index e88f8e3..8d6d981 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -80,6 +80,7 @@
import static android.window.DisplayAreaOrganizer.FEATURE_ROOT;
import static android.window.DisplayAreaOrganizer.FEATURE_WINDOWED_MAGNIFICATION;
+import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_BOOT;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_FOCUS;
@@ -552,24 +553,56 @@
* This just indicates the window the input method is on top of, not
* necessarily the window its input is going to.
*/
- WindowState mInputMethodTarget;
+ private WindowState mImeLayeringTarget;
/**
* The window which receives input from the input method. This is also a candidate of the
* input method control target.
*/
- WindowState mInputMethodInputTarget;
+ private WindowState mImeInputTarget;
/**
* This controls the visibility and animation of the input method window.
*/
- InsetsControlTarget mInputMethodControlTarget;
+ private InsetsControlTarget mImeControlTarget;
+
+ /**
+ * Used by {@link #getImeTarget} to return the IME target which the input method window on
+ * top of for adjusting input method window surface layer Z-Ordering.
+ *
+ * @see #mImeLayeringTarget
+ */
+ static final int IME_TARGET_LAYERING = 0;
+
+ /**
+ * Used by {@link #getImeTarget} to return the IME target which received the input connection
+ * from IME.
+ *
+ * @see #mImeInputTarget
+ */
+ static final int IME_TARGET_INPUT = 1;
+
+ /**
+ * Used by {@link #getImeTarget} to return the IME target which controls the IME insets
+ * visibility and animation.
+ *
+ * @see #mImeControlTarget
+ */
+ static final int IME_TARGET_CONTROL = 2;
+
+ @IntDef(flag = false, prefix = { "IME_TARGET_" }, value = {
+ IME_TARGET_LAYERING,
+ IME_TARGET_INPUT,
+ IME_TARGET_CONTROL,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface InputMethodTarget {}
/** The surface parent of the IME container. */
private SurfaceControl mInputMethodSurfaceParent;
- /** If true hold off on modifying the animation layer of mInputMethodTarget */
- boolean mInputMethodTargetWaitingAnim;
+ /** If {@code true} hold off on modifying the animation layer of {@link #mImeLayeringTarget} */
+ boolean mImeLayeringTargetWaitingAnim;
private final PointerEventDispatcher mPointerEventDispatcher;
@@ -814,7 +847,7 @@
private final Consumer<WindowState> mApplyPostLayoutPolicy =
w -> getDisplayPolicy().applyPostLayoutPolicyLw(w, w.mAttrs, w.getParentWindow(),
- mInputMethodTarget);
+ mImeLayeringTarget);
private final Consumer<WindowState> mApplySurfaceChangesTransaction = w -> {
final WindowSurfacePlacer surfacePlacer = mWmService.mWindowPlacerLocked;
@@ -2256,13 +2289,15 @@
@Nullable
Task getRootTask(int rootTaskId) {
- return getItemFromTaskDisplayAreas(taskDisplayArea ->
- taskDisplayArea.getRootTask(rootTaskId));
+ return getRootTask(rootTask -> rootTask.getRootTaskId() == rootTaskId);
}
- protected int getRootTaskCount() {
- return reduceOnAllTaskDisplayAreas((taskDisplayArea, count) ->
- count + taskDisplayArea.getRootTaskCount(), 0 /* initValue */);
+ int getRootTaskCount() {
+ final int[] count = new int[1];
+ forAllRootTasks(task -> {
+ count[0]++;
+ });
+ return count[0];
}
@VisibleForTesting
@@ -2298,10 +2333,6 @@
.setSubtype(getConfiguration().orientation)
.addTaggedData(MetricsEvent.FIELD_DISPLAY_ID, getDisplayId()));
}
-
- if (mPinnedStackControllerLocked != null) {
- mPinnedStackControllerLocked.onDisplayInfoChanged(getDisplayInfo());
- }
}
/**
@@ -2835,7 +2866,7 @@
}
void prepareFreezingTaskBounds() {
- forAllTaskDisplayAreas(TaskDisplayArea::prepareFreezingTaskBounds);
+ forAllRootTasks(Task::prepareFreezingTaskBounds);
}
void rotateBounds(int oldRotation, int newRotation, Rect bounds) {
@@ -2944,15 +2975,15 @@
proto.write(FOCUSED_ROOT_TASK_ID, INVALID_TASK_ID);
}
proto.write(DISPLAY_READY, isReady());
- if (mInputMethodTarget != null) {
- mInputMethodTarget.dumpDebug(proto, INPUT_METHOD_TARGET, logLevel);
+ if (mImeLayeringTarget != null) {
+ mImeLayeringTarget.dumpDebug(proto, INPUT_METHOD_TARGET, logLevel);
}
- if (mInputMethodInputTarget != null) {
- mInputMethodInputTarget.dumpDebug(proto, INPUT_METHOD_INPUT_TARGET, logLevel);
+ if (mImeInputTarget != null) {
+ mImeInputTarget.dumpDebug(proto, INPUT_METHOD_INPUT_TARGET, logLevel);
}
- if (mInputMethodControlTarget != null
- && mInputMethodControlTarget.getWindow() != null) {
- mInputMethodControlTarget.getWindow().dumpDebug(proto, INPUT_METHOD_CONTROL_TARGET,
+ if (mImeControlTarget != null
+ && mImeControlTarget.getWindow() != null) {
+ mImeControlTarget.getWindow().dumpDebug(proto, INPUT_METHOD_CONTROL_TARGET,
logLevel);
}
if (mCurrentFocus != null) {
@@ -3208,7 +3239,7 @@
boolean imWindowChanged = false;
final WindowState imWindow = mInputMethodWindow;
if (imWindow != null) {
- final WindowState prevTarget = mInputMethodTarget;
+ final WindowState prevTarget = mImeLayeringTarget;
final WindowState newTarget = computeImeTarget(true /* updateImeTarget*/);
imWindowChanged = prevTarget != newTarget;
@@ -3405,6 +3436,7 @@
boolean destroyLeakedSurfaces() {
// Used to indicate that a surface was leaked.
mTmpWindow = null;
+ final Transaction t = mWmService.mTransactionFactory.get();
forAllWindows(w -> {
final WindowStateAnimator wsa = w.mWinAnimator;
if (wsa.mSurfaceController == null) {
@@ -3416,7 +3448,7 @@
+ " token=" + w.mToken
+ " pid=" + w.mSession.mPid
+ " uid=" + w.mSession.mUid);
- wsa.destroySurface();
+ wsa.destroySurface(t);
mWmService.mForceRemoves.add(w);
mTmpWindow = w;
} else if (w.mActivityRecord != null && !w.mActivityRecord.isClientVisible()) {
@@ -3424,10 +3456,11 @@
+ w + " surface=" + wsa.mSurfaceController
+ " token=" + w.mActivityRecord);
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE LEAK DESTROY: %s", w);
- wsa.destroySurface();
+ wsa.destroySurface(t);
mTmpWindow = w;
}
}, false /* traverseTopToBottom */);
+ t.apply();
return mTmpWindow != null;
}
@@ -3460,7 +3493,7 @@
}
/**
- * Determine and return the window that should be the IME target.
+ * Determine and return the window that should be the IME target for layering the IME window.
* @param updateImeTarget If true the system IME target will be updated to match what we found.
* @return The window that should be used as the IME target or null if there isn't any.
*/
@@ -3469,13 +3502,13 @@
// There isn't an IME so there shouldn't be a target...That was easy!
if (updateImeTarget) {
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from "
- + mInputMethodTarget + " to null since mInputMethodWindow is null");
- setInputMethodTarget(null, mInputMethodTargetWaitingAnim);
+ + mImeLayeringTarget + " to null since mInputMethodWindow is null");
+ setImeLayeringTarget(null, mImeLayeringTargetWaitingAnim);
}
return null;
}
- final WindowState curTarget = mInputMethodTarget;
+ final WindowState curTarget = mImeLayeringTarget;
if (!canUpdateImeTarget()) {
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Defer updating IME target");
return curTarget;
@@ -3530,7 +3563,7 @@
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget
+ " to null." + (SHOW_STACK_CRAWLS ? " Callers="
+ Debug.getCallers(4) : ""));
- setInputMethodTarget(null, mInputMethodTargetWaitingAnim);
+ setImeLayeringTarget(null, mImeLayeringTargetWaitingAnim);
}
return null;
@@ -3557,7 +3590,7 @@
if (mAppTransition.isTransitionSet()) {
// If we are currently setting up for an animation, hold everything until we
// can find out what will happen.
- setInputMethodTarget(highestTarget, true);
+ setImeLayeringTarget(highestTarget, true);
return highestTarget;
}
}
@@ -3565,7 +3598,7 @@
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to "
+ target + (SHOW_STACK_CRAWLS ? " Callers=" + Debug.getCallers(4) : ""));
- setInputMethodTarget(target, false);
+ setImeLayeringTarget(target, false);
}
return target;
@@ -3576,24 +3609,24 @@
* the candidate app window token if needed.
*/
void computeImeTargetIfNeeded(ActivityRecord candidate) {
- if (mInputMethodTarget != null && mInputMethodTarget.mActivityRecord == candidate) {
+ if (mImeLayeringTarget != null && mImeLayeringTarget.mActivityRecord == candidate) {
computeImeTarget(true /* updateImeTarget */);
}
}
private boolean isImeControlledByApp() {
- return mInputMethodInputTarget != null && !WindowConfiguration.isSplitScreenWindowingMode(
- mInputMethodInputTarget.getWindowingMode());
+ return mImeInputTarget != null && !WindowConfiguration.isSplitScreenWindowingMode(
+ mImeInputTarget.getWindowingMode());
}
boolean isImeAttachedToApp() {
return isImeControlledByApp()
- && mInputMethodTarget != null
- && mInputMethodTarget.mActivityRecord != null
- && mInputMethodTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
+ && mImeLayeringTarget != null
+ && mImeLayeringTarget.mActivityRecord != null
+ && mImeLayeringTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
// An activity with override bounds should be letterboxed inside its parent bounds,
// so it doesn't fill the screen.
- && mInputMethodTarget.mActivityRecord.matchParentBounds();
+ && mImeLayeringTarget.mActivityRecord.matchParentBounds();
}
/**
@@ -3620,6 +3653,24 @@
return statusBar != null ? statusBar : defaultDc.mRemoteInsetsControlTarget;
}
+ /**
+ * Returns the corresponding IME insets control target according the IME target type.
+ *
+ * @param type The type of the IME target.
+ * @see #IME_TARGET_LAYERING
+ * @see #IME_TARGET_INPUT
+ * @see #IME_TARGET_CONTROL
+ */
+ InsetsControlTarget getImeTarget(@InputMethodTarget int type) {
+ switch (type) {
+ case IME_TARGET_LAYERING: return mImeLayeringTarget;
+ case IME_TARGET_INPUT: return mImeInputTarget;
+ case IME_TARGET_CONTROL: return mImeControlTarget;
+ default:
+ return null;
+ }
+ }
+
@DisplayImePolicy int getImePolicy() {
if (!isTrusted()) {
return DISPLAY_IME_POLICY_FALLBACK_DISPLAY;
@@ -3637,6 +3688,11 @@
return mWmService.mForceDesktopModeOnExternalDisplays && !isDefaultDisplay && !isPrivate();
}
+ @VisibleForTesting
+ void setImeLayeringTarget(WindowState target) {
+ mImeLayeringTarget = target;
+ }
+
/**
* Sets the window the IME is on top of.
* @param target window to place the IME surface on top of. If {@code null}, the IME will be
@@ -3644,13 +3700,13 @@
* @param targetWaitingAnim if {@code true}, hold off on modifying the animation layer of
* the target.
*/
- private void setInputMethodTarget(@Nullable WindowState target, boolean targetWaitingAnim) {
- if (target == mInputMethodTarget && mInputMethodTargetWaitingAnim == targetWaitingAnim) {
+ private void setImeLayeringTarget(@Nullable WindowState target, boolean targetWaitingAnim) {
+ if (target == mImeLayeringTarget && mImeLayeringTargetWaitingAnim == targetWaitingAnim) {
return;
}
ProtoLog.i(WM_DEBUG_IME, "setInputMethodTarget %s", target);
- mInputMethodTarget = target;
- mInputMethodTargetWaitingAnim = targetWaitingAnim;
+ mImeLayeringTarget = target;
+ mImeLayeringTargetWaitingAnim = targetWaitingAnim;
// 1. Reparent the IME container window to the target root DA to get the correct bounds and
// config. (Only happens when the target window is in a different root DA)
@@ -3672,23 +3728,33 @@
updateImeControlTarget();
}
+ @VisibleForTesting
+ void setImeInputTarget(WindowState target) {
+ mImeInputTarget = target;
+ }
+
+ @VisibleForTesting
+ void setImeControlTarget(InsetsControlTarget target) {
+ mImeControlTarget = target;
+ }
+
/**
* The IME input target is the window which receives input from IME. It is also a candidate
* which controls the visibility and animation of the input method window.
*/
- void setInputMethodInputTarget(WindowState target) {
- if (mInputMethodInputTarget != target) {
+ void updateImeInputAndControlTarget(WindowState target) {
+ if (mImeInputTarget != target) {
ProtoLog.i(WM_DEBUG_IME, "setInputMethodInputTarget %s", target);
- mInputMethodInputTarget = target;
+ mImeInputTarget = target;
updateImeControlTarget();
}
}
void updateImeControlTarget() {
- mInputMethodControlTarget = computeImeControlTarget();
- mInsetsStateController.onImeControlTargetChanged(mInputMethodControlTarget);
+ mImeControlTarget = computeImeControlTarget();
+ mInsetsStateController.onImeControlTargetChanged(mImeControlTarget);
- final WindowState win = InsetsControlTarget.asWindowOrNull(mInputMethodControlTarget);
+ final WindowState win = InsetsControlTarget.asWindowOrNull(mImeControlTarget);
final IBinder token = win != null ? win.mClient.asBinder() : null;
// Note: not allowed to call into IMMS with the WM lock held, hence the post.
mWmService.mH.post(() ->
@@ -3711,12 +3777,12 @@
@VisibleForTesting
InsetsControlTarget computeImeControlTarget() {
if (!isImeControlledByApp() && mRemoteInsetsControlTarget != null
- || (mInputMethodInputTarget != null
- && getImeHostOrFallback(mInputMethodInputTarget.getWindow())
+ || (mImeInputTarget != null
+ && getImeHostOrFallback(mImeInputTarget.getWindow())
== mRemoteInsetsControlTarget)) {
return mRemoteInsetsControlTarget;
} else {
- return mInputMethodInputTarget;
+ return mImeInputTarget;
}
}
@@ -3733,7 +3799,7 @@
// screen. If it's not covering the entire screen the IME might extend beyond the apps
// bounds.
if (allowAttachToApp && isImeAttachedToApp()) {
- return mInputMethodTarget.mActivityRecord.getSurfaceControl();
+ return mImeLayeringTarget.mActivityRecord.getSurfaceControl();
}
// Otherwise, we just attach it to where the display area policy put it.
@@ -4190,8 +4256,11 @@
}
// Initialize state of exiting applications.
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.setExitingTokensHasVisible(hasVisible);
+ forAllRootTasks(task -> {
+ final ArrayList<ActivityRecord> activities = task.mExitingActivities;
+ for (int j = activities.size() - 1; j >= 0; --j) {
+ activities.get(j).hasVisible = hasVisible;
+ }
});
}
@@ -4204,7 +4273,22 @@
}
// Time to remove any exiting applications?
- forAllTaskDisplayAreas(TaskDisplayArea::removeExistingAppTokensIfPossible);
+ forAllRootTasks(task -> {
+ final ArrayList<ActivityRecord> activities = task.mExitingActivities;
+ for (int j = activities.size() - 1; j >= 0; --j) {
+ final ActivityRecord activity = activities.get(j);
+ if (!activity.hasVisible && !mDisplayContent.mClosingApps.contains(activity)
+ && (!activity.mIsExiting || activity.isEmpty())) {
+ // Make sure there is no animation running on this activity, so any windows
+ // associated with it will be removed as soon as their animations are
+ // complete.
+ cancelAnimation();
+ ProtoLog.v(WM_DEBUG_ADD_REMOVE,
+ "performLayout: Activity exiting now removed %s", activity);
+ activity.removeIfPossible();
+ }
+ }
+ });
}
@Override
@@ -4354,7 +4438,7 @@
private boolean skipImeWindowsDuringTraversal(DisplayContent dc) {
// We skip IME windows so they're processed just above their target, except
// in split-screen mode where we process the IME containers above the docked divider.
- return dc.mInputMethodTarget != null
+ return dc.getImeTarget(IME_TARGET_LAYERING) != null
&& !dc.getDefaultTaskDisplayArea().isSplitScreenModeActivated();
}
@@ -4469,7 +4553,7 @@
@Override
void assignChildLayers(SurfaceControl.Transaction t) {
mImeWindowsContainers.setNeedsLayer();
- final WindowState imeTarget = mInputMethodTarget;
+ final WindowState imeTarget = mImeLayeringTarget;
// In the case where we have an IME target that is not in split-screen mode IME
// assignment is easy. We just need the IME to go directly above the target. This way
// children of the target will naturally go above the IME and everyone is happy.
@@ -5127,15 +5211,56 @@
* ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED
*/
void removeRootTasksInWindowingModes(int... windowingModes) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.removeRootTasksInWindowingModes(windowingModes);
+ if (windowingModes == null || windowingModes.length == 0) {
+ return;
+ }
+
+ // Collect the root tasks that are necessary to be removed instead of performing the removal
+ // by looping the children, so that we don't miss any root tasks after the children size
+ // changed or reordered.
+ final ArrayList<Task> rootTasks = new ArrayList<>();
+ forAllRootTasks(rootTask -> {
+ for (int windowingMode : windowingModes) {
+ if (rootTask.mCreatedByOrganizer
+ || rootTask.getWindowingMode() != windowingMode
+ || !rootTask.isActivityTypeStandardOrUndefined()) {
+ continue;
+ }
+ rootTasks.add(rootTask);
+ }
});
+ for (int i = rootTasks.size() - 1; i >= 0; --i) {
+ mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
+ }
}
void removeRootTasksWithActivityTypes(int... activityTypes) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.removeRootTasksWithActivityTypes(activityTypes);
+ if (activityTypes == null || activityTypes.length == 0) {
+ return;
+ }
+
+ // Collect the root tasks that are necessary to be removed instead of performing the removal
+ // by looping the children, so that we don't miss any root tasks after the children size
+ // changed or reordered.
+ final ArrayList<Task> rootTasks = new ArrayList<>();
+ forAllRootTasks(rootTask -> {
+ for (int activityType : activityTypes) {
+ // Collect the root tasks that are currently being organized.
+ if (rootTask.mCreatedByOrganizer) {
+ for (int k = rootTask.getChildCount() - 1; k >= 0; --k) {
+ final Task task = (Task) rootTask.getChildAt(k);
+ if (task.getActivityType() == activityType) {
+ rootTasks.add(task);
+ }
+ }
+ } else if (rootTask.getActivityType() == activityType) {
+ rootTasks.add(rootTask);
+ }
+ }
});
+ for (int i = rootTasks.size() - 1; i >= 0; --i) {
+ mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
+ }
}
ActivityRecord topRunningActivity() {
@@ -5355,19 +5480,12 @@
}
// Check if all task display areas have only the empty home stacks left.
- boolean hasNonEmptyHomeStack = forAllTaskDisplayAreas(taskDisplayArea -> {
- if (taskDisplayArea.getRootTaskCount() != 1) {
- return true;
- }
- final Task stack = taskDisplayArea.getRootTaskAt(0);
- return !stack.isActivityTypeHome() || stack.hasChild();
- });
- if (!hasNonEmptyHomeStack) {
+ boolean hasNonEmptyHomeStack = forAllRootTasks(stack ->
+ !stack.isActivityTypeHome() || stack.hasChild());
+ if (!hasNonEmptyHomeStack && getRootTaskCount() > 0) {
// Release this display if only empty home stack(s) are left. This display will be
// released along with the stack(s) removal.
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.getRootTaskAt(0).removeIfPossible();
- });
+ forAllRootTasks(Task::removeIfPossible);
} else if (getTopRootTask() == null) {
removeIfPossible();
mRootWindowContainer.mTaskSupervisor
diff --git a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
index 91106ef..17c3b20 100644
--- a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
+++ b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
@@ -19,10 +19,14 @@
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_IME;
+import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.ImeInsetsSourceProviderProto.IME_TARGET_FROM_IME;
import static com.android.server.wm.ImeInsetsSourceProviderProto.INSETS_SOURCE_PROVIDER;
import static com.android.server.wm.ImeInsetsSourceProviderProto.IS_IME_LAYOUT_DRAWN;
+import android.annotation.NonNull;
import android.os.Trace;
import android.util.proto.ProtoOutputStream;
import android.view.InsetsSource;
@@ -37,9 +41,9 @@
* Controller for IME inset source on the server. It's called provider as it provides the
* {@link InsetsSource} to the client that uses it in {@link InsetsSourceConsumer}.
*/
-class ImeInsetsSourceProvider extends InsetsSourceProvider {
+final class ImeInsetsSourceProvider extends InsetsSourceProvider {
- private InsetsControlTarget mImeTargetFromIme;
+ private InsetsControlTarget mImeRequester;
private Runnable mShowImeRunner;
private boolean mIsImeLayoutDrawn;
private boolean mImeShowing;
@@ -56,12 +60,8 @@
* @param imeTarget imeTarget on which IME request is coming from.
*/
void scheduleShowImePostLayout(InsetsControlTarget imeTarget) {
- boolean targetChanged = mImeTargetFromIme != imeTarget
- && mImeTargetFromIme != null && imeTarget != null && mShowImeRunner != null
- && imeTarget.getWindow() != null && mImeTargetFromIme.getWindow() != null
- && mImeTargetFromIme.getWindow().mActivityRecord
- == imeTarget.getWindow().mActivityRecord;
- mImeTargetFromIme = imeTarget;
+ boolean targetChanged = isTargetChangedWithinActivity(imeTarget);
+ mImeRequester = imeTarget;
if (targetChanged) {
// target changed, check if new target can show IME.
ProtoLog.d(WM_DEBUG_IME, "IME target changed within ActivityRecord");
@@ -72,24 +72,24 @@
return;
}
- ProtoLog.d(WM_DEBUG_IME, "Schedule IME show for %s", mImeTargetFromIme.getWindow() == null
- ? mImeTargetFromIme : mImeTargetFromIme.getWindow().getName());
+ ProtoLog.d(WM_DEBUG_IME, "Schedule IME show for %s", mImeRequester.getWindow() == null
+ ? mImeRequester : mImeRequester.getWindow().getName());
mShowImeRunner = () -> {
ProtoLog.d(WM_DEBUG_IME, "Run showImeRunner");
// Target should still be the same.
- if (isImeTargetFromDisplayContentAndImeSame()) {
- final InsetsControlTarget target = mDisplayContent.mInputMethodControlTarget;
+ if (isReadyToShowIme()) {
+ final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_CONTROL);
ProtoLog.i(WM_DEBUG_IME, "call showInsets(ime) on %s",
target.getWindow() != null ? target.getWindow().getName() : "");
setImeShowing(true);
target.showInsets(WindowInsets.Type.ime(), true /* fromIme */);
Trace.asyncTraceEnd(TRACE_TAG_WINDOW_MANAGER, "WMS.showImePostLayout", 0);
- if (target != mImeTargetFromIme && mImeTargetFromIme != null) {
+ if (target != mImeRequester && mImeRequester != null) {
ProtoLog.w(WM_DEBUG_IME,
"showInsets(ime) was requested by different window: %s ",
- (mImeTargetFromIme.getWindow() != null
- ? mImeTargetFromIme.getWindow().getName() : ""));
+ (mImeRequester.getWindow() != null
+ ? mImeRequester.getWindow().getName() : ""));
}
}
abortShowImePostLayout();
@@ -100,8 +100,7 @@
void checkShowImePostLayout() {
// check if IME is drawn
if (mIsImeLayoutDrawn
- || (mImeTargetFromIme != null
- && isImeTargetFromDisplayContentAndImeSame()
+ || (isReadyToShowIme()
&& mWin != null
&& mWin.isDrawn()
&& !mWin.mGivenInsetsPending)) {
@@ -118,13 +117,13 @@
*/
void abortShowImePostLayout() {
ProtoLog.d(WM_DEBUG_IME, "abortShowImePostLayout");
- mImeTargetFromIme = null;
+ mImeRequester = null;
mIsImeLayoutDrawn = false;
mShowImeRunner = null;
}
@VisibleForTesting
- boolean isImeTargetFromDisplayContentAndImeSame() {
+ boolean isReadyToShowIme() {
// IMMS#mLastImeTargetWindow always considers focused window as
// IME target, however DisplayContent#computeImeTarget() can compute
// a different IME target.
@@ -134,35 +133,75 @@
// Also, if imeTarget is closing, it would be considered as outdated target.
// TODO(b/139861270): Remove the child & sublayer check once IMMS is aware of
// actual IME target.
- final WindowState dcTarget = mDisplayContent.mInputMethodTarget;
- final InsetsControlTarget controlTarget = mDisplayContent.mInputMethodControlTarget;
- if (dcTarget == null || mImeTargetFromIme == null) {
+ final InsetsControlTarget dcTarget = mDisplayContent.getImeTarget(IME_TARGET_LAYERING);
+ if (dcTarget == null || mImeRequester == null) {
return false;
}
- ProtoLog.d(WM_DEBUG_IME, "dcTarget: %s mImeTargetFromIme: %s",
- dcTarget.getName(), mImeTargetFromIme.getWindow() == null
- ? mImeTargetFromIme : mImeTargetFromIme.getWindow().getName());
+ ProtoLog.d(WM_DEBUG_IME, "dcTarget: %s mImeRequester: %s",
+ dcTarget.getWindow().getName(), mImeRequester.getWindow() == null
+ ? mImeRequester : mImeRequester.getWindow().getName());
- return (!dcTarget.isClosing() && mImeTargetFromIme == dcTarget)
- || (mImeTargetFromIme != null && mImeTargetFromIme.getWindow() != null
- && dcTarget.getParentWindow() == mImeTargetFromIme
- && dcTarget.mSubLayer > mImeTargetFromIme.getWindow().mSubLayer)
- || mImeTargetFromIme == mDisplayContent.getImeFallback()
- || mImeTargetFromIme == mDisplayContent.mInputMethodInputTarget
- || controlTarget == mImeTargetFromIme
- && (mImeTargetFromIme.getWindow() == null
- || !mImeTargetFromIme.getWindow().isClosing());
+ return isImeLayeringTarget(mImeRequester, dcTarget)
+ || isAboveImeLayeringTarget(mImeRequester, dcTarget)
+ || isImeFallbackTarget(mImeRequester)
+ || isImeInputTarget(mImeRequester)
+ || sameAsImeControlTarget();
}
+ // ---------------------------------------------------------------------------------------
+ // Methods for checking IME insets target changing state.
+ //
+ private static boolean isImeLayeringTarget(@NonNull InsetsControlTarget target,
+ @NonNull InsetsControlTarget dcTarget) {
+ return !dcTarget.getWindow().isClosing() && target == dcTarget;
+ }
+
+ private static boolean isAboveImeLayeringTarget(@NonNull InsetsControlTarget target,
+ @NonNull InsetsControlTarget dcTarget) {
+ return target.getWindow() != null
+ && dcTarget.getWindow().getParentWindow() == target
+ && dcTarget.getWindow().mSubLayer > target.getWindow().mSubLayer;
+ }
+
+ private boolean isImeFallbackTarget(InsetsControlTarget target) {
+ return target == mDisplayContent.getImeFallback();
+ }
+
+ private boolean isImeInputTarget(InsetsControlTarget target) {
+ return target == mDisplayContent.getImeTarget(IME_TARGET_INPUT);
+ }
+
+ private boolean sameAsImeControlTarget() {
+ final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_CONTROL);
+ return target == mImeRequester
+ && (mImeRequester.getWindow() == null
+ || !mImeRequester.getWindow().isClosing());
+ }
+
+ private boolean isTargetChangedWithinActivity(InsetsControlTarget target) {
+ // We don't consider the target out of the activity.
+ if (target == null || target.getWindow() == null) {
+ return false;
+ }
+ return mImeRequester != target
+ && mImeRequester != null && mShowImeRunner != null
+ && mImeRequester.getWindow() != null
+ && mImeRequester.getWindow().mActivityRecord
+ == target.getWindow().mActivityRecord;
+ }
+ // ---------------------------------------------------------------------------------------
+
@Override
public void dump(PrintWriter pw, String prefix) {
super.dump(pw, prefix);
pw.print(prefix);
pw.print("mImeShowing=");
pw.print(mImeShowing);
- if (mImeTargetFromIme != null) {
- pw.print(" showImePostLayout pending for mImeTargetFromIme=");
- pw.print(mImeTargetFromIme);
+ if (mImeRequester != null) {
+ pw.print(prefix);
+ pw.print("showImePostLayout pending for mImeRequester=");
+ pw.print(mImeRequester);
+ pw.println();
}
pw.println();
}
@@ -171,8 +210,8 @@
void dumpDebug(ProtoOutputStream proto, long fieldId, @WindowTraceLogLevel int logLevel) {
final long token = proto.start(fieldId);
super.dumpDebug(proto, INSETS_SOURCE_PROVIDER, logLevel);
- if (mImeTargetFromIme != null) {
- mImeTargetFromIme.getWindow().dumpDebug(proto, IME_TARGET_FROM_IME, logLevel);
+ if (mImeRequester != null) {
+ mImeRequester.getWindow().dumpDebug(proto, IME_TARGET_FROM_IME, logLevel);
}
proto.write(IS_IME_LAYOUT_DRAWN, mIsImeLayoutDrawn);
proto.end(token);
diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java
index e45310a..57f2638 100644
--- a/services/core/java/com/android/server/wm/KeyguardController.java
+++ b/services/core/java/com/android/server/wm/KeyguardController.java
@@ -594,16 +594,8 @@
*/
@Nullable
private Task getRootTaskForControllingOccluding(DisplayContent display) {
- return display.getItemFromTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (task != null && task.isFocusableAndVisible()
- && !task.inPinnedWindowingMode()) {
- return task;
- }
- }
- return null;
- });
+ return display.getRootTask(task ->
+ task != null && task.isFocusableAndVisible() && !task.inPinnedWindowingMode());
}
void dumpStatus(PrintWriter pw, String prefix) {
diff --git a/services/core/java/com/android/server/wm/PinnedStackController.java b/services/core/java/com/android/server/wm/PinnedStackController.java
index fd42b24..8fe2481 100644
--- a/services/core/java/com/android/server/wm/PinnedStackController.java
+++ b/services/core/java/com/android/server/wm/PinnedStackController.java
@@ -127,7 +127,6 @@
try {
listener.asBinder().linkToDeath(mPinnedStackListenerDeathHandler, 0);
mPinnedStackListener = listener;
- notifyDisplayInfoChanged(mDisplayInfo);
notifyImeVisibilityChanged(mIsImeShowing, mImeHeight);
notifyMovementBoundsChanged(false /* fromImeAdjustment */);
notifyActionsChanged(mActions);
@@ -171,23 +170,6 @@
}
}
- private void setDisplayInfo(DisplayInfo displayInfo) {
- mDisplayInfo.copyFrom(displayInfo);
- notifyDisplayInfoChanged(mDisplayInfo);
- }
-
- /**
- * In the case where the display rotation is changed but there is no stack, we can't depend on
- * onTaskStackBoundsChanged() to be called. But we still should update our known display info
- * with the new state so that we can update SystemUI.
- */
- void onDisplayInfoChanged(DisplayInfo displayInfo) {
- synchronized (mService.mGlobalLock) {
- setDisplayInfo(displayInfo);
- notifyMovementBoundsChanged(false /* fromImeAdjustment */);
- }
- }
-
/**
* Sets the Ime state and height.
*/
@@ -288,18 +270,6 @@
}
}
- /**
- * Notifies listeners that the PIP animation is about to happen.
- */
- private void notifyDisplayInfoChanged(DisplayInfo displayInfo) {
- if (mPinnedStackListener == null) return;
- try {
- mPinnedStackListener.onDisplayInfoChanged(displayInfo);
- } catch (RemoteException e) {
- Slog.e(TAG_WM, "Error delivering DisplayInfo changed event.", e);
- }
- }
-
void dump(String prefix, PrintWriter pw) {
pw.println(prefix + "PinnedStackController");
pw.println(prefix + " mIsImeShowing=" + mIsImeShowing);
diff --git a/services/core/java/com/android/server/wm/RecentsAnimation.java b/services/core/java/com/android/server/wm/RecentsAnimation.java
index 067c772..05dcd36 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimation.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimation.java
@@ -468,14 +468,8 @@
* @return The top stack that is not always-on-top.
*/
private Task getTopNonAlwaysOnTopStack() {
- for (int i = mDefaultTaskDisplayArea.getRootTaskCount() - 1; i >= 0; i--) {
- final Task s = mDefaultTaskDisplayArea.getRootTaskAt(i);
- if (s.getWindowConfiguration().isAlwaysOnTop()) {
- continue;
- }
- return s;
- }
- return null;
+ return mDefaultTaskDisplayArea.getRootTask(task ->
+ !task.getWindowConfiguration().isAlwaysOnTop());
}
/**
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index 16c7226..edd01eb 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -57,7 +57,9 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.inputmethod.SoftInputShowHideReason;
+import com.android.internal.os.BackgroundThread;
import com.android.internal.protolog.common.ProtoLog;
+import com.android.internal.util.LatencyTracker;
import com.android.internal.util.function.pooled.PooledConsumer;
import com.android.internal.util.function.pooled.PooledFunction;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -84,6 +86,11 @@
public class RecentsAnimationController implements DeathRecipient {
private static final String TAG = RecentsAnimationController.class.getSimpleName();
private static final long FAILSAFE_DELAY = 1000;
+ /**
+ * If the recents animation is canceled before the delay since the window drawn, do not log the
+ * action because the duration is too small that may be just a mistouch,
+ */
+ private static final long LATENCY_TRACKER_LOG_DELAY_MS = 300;
public static final int REORDER_KEEP_IN_PLACE = 0;
public static final int REORDER_MOVE_TO_TOP = 1;
@@ -123,7 +130,7 @@
private boolean mPendingStart = true;
// Set when the animation has been canceled
- private boolean mCanceled;
+ private volatile boolean mCanceled;
// Whether or not the input consumer is enabled. The input consumer must be both registered and
// enabled for it to start intercepting touch events.
@@ -364,6 +371,9 @@
Binder.restoreCallingIdentity(token);
}
}
+
+ @Override
+ public void detachNavigationBarFromApp() {}
};
/**
@@ -592,6 +602,15 @@
return adapter.createRemoteAnimationTarget();
}
+ void logRecentsAnimationStartTime(int durationMs) {
+ BackgroundThread.getHandler().postDelayed(() -> {
+ if (!mCanceled) {
+ mService.mLatencyTracker.logAction(LatencyTracker.ACTION_START_RECENTS_ANIMATION,
+ durationMs);
+ }
+ }, LATENCY_TRACKER_LOG_DELAY_MS);
+ }
+
private boolean removeTaskInternal(int taskId) {
boolean result = false;
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
@@ -763,7 +782,7 @@
taskAdapter.mTask.dontAnimateDimExit();
}
removeAnimation(taskAdapter);
- taskAdapter.maybeApplyFinishBounds();
+ taskAdapter.onCleanup();
}
for (int i = mPendingWallpaperAnimations.size() - 1; i >= 0; i--) {
@@ -987,14 +1006,19 @@
return mTarget;
}
- void maybeApplyFinishBounds() {
+ void onCleanup() {
if (!mFinishBounds.isEmpty()) {
+ // Apply any pending bounds changes
final SurfaceControl taskSurface = mTask.getSurfaceControl();
mTask.getPendingTransaction()
.setPosition(taskSurface, mFinishBounds.left, mFinishBounds.top)
.setWindowCrop(taskSurface, mFinishBounds.width(), mFinishBounds.height())
.apply();
mFinishBounds.setEmpty();
+ } else if (!mTask.isAttached()) {
+ // Apply the task's pending transaction in case it is detached and its transaction
+ // is not reachable.
+ mTask.getPendingTransaction().apply();
}
}
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 497087a..d652393 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -778,7 +778,9 @@
if (surfaceController != null) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
"SURFACE RECOVER DESTROY: %s", winAnimator.mWin);
- winAnimator.destroySurface();
+ SurfaceControl.Transaction t = mWmService.mTransactionFactory.get();
+ winAnimator.destroySurface(t);
+ t.apply();
if (winAnimator.mWin.mActivityRecord != null) {
winAnimator.mWin.mActivityRecord.removeStartingWindow();
}
@@ -926,7 +928,7 @@
displayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
}
win.destroySurfaceUnchecked();
- win.mWinAnimator.destroyPreservedSurfaceLocked();
+ win.mWinAnimator.destroyPreservedSurfaceLocked(win.getSyncTransaction());
} while (i > 0);
mWmService.mDestroySurface.clear();
}
@@ -1833,19 +1835,15 @@
final ArrayList<IBinder> topActivityTokens = new ArrayList<>();
final Task topFocusedStack = getTopDisplayFocusedRootTask();
// Traverse all displays.
- forAllTaskDisplayAreas(taskDisplayArea -> {
- // Traverse all stacks on a display area.
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- // Get top activity from a visible stack and add it to the list.
- if (stack.shouldBeVisible(null /* starting */)) {
- final ActivityRecord top = stack.getTopNonFinishingActivity();
- if (top != null) {
- if (stack == topFocusedStack) {
- topActivityTokens.add(0, top.appToken);
- } else {
- topActivityTokens.add(top.appToken);
- }
+ forAllRootTasks(stack -> {
+ // Get top activity from a visible stack and add it to the list.
+ if (stack.shouldBeVisible(null /* starting */)) {
+ final ActivityRecord top = stack.getTopNonFinishingActivity();
+ if (top != null) {
+ if (stack == topFocusedStack) {
+ topActivityTokens.add(0, top.appToken);
+ } else {
+ topActivityTokens.add(top.appToken);
}
}
}
@@ -1890,21 +1888,17 @@
// First, found out what is currently the foreground app, so that we don't blow away the
// previous app if this activity is being hosted by the process that is actually still the
// foreground.
- WindowProcessController fgApp = reduceOnAllTaskDisplayAreas((taskDisplayArea, app) -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (isTopDisplayFocusedRootTask(stack)) {
- final ActivityRecord resumedActivity = stack.getResumedActivity();
- if (resumedActivity != null) {
- app = resumedActivity.app;
- } else if (stack.mPausingActivity != null) {
- app = stack.mPausingActivity.app;
- }
- break;
+ WindowProcessController fgApp = getItemFromRootTasks(rootTask -> {
+ if (isTopDisplayFocusedRootTask(rootTask)) {
+ final ActivityRecord resumedActivity = rootTask.getResumedActivity();
+ if (resumedActivity != null) {
+ return resumedActivity.app;
+ } else if (rootTask.getPausingActivity() != null) {
+ return rootTask.getPausingActivity().app;
}
}
- return app;
- }, null /* initValue */);
+ return null;
+ });
// Now set this one as the previous process, only if that really makes sense to.
if (r.hasProcess() && fgApp != null && r.app != fgApp
@@ -1921,27 +1915,21 @@
mTmpRemoteException = null;
mTmpBoolean = false; // Set to true if an activity was started.
final DisplayContent display = getChildAt(displayNdx);
- display.forAllTaskDisplayAreas(displayArea -> {
+ display.forAllRootTasks(rootTask -> {
if (mTmpRemoteException != null) {
return;
}
- for (int taskNdx = displayArea.getRootTaskCount() - 1; taskNdx >= 0; --taskNdx) {
- final Task rootTask = displayArea.getRootTaskAt(taskNdx);
- if (rootTask.getVisibility(null /*starting*/) == TASK_VISIBILITY_INVISIBLE) {
- break;
- }
-
- final PooledFunction c = PooledLambda.obtainFunction(
- RootWindowContainer::startActivityForAttachedApplicationIfNeeded, this,
- PooledLambda.__(ActivityRecord.class), app,
- rootTask.topRunningActivity());
- rootTask.forAllActivities(c);
- c.recycle();
- if (mTmpRemoteException != null) {
- return;
- }
+ if (rootTask.getVisibility(null /*starting*/) == TASK_VISIBILITY_INVISIBLE) {
+ return;
}
+
+ final PooledFunction c = PooledLambda.obtainFunction(
+ RootWindowContainer::startActivityForAttachedApplicationIfNeeded, this,
+ PooledLambda.__(ActivityRecord.class), app,
+ rootTask.topRunningActivity());
+ rootTask.forAllActivities(c);
+ c.recycle();
});
if (mTmpRemoteException != null) {
throw mTmpRemoteException;
@@ -2025,11 +2013,8 @@
mCurrentUser = userId;
mTaskSupervisor.mStartingUsers.add(uss);
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- stack.switchUser(userId);
- }
+ forAllRootTasks(stack -> {
+ stack.switchUser(userId);
});
final int restoreStackId = mUserRootTaskInFront.get(userId);
@@ -2292,20 +2277,14 @@
*/
int finishTopCrashedActivities(WindowProcessController app, String reason) {
Task focusedStack = getTopDisplayFocusedRootTask();
- Task finishedTask = reduceOnAllTaskDisplayAreas((taskDisplayArea, task) -> {
- // It is possible that request to finish activity might also remove its task and
- // stack, so we need to be careful with indexes in the loop and check child count
- // every time.
- for (int stackNdx = 0; stackNdx < taskDisplayArea.getRootTaskCount(); ++stackNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(stackNdx);
- final Task t = stack.finishTopCrashedActivityLocked(app, reason);
- if (stack == focusedStack || task == null) {
- task = t;
- }
+ final Task[] finishedTask = new Task[1];
+ forAllTasks(stack -> {
+ final Task t = stack.finishTopCrashedActivityLocked(app, reason);
+ if (stack == focusedStack || finishedTask[0] == null) {
+ finishedTask[0] = t;
}
- return task;
- }, null /* initValue */);
- return finishedTask != null ? finishedTask.mTaskId : INVALID_TASK_ID;
+ });
+ return finishedTask[0] != null ? finishedTask[0].mTaskId : INVALID_TASK_ID;
}
boolean resumeFocusedTasksTopActivities() {
@@ -2328,36 +2307,32 @@
for (int displayNdx = getChildCount() - 1; displayNdx >= 0; --displayNdx) {
final DisplayContent display = getChildAt(displayNdx);
final boolean curResult = result;
- boolean resumedOnDisplay = display.reduceOnAllTaskDisplayAreas(
- (taskDisplayArea, resumed) -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task rootTask = taskDisplayArea.getRootTaskAt(sNdx);
- final ActivityRecord topRunningActivity = rootTask.topRunningActivity();
- if (!rootTask.isFocusableAndVisible() || topRunningActivity == null) {
- continue;
- }
- if (rootTask == targetRootTask) {
- // Simply update the result for targetStack because the targetStack
- // had already resumed in above. We don't want to resume it again,
- // especially in some cases, it would cause a second launch failure
- // if app process was dead.
- resumed |= curResult;
- continue;
- }
- if (taskDisplayArea.isTopRootTask(rootTask)
- && topRunningActivity.isState(RESUMED)) {
- // Kick off any lingering app transitions form the MoveTaskToFront
- // operation, but only consider the top task and stack on that
- // display.
- rootTask.executeAppTransition(targetOptions);
- } else {
- resumed |= topRunningActivity.makeActiveIfNeeded(target);
- }
- }
- return resumed;
- }, false /* initValue */);
- result |= resumedOnDisplay;
- if (!resumedOnDisplay) {
+ boolean[] resumedOnDisplay = new boolean[1];
+ display.forAllRootTasks(rootTask -> {
+ final ActivityRecord topRunningActivity = rootTask.topRunningActivity();
+ if (!rootTask.isFocusableAndVisible() || topRunningActivity == null) {
+ return;
+ }
+ if (rootTask == targetRootTask) {
+ // Simply update the result for targetStack because the targetStack
+ // had already resumed in above. We don't want to resume it again,
+ // especially in some cases, it would cause a second launch failure
+ // if app process was dead.
+ resumedOnDisplay[0] |= curResult;
+ return;
+ }
+ if (rootTask.getDisplayArea().isTopRootTask(rootTask)
+ && topRunningActivity.isState(RESUMED)) {
+ // Kick off any lingering app transitions form the MoveTaskToFront
+ // operation, but only consider the top task and stack on that
+ // display.
+ rootTask.executeAppTransition(targetOptions);
+ } else {
+ resumedOnDisplay[0] |= topRunningActivity.makeActiveIfNeeded(target);
+ }
+ });
+ result |= resumedOnDisplay[0];
+ if (!resumedOnDisplay[0]) {
// In cases when there are no valid activities (e.g. device just booted or launcher
// crashed) it's possible that nothing was resumed on a display. Requesting resume
// of top activity in focused stack explicitly will make sure that at least home
@@ -2390,30 +2365,27 @@
}
// Set the sleeping state of the stacks on the display.
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (displayShouldSleep) {
- stack.goToSleepIfPossible(false /* shuttingDown */);
- } else {
- stack.awakeFromSleepingLocked();
- if (stack.isFocusedStackOnDisplay()
- && !mTaskSupervisor.getKeyguardController()
- .isKeyguardOrAodShowing(display.mDisplayId)) {
- // If the keyguard is unlocked - resume immediately.
- // It is possible that the display will not be awake at the time we
- // process the keyguard going away, which can happen before the sleep
- // token is released. As a result, it is important we resume the
- // activity here.
- stack.resumeTopActivityUncheckedLocked(null, null);
- }
- // The visibility update must not be called before resuming the top, so the
- // display orientation can be updated first if needed. Otherwise there may
- // have redundant configuration changes due to apply outdated display
- // orientation (from keyguard) to activity.
- stack.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
- false /* preserveWindows */);
+ display.forAllRootTasks(stack -> {
+ if (displayShouldSleep) {
+ stack.goToSleepIfPossible(false /* shuttingDown */);
+ } else {
+ stack.awakeFromSleepingLocked();
+ if (stack.isFocusedStackOnDisplay()
+ && !mTaskSupervisor.getKeyguardController()
+ .isKeyguardOrAodShowing(display.mDisplayId)) {
+ // If the keyguard is unlocked - resume immediately.
+ // It is possible that the display will not be awake at the time we
+ // process the keyguard going away, which can happen before the sleep
+ // token is released. As a result, it is important we resume the
+ // activity here.
+ stack.resumeTopActivityUncheckedLocked(null, null);
}
+ // The visibility update must not be called before resuming the top, so the
+ // display orientation can be updated first if needed. Otherwise there may
+ // have redundant configuration changes due to apply outdated display
+ // orientation (from keyguard) to activity.
+ stack.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
+ false /* preserveWindows */);
}
});
}
@@ -2510,13 +2482,10 @@
/** If displayId == INVALID_DISPLAY, this will get root task infos on all displays */
ArrayList<RootTaskInfo> getAllRootTaskInfos(int displayId) {
- ArrayList<RootTaskInfo> list = new ArrayList<>();
+ final ArrayList<RootTaskInfo> list = new ArrayList<>();
if (displayId == INVALID_DISPLAY) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- list.add(getRootTaskInfo(stack));
- }
+ forAllRootTasks(stack -> {
+ list.add(getRootTaskInfo(stack));
});
return list;
}
@@ -2524,11 +2493,8 @@
if (display == null) {
return list;
}
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- list.add(getRootTaskInfo(stack));
- }
+ display.forAllRootTasks(stack -> {
+ list.add(getRootTaskInfo(stack));
});
return list;
}
@@ -2601,10 +2567,17 @@
Task findRootTaskBehind(Task rootTask) {
final TaskDisplayArea taskDisplayArea = rootTask.getDisplayArea();
if (taskDisplayArea != null) {
- for (int i = taskDisplayArea.getRootTaskCount() - 1; i >= 0; i--) {
- if (taskDisplayArea.getRootTaskAt(i) == rootTask && i > 0) {
- return taskDisplayArea.getRootTaskAt(i - 1);
+ final boolean[] hasFound = new boolean[1];
+ // TODO(b/175136051): should this be only the direct child root task?
+ final Task rootTaskBehind = taskDisplayArea.getRootTask(task -> {
+ if (hasFound[0]) {
+ return true;
}
+ hasFound[0] = task == rootTask;
+ return false;
+ });
+ if (rootTaskBehind != null) {
+ return rootTaskBehind;
}
}
throw new IllegalStateException("Failed to find a root task behind root task =" + rootTask
@@ -2736,8 +2709,9 @@
if (DEBUG_SWITCH) {
Slog.v(TAG_SWITCH, "Destroying " + r + " in state " + r.getState()
- + " resumed=" + r.getStack().mResumedActivity + " pausing="
- + r.getStack().mPausingActivity + " for reason " + mDestroyAllActivitiesReason);
+ + " resumed=" + r.getTask().getResumedActivity() + " pausing="
+ + r.getTask().getPausingActivity() + " for reason "
+ + mDestroyAllActivitiesReason);
}
r.destroyImmediately(mDestroyAllActivitiesReason);
@@ -2746,24 +2720,16 @@
// Tries to put all activity tasks to sleep. Returns true if all tasks were
// successfully put to sleep.
boolean putTasksToSleep(boolean allowDelay, boolean shuttingDown) {
- return reduceOnAllTaskDisplayAreas((taskDisplayArea, result) -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- // Stacks and activities could be removed while putting activities to sleep if
- // the app process was gone. This prevents us getting exception by accessing an
- // invalid stack index.
- if (sNdx >= taskDisplayArea.getRootTaskCount()) {
- continue;
- }
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (allowDelay) {
- result &= task.goToSleepIfPossible(shuttingDown);
- } else {
- task.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
- !PRESERVE_WINDOWS);
- }
+ final boolean[] result = {true};
+ forAllRootTasks(task -> {
+ if (allowDelay) {
+ result[0] &= task.goToSleepIfPossible(shuttingDown);
+ } else {
+ task.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
+ !PRESERVE_WINDOWS);
}
- return result;
- }, true /* initValue */);
+ });
+ return result[0];
}
void handleAppCrash(WindowProcessController app) {
@@ -3019,11 +2985,11 @@
r.getActivityType());
// Return the topmost valid stack on the display.
- for (int i = taskDisplayArea.getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = taskDisplayArea.getRootTaskAt(i);
- if (isValidLaunchRootTask(stack, r, windowingMode)) {
- return stack;
- }
+ final int targetWindowingMode = windowingMode;
+ final Task topmostValidStack = taskDisplayArea.getRootTask(stack ->
+ isValidLaunchRootTask(stack, r, targetWindowingMode));
+ if (topmostValidStack != null) {
+ return topmostValidStack;
}
// If there is no valid stack on the secondary display area - check if new dynamic stack
@@ -3258,12 +3224,8 @@
}
void finishVoiceTask(IVoiceInteractionSession session) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- final int numStacks = taskDisplayArea.getRootTaskCount();
- for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(stackNdx);
- stack.finishVoiceTask(session);
- }
+ forAllRootTasks(stack -> {
+ stack.finishVoiceTask(session);
});
}
@@ -3322,20 +3284,16 @@
boolean allResumedActivitiesVisible() {
boolean[] foundResumed = {false};
- final boolean foundInvisibleResumedActivity = forAllTaskDisplayAreas(
- taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- final ActivityRecord r = stack.getResumedActivity();
- if (r != null) {
- if (!r.nowVisible) {
- return true;
- }
- foundResumed[0] = true;
- }
- }
- return false;
- });
+ final boolean foundInvisibleResumedActivity = forAllRootTasks(stack -> {
+ final ActivityRecord r = stack.getResumedActivity();
+ if (r != null) {
+ if (!r.nowVisible) {
+ return true;
+ }
+ foundResumed[0] = true;
+ }
+ return false;
+ });
if (foundInvisibleResumedActivity) {
return false;
}
@@ -3344,23 +3302,19 @@
boolean allPausedActivitiesComplete() {
boolean[] pausing = {true};
- final boolean hasActivityNotCompleted = forAllTaskDisplayAreas(
- taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- final ActivityRecord r = stack.mPausingActivity;
- if (r != null && !r.isState(PAUSED, STOPPED, STOPPING, FINISHING)) {
- ProtoLog.d(WM_DEBUG_STATES, "allPausedActivitiesComplete: "
- + "r=%s state=%s", r, r.getState());
- if (WM_DEBUG_STATES.isEnabled()) {
- pausing[0] = false;
- } else {
- return true;
- }
- }
- }
- return false;
- });
+ final boolean hasActivityNotCompleted = forAllLeafTasks(task -> {
+ final ActivityRecord r = task.getPausingActivity();
+ if (r != null && !r.isState(PAUSED, STOPPED, STOPPING, FINISHING)) {
+ ProtoLog.d(WM_DEBUG_STATES, "allPausedActivitiesComplete: "
+ + "r=%s state=%s", r, r.getState());
+ if (WM_DEBUG_STATES.isEnabled()) {
+ pausing[0] = false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ });
if (hasActivityNotCompleted) {
return false;
}
@@ -3411,13 +3365,10 @@
}
void cancelInitializingActivities() {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- // We don't want to clear starting window for activities that aren't occluded
- // as we need to display their starting window until they are done initializing.
- taskDisplayArea.getRootTaskAt(sNdx).forAllOccludedActivities(
- ActivityRecord::cancelInitializing);
- }
+ forAllRootTasks(task -> {
+ // We don't want to clear starting window for activities that aren't occluded
+ // as we need to display their starting window until they are done initializing.
+ task.forAllOccludedActivities(ActivityRecord::cancelInitializing);
});
}
@@ -3577,13 +3528,10 @@
return new ArrayList<>();
}
} else {
- ArrayList<ActivityRecord> activities = new ArrayList<>();
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (!dumpVisibleStacksOnly || stack.shouldBeVisible(null)) {
- activities.addAll(stack.getDumpActivitiesLocked(name));
- }
+ final ArrayList<ActivityRecord> activities = new ArrayList<>();
+ forAllRootTasks(stack -> {
+ if (!dumpVisibleStacksOnly || stack.shouldBeVisible(null)) {
+ activities.addAll(stack.getDumpActivitiesLocked(name));
}
});
return activities;
@@ -3633,15 +3581,12 @@
pw.print("Display #");
pw.print(displayContent.mDisplayId);
pw.println(" (activities from top to bottom):");
- displayContent.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (needSep[0]) {
- pw.println();
- }
- needSep[0] = stack.dump(fd, pw, dumpAll, dumpClient, dumpPackage, false);
- printed[0] |= needSep[0];
+ displayContent.forAllRootTasks(stack -> {
+ if (needSep[0]) {
+ pw.println();
}
+ needSep[0] = stack.dump(fd, pw, dumpAll, dumpClient, dumpPackage, false);
+ printed[0] |= needSep[0];
});
displayContent.forAllTaskDisplayAreas(taskDisplayArea -> {
printed[0] |= printThisActivity(pw, taskDisplayArea.getFocusedActivity(),
diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java
index c414c64..57d48c6 100644
--- a/services/core/java/com/android/server/wm/Session.java
+++ b/services/core/java/com/android/server/wm/Session.java
@@ -18,6 +18,7 @@
import static android.Manifest.permission.DEVICE_POWER;
import static android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+import static android.Manifest.permission.HIDE_OVERLAY_WINDOWS;
import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
import static android.Manifest.permission.START_TASKS_FROM_RECENTS;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
@@ -124,7 +125,9 @@
mCanAddInternalSystemWindow = service.mContext.checkCallingOrSelfPermission(
INTERNAL_SYSTEM_WINDOW) == PERMISSION_GRANTED;
mCanHideNonSystemOverlayWindows = service.mContext.checkCallingOrSelfPermission(
- HIDE_NON_SYSTEM_OVERLAY_WINDOWS) == PERMISSION_GRANTED;
+ HIDE_NON_SYSTEM_OVERLAY_WINDOWS) == PERMISSION_GRANTED
+ || service.mContext.checkCallingOrSelfPermission(HIDE_OVERLAY_WINDOWS)
+ == PERMISSION_GRANTED;
mOverlaysCanBeHidden = !mCanAddInternalSystemWindow
&& !mService.mAtmInternal.isCallerRecents(mUid);
mCanAcquireSleepToken = service.mContext.checkCallingOrSelfPermission(DEVICE_POWER)
diff --git a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
index 34d084a..92e2ee6 100644
--- a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
+++ b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
@@ -259,6 +259,7 @@
private void applyTransaction() {
mFrameTransaction.setAnimationTransaction();
+ mFrameTransaction.setFrameTimelineVsync(mChoreographer.getVsyncId());
mFrameTransaction.apply();
mApplyScheduled = false;
}
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 00f545c..69723ff 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -59,7 +59,7 @@
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.SurfaceControl.METADATA_TASK_ID;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
import static android.view.WindowManager.TRANSIT_FLAG_OPEN_BEHIND;
@@ -514,11 +514,6 @@
// {@link ActivityInfo#FLAG_SUPPORTS_PICTURE_IN_PICTURE} flag of the root activity.
boolean mSupportsPictureInPicture;
- // Activity bounds if this task or its top activity is presented in letterbox mode and
- // {@code null} otherwise.
- @Nullable
- private Rect mLetterboxActivityBounds;
-
// Whether the task is currently being drag-resized
private boolean mDragResizing;
private int mDragResizeMode;
@@ -548,8 +543,11 @@
/**
* When we are in the process of pausing an activity, before starting the
* next one, this variable holds the activity that is currently being paused.
+ *
+ * Only set at leaf tasks.
*/
- ActivityRecord mPausingActivity = null;
+ @Nullable
+ private ActivityRecord mPausingActivity = null;
/**
* This is the last activity that we put into the paused state. This is
@@ -565,8 +563,12 @@
*/
ActivityRecord mLastNoHistoryActivity = null;
- /** Current activity that is resumed, or null if there is none. */
- ActivityRecord mResumedActivity = null;
+ /**
+ * Current activity that is resumed, or null if there is none.
+ * Only set at leaf tasks.
+ */
+ @Nullable
+ private ActivityRecord mResumedActivity = null;
/** Last activity that is used to compute the Task bounds. */
@Nullable
@@ -1106,14 +1108,6 @@
return false;
}
- final boolean toTopOfStack = position == MAX_VALUE;
- if (toTopOfStack && toStack.getResumedActivity() != null
- && toStack.topRunningActivity() != null) {
- // Pause the resumed activity on the target stack while re-parenting task on top of it.
- toStack.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
- null /* resuming */, "reparent");
- }
-
final int toStackWindowingMode = toStack.getWindowingMode();
final ActivityRecord topActivity = getTopNonFinishingActivity();
@@ -1137,8 +1131,6 @@
final ActivityRecord r = topRunningActivityLocked();
final boolean wasFocused = r != null && root.isTopDisplayFocusedRootTask(sourceStack)
&& (topRunningActivityLocked() == r);
- final boolean wasResumed = r != null && sourceStack.getResumedActivity() == r;
- final boolean wasPaused = r != null && sourceStack.mPausingActivity == r;
// In some cases the focused stack isn't the front stack. E.g. pinned stack.
// Whenever we are moving the top activity from the front stack we want to make sure to
@@ -1159,9 +1151,15 @@
// If the task had focus before (or we're requested to move focus), move focus to the
// new stack by moving the stack to the front.
- if (r != null) {
- toStack.moveToFrontAndResumeStateIfNeeded(r, moveStackToFront, wasResumed,
- wasPaused, reason);
+ if (r != null && moveStackToFront) {
+ // Move the stack in which we are placing the activity to the front.
+ toStack.moveToFront(reason);
+
+ // If the original state is resumed, there is no state change to update focused app.
+ // So here makes sure the activity focus is set if it is the top.
+ if (r.isState(RESUMED) && r == mRootWindowContainer.getTopResumedActivity()) {
+ mAtmService.setResumedActivityUncheckLocked(r, reason);
+ }
}
if (!animate) {
mTaskSupervisor.mNoAnimActivities.add(topActivity);
@@ -1457,15 +1455,6 @@
}
if (newParent != null) {
- final Task newParentTask = ((WindowContainer) newParent).asTask();
- if (newParentTask != null) {
- final ActivityRecord top = newParentTask.getTopNonFinishingActivity(
- false /* includeOverlays */);
- if (top != null && top.isState(RESUMED)) {
- newParentTask.setResumedActivity(top, "addedToTask");
- }
- }
-
// TODO: Ensure that this is actually necessary here
// Notify the voice session if required
if (voiceSession != null) {
@@ -1502,6 +1491,15 @@
mLastTaskBoundsComputeActivity = null;
}
+ // mPausingActivity is set at leaf task
+ if (mPausingActivity != null && mPausingActivity == r) {
+ mPausingActivity = null;
+ }
+
+ if (mResumedActivity != null && mResumedActivity == r) {
+ setResumedActivity(null, "cleanUpActivityReferences");
+ }
+
final WindowContainer parent = getParent();
if (parent != null && parent.asTask() != null) {
parent.asTask().cleanUpActivityReferences(r);
@@ -1509,21 +1507,38 @@
}
r.removeTimeouts();
mExitingActivities.remove(r);
-
- if (mResumedActivity != null && mResumedActivity == r) {
- setResumedActivity(null, "cleanUpActivityReferences");
- }
- if (mPausingActivity != null && mPausingActivity == r) {
- mPausingActivity = null;
- }
}
/** @return the currently resumed activity. */
ActivityRecord getResumedActivity() {
- return mResumedActivity;
+ if (isLeafTask()) {
+ return mResumedActivity;
+ }
+
+ final Task task = getTask(t -> t.mResumedActivity != null, true /* traverseTopToBottom */);
+ return task != null ? task.mResumedActivity : null;
+ }
+
+ @VisibleForTesting
+ void setPausingActivity(ActivityRecord pausing) {
+ mPausingActivity = pausing;
+ }
+
+ /**
+ * @return the currently pausing activity of this task or the topmost pausing activity of the
+ * child tasks
+ */
+ ActivityRecord getPausingActivity() {
+ if (isLeafTask()) {
+ return mPausingActivity;
+ }
+
+ final Task task = getTask(t -> t.mPausingActivity != null, true /* traverseTopToBottom */);
+ return task != null ? task.mPausingActivity : null;
}
void setResumedActivity(ActivityRecord r, String reason) {
+ warnForNonLeafTask("setResumedActivity");
if (mResumedActivity == r) {
return;
}
@@ -2163,17 +2178,7 @@
* @param reason The reason for the change.
*/
void onActivityStateChanged(ActivityRecord record, ActivityState state, String reason) {
- final Task parentTask = getParent().asTask();
- if (parentTask != null) {
- parentTask.onActivityStateChanged(record, state, reason);
- // We still want to update the resumed activity if the parent task is created by
- // organizer in order to keep the information synced once got reparented out from the
- // organized task.
- if (!parentTask.mCreatedByOrganizer) {
- return;
- }
- }
-
+ warnForNonLeafTask("onActivityStateChanged");
if (record == mResumedActivity && state != RESUMED) {
setResumedActivity(null, reason + " - onActivityStateChanged");
}
@@ -2351,7 +2356,7 @@
* Initializes a change transition. See {@link SurfaceFreezer} for more information.
*/
private void initializeChangeTransition(Rect startBounds) {
- mDisplayContent.prepareAppTransition(TRANSIT_CHANGE_WINDOWING_MODE);
+ mDisplayContent.prepareAppTransition(TRANSIT_CHANGE);
mDisplayContent.mChangingContainers.add(this);
mSurfaceFreezer.freeze(getPendingTransaction(), startBounds);
@@ -2435,8 +2440,7 @@
@Override
public SurfaceControl getFreezeSnapshotTarget() {
- if (!mDisplayContent.mAppTransition.containsTransitRequest(
- TRANSIT_CHANGE_WINDOWING_MODE)) {
+ if (!mDisplayContent.mAppTransition.containsTransitRequest(TRANSIT_CHANGE)) {
return null;
}
// Skip creating snapshot if this transition is controlled by a remote animator which
@@ -3130,12 +3134,12 @@
// and focused application if needed.
focusableTask.moveToFront(myReason);
// Top display focused stack is changed, update top resumed activity if needed.
- if (rootTask.mResumedActivity != null) {
+ if (rootTask.getResumedActivity() != null) {
mTaskSupervisor.updateTopResumedActivityIfNeeded();
// Set focused app directly because if the next focused activity is already resumed
// (e.g. the next top activity is on a different display), there won't have activity
// state change to update it.
- mAtmService.setResumedActivityUncheckLocked(rootTask.mResumedActivity, reason);
+ mAtmService.setResumedActivityUncheckLocked(rootTask.getResumedActivity(), reason);
}
return rootTask;
}
@@ -3874,6 +3878,13 @@
}
@Override
+ void forAllRootTasks(Consumer<Task> callback, boolean traverseTopToBottom) {
+ if (isRootTask()) {
+ callback.accept(this);
+ }
+ }
+
+ @Override
boolean forAllTasks(Function<Task, Boolean> callback) {
if (super.forAllTasks(callback)) return true;
return callback.apply(this);
@@ -3898,12 +3909,29 @@
}
@Override
+ boolean forAllRootTasks(Function<Task, Boolean> callback, boolean traverseTopToBottom) {
+ return isRootTask() ? callback.apply(this) : false;
+ }
+
+ @Override
Task getTask(Predicate<Task> callback, boolean traverseTopToBottom) {
final Task t = super.getTask(callback, traverseTopToBottom);
if (t != null) return t;
return callback.test(this) ? this : null;
}
+ @Nullable
+ @Override
+ Task getRootTask(Predicate<Task> callback, boolean traverseTopToBottom) {
+ return isRootTask() && callback.test(this) ? this : null;
+ }
+
+ @Nullable
+ @Override
+ <R> R getItemFromRootTasks(Function<Task, R> callback, boolean traverseTopToBottom) {
+ return isRootTask() ? callback.apply(this) : null;
+ }
+
/**
* @param canAffectSystemUiFlags If false, all windows in this task can not affect SystemUI
* flags. See {@link WindowState#canAffectSystemUiFlags()}.
@@ -4078,15 +4106,10 @@
info.resizeMode = top != null ? top.mResizeMode : mResizeMode;
info.topActivityType = top.getActivityType();
info.isResizeable = isResizeable();
- // Don't query getTopNonFinishingActivity().getBounds() directly because when fillTaskInfo
- // is triggered for the first time after activities change, getBounds() may return non final
- // bounds, e.g. fullscreen bounds instead of letterboxed bounds. To work around this,
- // assigning bounds from ActivityRecord#layoutLetterbox when they are ready.
- info.letterboxActivityBounds = Rect.copyOrNull(mLetterboxActivityBounds);
- info.positionInParent = getRelativePosition();
- info.parentBounds = getParentBounds();
- info.pictureInPictureParams = getPictureInPictureParams();
+ info.positionInParent = getRelativePosition();
+
+ info.pictureInPictureParams = getPictureInPictureParams(top);
info.topActivityInfo = mReuseActivitiesReport.top != null
? mReuseActivitiesReport.top.info
: null;
@@ -4103,32 +4126,16 @@
}
@Nullable PictureInPictureParams getPictureInPictureParams() {
- final Task top = getTopMostTask();
+ return getPictureInPictureParams(getTopMostTask());
+ }
+
+ private @Nullable PictureInPictureParams getPictureInPictureParams(Task top) {
if (top == null) return null;
final ActivityRecord rootActivity = top.getRootActivity();
return (rootActivity == null || rootActivity.pictureInPictureArgs.empty())
? null : new PictureInPictureParams(rootActivity.pictureInPictureArgs);
}
- void maybeUpdateLetterboxBounds(
- ActivityRecord activityRecord, @Nullable Rect letterboxActivityBounds) {
- if (isOrganized()
- && mReuseActivitiesReport.top == activityRecord
- // Want to force update only if letterbox bounds have changed.
- && !Objects.equals(
- mLetterboxActivityBounds,
- letterboxActivityBounds)) {
- mLetterboxActivityBounds = Rect.copyOrNull(letterboxActivityBounds);
- // Forcing update to reduce visual jank during the transition.
- dispatchTaskInfoChangedIfNeeded(true /* force */);
- }
- }
-
- private Rect getParentBounds() {
- final WindowContainer parent = getParent();
- return parent != null ? new Rect(parent.getBounds()) : new Rect();
- }
-
/**
* Returns a {@link TaskInfo} with information from this task.
*/
@@ -5414,6 +5421,12 @@
}
void awakeFromSleepingLocked() {
+ if (!isLeafTask()) {
+ forAllLeafTasks((task) -> task.awakeFromSleepingLocked(),
+ true /* traverseTopToBottom */);
+ return;
+ }
+
if (mPausingActivity != null) {
Slog.d(TAG, "awakeFromSleepingLocked: previously pausing activity didn't pause");
mPausingActivity.activityPaused(true);
@@ -5438,8 +5451,17 @@
* process of going to sleep (checkReadyForSleep will be called when that process finishes).
*/
boolean goToSleepIfPossible(boolean shuttingDown) {
- boolean shouldSleep = true;
+ if (!isLeafTask()) {
+ final int[] sleepInProgress = {0};
+ forAllLeafTasks((t) -> {
+ if (!t.goToSleepIfPossible(shuttingDown)) {
+ sleepInProgress[0]++;
+ }
+ }, true);
+ return sleepInProgress[0] == 0;
+ }
+ boolean shouldSleep = true;
if (mResumedActivity != null) {
// Still have something resumed; can't sleep until it is paused.
ProtoLog.v(WM_DEBUG_STATES, "Sleep needs to pause %s", mResumedActivity);
@@ -5499,6 +5521,16 @@
*/
final boolean startPausingLocked(boolean userLeaving, boolean uiSleeping,
ActivityRecord resuming, String reason) {
+ if (!isLeafTask()) {
+ final int[] pausing = {0};
+ forAllLeafTasks((t) -> {
+ if (t.startPausingLocked(userLeaving, uiSleeping, resuming, reason)) {
+ pausing[0]++;
+ }
+ }, true /* traverseTopToBottom */);
+ return pausing[0] > 0;
+ }
+
if (mPausingActivity != null) {
Slog.wtf(TAG, "Going to pause when pause is already pending for " + mPausingActivity
+ " state=" + mPausingActivity.getState());
@@ -5629,6 +5661,10 @@
@VisibleForTesting
void completePauseLocked(boolean resumeNext, ActivityRecord resuming) {
+ // Complete the pausing process of a pausing activity, so it doesn't make sense to
+ // operate on non-leaf tasks.
+ warnForNonLeafTask("completePauseLocked");
+
ActivityRecord prev = mPausingActivity;
ProtoLog.v(WM_DEBUG_STATES, "Complete pause: %s", prev);
@@ -5888,24 +5924,34 @@
return false;
}
- boolean result = false;
+ boolean someActivityResumed = false;
try {
// Protect against recursion.
mInResumeTopActivity = true;
- // TODO(b/172885410): Allow the top activities of all visible leaf tasks to be resumed
- if (mCreatedByOrganizer && !isLeafTask()
- && getConfiguration().windowConfiguration.getWindowingMode()
- == WINDOWING_MODE_FULLSCREEN) {
- for (int i = mChildren.size() - 1; i >= 0; i--) {
- final Task child = (Task) getChildAt(i);
- if (!child.shouldBeVisible(null /* starting */)) {
+ if (isLeafTask()) {
+ someActivityResumed = resumeTopActivityInnerLocked(prev, options);
+ } else {
+ int idx = mChildren.size() - 1;
+ while (idx >= 0) {
+ final Task child = (Task) getChildAt(idx--);
+ if (!child.isFocusableAndVisible()) {
break;
}
- result |= child.resumeTopActivityUncheckedLocked(prev, options);
+
+ // Only allow one activity to be resumed among sibling tasks in split-screen.
+ if (inSplitScreenWindowingMode() && someActivityResumed) {
+ break;
+ }
+
+ someActivityResumed |= child.resumeTopActivityUncheckedLocked(prev, options);
+ // Doing so in order to prevent IndexOOB since hierarchy might changes while
+ // resuming activities, for example dismissing split-screen while starting
+ // non-resizeable activity.
+ if (idx >= mChildren.size()) {
+ idx = mChildren.size() - 1;
+ }
}
- } else {
- result = resumeTopActivityInnerLocked(prev, options);
}
// When resuming the top activity, it may be necessary to pause the top activity (for
@@ -5923,7 +5969,7 @@
mInResumeTopActivity = false;
}
- return result;
+ return someActivityResumed;
}
@GuardedBy("mService")
@@ -6037,7 +6083,7 @@
// So, why aren't we using prev here??? See the param comment on the method. prev
// doesn't represent the last resumed activity. However, the last focus stack does if
// it isn't null.
- lastResumed = lastFocusedStack.mResumedActivity;
+ lastResumed = lastFocusedStack.getResumedActivity();
if (userLeaving && inMultiWindowMode() && lastFocusedStack.shouldBeVisible(next)) {
// The user isn't leaving if this stack is the multi-window mode and the last
// focused stack should still be visible.
@@ -6206,7 +6252,7 @@
next.startLaunchTickingLocked();
ActivityRecord lastResumedActivity =
- lastFocusedStack == null ? null : lastFocusedStack.mResumedActivity;
+ lastFocusedStack == null ? null : lastFocusedStack.getResumedActivity();
final ActivityState lastState = next.getState();
mAtmService.updateCpuStats();
@@ -7060,6 +7106,7 @@
* @return {@code true} if the process of the pausing activity is died.
*/
boolean handleAppDied(WindowProcessController app) {
+ warnForNonLeafTask("handleAppDied");
boolean isPausingDied = false;
if (mPausingActivity != null && mPausingActivity.app == app) {
ProtoLog.v(WM_DEBUG_STATES, "App died while pausing: %s",
@@ -7097,7 +7144,7 @@
printed = true;
}
- printed |= printThisActivity(pw, mPausingActivity, dumpPackage, false,
+ printed |= printThisActivity(pw, getPausingActivity(), dumpPackage, false,
" mPausingActivity: ", null);
printed |= printThisActivity(pw, getResumedActivity(), dumpPackage, false,
" mResumedActivity: ", null);
@@ -7276,7 +7323,7 @@
task.updateOverrideConfigurationForStack(this);
final ActivityRecord topRunningActivity = task.topRunningActivityLocked();
- final boolean wasResumed = topRunningActivity == task.getRootTask().mResumedActivity;
+ final boolean wasResumed = topRunningActivity == task.mResumedActivity;
boolean toTop = position >= getChildCount();
boolean includingParents = toTop || getDisplayArea().getNextFocusableRootTask(this,
@@ -7299,7 +7346,7 @@
if (wasResumed) {
if (mResumedActivity != null) {
Log.wtf(TAG, "mResumedActivity was already set when moving mResumedActivity from"
- + " other stack to this stack mResumedActivity=" + mResumedActivity
+ + " other stack to this task mResumedActivity=" + mResumedActivity
+ " other mResumedActivity=" + topRunningActivity);
}
topRunningActivity.setState(RESUMED, "positionChildAt");
@@ -7325,34 +7372,6 @@
taskDisplayArea.positionChildAt(POSITION_TOP, this, false /* includingParents */);
}
- /** NOTE: Should only be called from {@link Task#reparent}. */
- void moveToFrontAndResumeStateIfNeeded(ActivityRecord r, boolean moveToFront, boolean setResume,
- boolean setPause, String reason) {
- if (!moveToFront) {
- return;
- }
-
- final ActivityState origState = r.getState();
- // If the activity owns the last resumed activity, transfer that together,
- // so that we don't resume the same activity again in the new stack.
- // Apps may depend on onResume()/onPause() being called in pairs.
- if (setResume) {
- r.setState(RESUMED, "moveToFrontAndResumeStateIfNeeded");
- }
- // If the activity was previously pausing, then ensure we transfer that as well
- if (setPause) {
- mPausingActivity = r;
- r.schedulePauseTimeout();
- }
- // Move the stack in which we are placing the activity to the front.
- moveToFront(reason);
- // If the original state is resumed, there is no state change to update focused app.
- // So here makes sure the activity focus is set if it is the top.
- if (origState == RESUMED && r == mRootWindowContainer.getTopResumedActivity()) {
- mAtmService.setResumedActivityUncheckLocked(r, reason);
- }
- }
-
void dismissPip() {
if (!isActivityTypeStandardOrUndefined()) {
throw new IllegalArgumentException(
@@ -7502,6 +7521,15 @@
}
/**
+ * Simply check and give warning logs if this is not operated on leaf task.
+ */
+ private void warnForNonLeafTask(String func) {
+ if (!isLeafTask()) {
+ Slog.w(TAG, func + " on non-leaf task " + this);
+ }
+ }
+
+ /**
* Sets the current picture-in-picture aspect ratio.
*/
void setPictureInPictureAspectRatio(float aspectRatio) {
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java
index 9425602..7fed840 100644
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
@@ -33,7 +33,6 @@
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
-import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ORIENTATION;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_STATES;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_TASKS;
@@ -474,7 +473,7 @@
private int findMinPositionForRootTask(Task rootTask) {
int minPosition = POSITION_BOTTOM;
for (int i = 0; i < mChildren.size(); ++i) {
- if (getPriority(getRootTaskAt(i)) < getPriority(rootTask)) {
+ if (getPriority(mChildren.get(i)) < getPriority(rootTask)) {
minPosition = i;
} else {
break;
@@ -495,7 +494,7 @@
private int findMaxPositionForRootTask(Task rootTask) {
for (int i = mChildren.size() - 1; i >= 0; --i) {
- final Task curr = getRootTaskAt(i);
+ final Task curr = mChildren.get(i);
// Since a stack could be repositioned while still being one of the children, we check
// if 'curr' is the same stack and skip it if so
final boolean sameRootTask = curr == rootTask;
@@ -610,34 +609,6 @@
return false;
}
- void setExitingTokensHasVisible(boolean hasVisible) {
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final ArrayList<ActivityRecord> activities = mChildren.get(i).mExitingActivities;
- for (int j = activities.size() - 1; j >= 0; --j) {
- activities.get(j).hasVisible = hasVisible;
- }
- }
- }
-
- void removeExistingAppTokensIfPossible() {
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final ArrayList<ActivityRecord> activities = mChildren.get(i).mExitingActivities;
- for (int j = activities.size() - 1; j >= 0; --j) {
- final ActivityRecord activity = activities.get(j);
- if (!activity.hasVisible && !mDisplayContent.mClosingApps.contains(activity)
- && (!activity.mIsExiting || activity.isEmpty())) {
- // Make sure there is no animation running on this activity, so any windows
- // associated with it will be removed as soon as their animations are
- // complete.
- cancelAnimation();
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "performLayout: Activity exiting now removed %s", activity);
- activity.removeIfPossible();
- }
- }
- }
- }
-
@Override
int getOrientation(int candidate) {
mLastOrientationSource = null;
@@ -894,16 +865,6 @@
}
}
- Task getRootTask(int rootTaskId) {
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = getRootTaskAt(i);
- if (stack.getRootTaskId() == rootTaskId) {
- return stack;
- }
- }
- return null;
- }
-
/**
* Returns an existing stack compatible with the windowing mode and activity type or creates one
* if a compatible stack doesn't exist.
@@ -1065,15 +1026,15 @@
// Only split-screen windowing modes can do this currently...
return null;
}
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task t = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task t = mChildren.get(i);
if (!t.mCreatedByOrganizer || t.getRequestedOverrideWindowingMode() != windowingMode) {
continue;
}
// If not already set, pick a launch root which is not the one we are launching into.
if (mLaunchRootTask == null) {
- for (int j = 0, n = getRootTaskCount(); j < n; ++j) {
- final Task tt = getRootTaskAt(j);
+ for (int j = 0, n = mChildren.size(); j < n; ++j) {
+ final Task tt = mChildren.get(j);
if (tt.mCreatedByOrganizer && tt != t) {
mLaunchRootTask = tt;
break;
@@ -1128,8 +1089,8 @@
return mPreferredTopFocusableRootTask;
}
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task stack = mChildren.get(i);
if (stack.isFocusableAndVisible()) {
return stack;
}
@@ -1143,8 +1104,8 @@
? currentFocus.getWindowingMode() : WINDOWING_MODE_UNDEFINED;
Task candidate = null;
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task rootTask = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task rootTask = mChildren.get(i);
if (ignoreCurrent && rootTask == currentFocus) {
continue;
}
@@ -1184,7 +1145,7 @@
if (resumedActivity == null || resumedActivity.app == null) {
// If there is no registered resumed activity in the stack or it is not running -
// try to use previously resumed one.
- resumedActivity = focusedStack.mPausingActivity;
+ resumedActivity = focusedStack.getPausingActivity();
if (resumedActivity == null || resumedActivity.app == null) {
// If previously resumed activity doesn't work either - find the topmost running
// activity that can be focused.
@@ -1223,8 +1184,8 @@
}
boolean allResumedActivitiesComplete() {
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final ActivityRecord r = getRootTaskAt(stackNdx).getResumedActivity();
+ for (int stackNdx = mChildren.size() - 1; stackNdx >= 0; --stackNdx) {
+ final ActivityRecord r = mChildren.get(stackNdx).getResumedActivity();
if (r != null && !r.isState(RESUMED)) {
return false;
}
@@ -1250,20 +1211,21 @@
* @return {@code true} if any activity was paused as a result of this call.
*/
boolean pauseBackTasks(boolean userLeaving, ActivityRecord resuming) {
- boolean someActivityPaused = false;
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getRootTaskAt(stackNdx);
- final ActivityRecord resumedActivity = stack.getResumedActivity();
+ final int[] someActivityPaused = {0};
+ forAllLeafTasks((task) -> {
+ final ActivityRecord resumedActivity = task.getResumedActivity();
if (resumedActivity != null
- && (stack.getVisibility(resuming) != TASK_VISIBILITY_VISIBLE
- || !stack.isTopActivityFocusable())) {
- ProtoLog.d(WM_DEBUG_STATES, "pauseBackStacks: stack=%s "
- + "mResumedActivity=%s", stack, resumedActivity);
- someActivityPaused |= stack.startPausingLocked(userLeaving, false /* uiSleeping*/,
- resuming, "pauseBackStacks");
+ && (task.getVisibility(resuming) != TASK_VISIBILITY_VISIBLE
+ || !task.isTopActivityFocusable())) {
+ ProtoLog.d(WM_DEBUG_STATES, "pauseBackStacks: task=%s "
+ + "mResumedActivity=%s", task, resumedActivity);
+ if (task.startPausingLocked(userLeaving, false /* uiSleeping*/,
+ resuming, "pauseBackStacks")) {
+ someActivityPaused[0]++;
+ }
}
- }
- return someActivityPaused;
+ }, true /* traverseTopToBottom */);
+ return someActivityPaused[0] > 0;
}
/**
@@ -1272,8 +1234,8 @@
void findTaskLocked(final ActivityRecord r, final boolean isPreferredDisplayArea,
RootWindowContainer.FindTaskResult result) {
mTmpFindTaskResult.clear();
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getRootTaskAt(stackNdx);
+ for (int stackNdx = mChildren.size() - 1; stackNdx >= 0; --stackNdx) {
+ final Task stack = mChildren.get(stackNdx);
if (!r.hasCompatibleActivityType(stack) && stack.isLeafTask()) {
ProtoLog.d(WM_DEBUG_TASKS, "Skipping stack: (mismatch activity/stack) "
+ "%s", stack);
@@ -1300,69 +1262,6 @@
}
}
- /**
- * Removes root tasks in the input windowing modes from the system if they are of activity type
- * ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED
- */
- void removeRootTasksInWindowingModes(int... windowingModes) {
- if (windowingModes == null || windowingModes.length == 0) {
- return;
- }
-
- // Collect the root tasks that are necessary to be removed instead of performing the removal
- // by looping the children, so that we don't miss any root tasks after the children size
- // changed or reordered.
- final ArrayList<Task> rootTasks = new ArrayList<>();
- for (int j = windowingModes.length - 1; j >= 0; --j) {
- final int windowingMode = windowingModes[j];
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final Task rootTask = mChildren.get(i);
- if (rootTask.mCreatedByOrganizer
- || !rootTask.isActivityTypeStandardOrUndefined()
- || rootTask.getWindowingMode() != windowingMode) {
- continue;
- }
- rootTasks.add(rootTask);
- }
- }
-
- for (int i = rootTasks.size() - 1; i >= 0; --i) {
- mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
- }
- }
-
- void removeRootTasksWithActivityTypes(int... activityTypes) {
- if (activityTypes == null || activityTypes.length == 0) {
- return;
- }
-
- // Collect the root tasks that are necessary to be removed instead of performing the removal
- // by looping the children, so that we don't miss any root tasks after the children size
- // changed or reordered.
- final ArrayList<Task> rootTasks = new ArrayList<>();
- for (int j = activityTypes.length - 1; j >= 0; --j) {
- final int activityType = activityTypes[j];
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final Task rootTask = mChildren.get(i);
- // Collect the root tasks that are currently being organized.
- if (rootTask.mCreatedByOrganizer) {
- for (int k = rootTask.getChildCount() - 1; k >= 0; --k) {
- final Task task = (Task) rootTask.getChildAt(k);
- if (task.getActivityType() == activityType) {
- rootTasks.add(task);
- }
- }
- } else if (rootTask.getActivityType() == activityType) {
- rootTasks.add(rootTask);
- }
- }
- }
-
- for (int i = rootTasks.size() - 1; i >= 0; --i) {
- mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
- }
- }
-
void onSplitScreenModeDismissed() {
// The focused task could be a non-resizeable fullscreen root task that is on top of the
// other split-screen tasks, therefore had to dismiss split-screen, make sure the current
@@ -1582,8 +1481,8 @@
// Look in other focusable stacks.
if (topRunning == null) {
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task stack = mChildren.get(i);
// Only consider focusable stacks other than the current focused one.
if (stack == focusedStack || !stack.isTopActivityFocusable()) {
continue;
@@ -1608,11 +1507,11 @@
}
protected int getRootTaskCount() {
- return mChildren.size();
- }
-
- protected Task getRootTaskAt(int index) {
- return mChildren.get(index);
+ final int[] count = new int[1];
+ forAllRootTasks(task -> {
+ count[0]++;
+ });
+ return count[0];
}
@Nullable
@@ -1711,9 +1610,9 @@
// Find the next position where the stack should be placed
final boolean isRootTask = rootTask.isRootTask();
final int numRootTasks =
- isRootTask ? getRootTaskCount() : rootTask.getParent().getChildCount();
+ isRootTask ? mChildren.size() : rootTask.getParent().getChildCount();
for (int rootTaskNdx = 0; rootTaskNdx < numRootTasks; rootTaskNdx++) {
- final Task s = isRootTask ? getRootTaskAt(rootTaskNdx)
+ final Task s = isRootTask ? mChildren.get(rootTaskNdx)
: (Task) rootTask.getParent().getChildAt(rootTaskNdx);
if (s == rootTask) {
continue;
@@ -1836,8 +1735,8 @@
boolean preserveWindows, boolean notifyClients, boolean userLeaving) {
mAtmService.mTaskSupervisor.beginActivityVisibilityUpdate();
try {
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getRootTaskAt(stackNdx);
+ for (int stackNdx = mChildren.size() - 1; stackNdx >= 0; --stackNdx) {
+ final Task stack = mChildren.get(stackNdx);
stack.ensureActivitiesVisible(starting, configChanges, preserveWindows,
notifyClients, userLeaving);
}
@@ -1846,13 +1745,6 @@
}
}
- void prepareFreezingTaskBounds() {
- for (int stackNdx = getChildCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getChildAt(stackNdx);
- stack.prepareFreezingTaskBounds();
- }
- }
-
/**
* Removes the stacks in the node applying the content removal node from the display.
*
@@ -1871,13 +1763,13 @@
// related WindowContainer will also be removed. So, we set display area as removed after
// reparenting stack finished.
// Keep the order from bottom to top.
- int numStacks = getRootTaskCount();
+ int numStacks = mChildren.size();
final boolean splitScreenActivated = toDisplayArea.isSplitScreenModeActivated();
final Task rootStack = splitScreenActivated ? toDisplayArea
.getTopRootTaskInWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) : null;
for (int stackNdx = 0; stackNdx < numStacks; stackNdx++) {
- final Task stack = getRootTaskAt(stackNdx);
+ final Task stack = mChildren.get(stackNdx);
// Always finish non-standard type stacks and stacks created by a organizer.
// TODO: For stacks created by organizer, consider reparenting children tasks if the use
// case arises in the future.
@@ -1897,8 +1789,8 @@
}
// Stacks may be removed from this display. Ensure each stack will be processed
// and the loop will end.
- stackNdx -= numStacks - getRootTaskCount();
- numStacks = getRootTaskCount();
+ stackNdx -= numStacks - mChildren.size();
+ numStacks = mChildren.size();
}
if (lastReparentedStack != null && splitScreenActivated) {
if (!lastReparentedStack.supportsSplitScreenWindowingMode()) {
diff --git a/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java b/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java
index 9d36b84..a7306c9 100644
--- a/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java
+++ b/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java
@@ -795,17 +795,13 @@
private void adjustBoundsToAvoidConflictInDisplay(@NonNull DisplayContent display,
@NonNull Rect inOutBounds) {
final List<Rect> taskBoundsToCheck = new ArrayList<>();
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- int numStacks = taskDisplayArea.getRootTaskCount();
- for (int sNdx = 0; sNdx < numStacks; ++sNdx) {
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (!task.inFreeformWindowingMode()) {
- continue;
- }
+ display.forAllRootTasks(task -> {
+ if (!task.inFreeformWindowingMode()) {
+ return;
+ }
- for (int j = 0; j < task.getChildCount(); ++j) {
- taskBoundsToCheck.add(task.getChildAt(j).getBounds());
- }
+ for (int j = 0; j < task.getChildCount(); ++j) {
+ taskBoundsToCheck.add(task.getChildAt(j).getBounds());
}
}, false /* traverseTopToBottom */);
adjustBoundsToAvoidConflict(display.getBounds(), taskBoundsToCheck, inOutBounds);
diff --git a/services/core/java/com/android/server/wm/TaskOrganizerController.java b/services/core/java/com/android/server/wm/TaskOrganizerController.java
index e635219..58aca20 100644
--- a/services/core/java/com/android/server/wm/TaskOrganizerController.java
+++ b/services/core/java/com/android/server/wm/TaskOrganizerController.java
@@ -21,6 +21,7 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_WINDOW_ORGANIZER;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.WindowOrganizerController.CONTROLLABLE_CONFIGS;
import static com.android.server.wm.WindowOrganizerController.CONTROLLABLE_WINDOW_CONFIGS;
@@ -272,7 +273,9 @@
void removeTask(Task t) {
if (t.mTaskAppearedSent) {
- t.migrateToNewSurfaceControl();
+ if (t.getSurfaceControl() != null) {
+ t.migrateToNewSurfaceControl();
+ }
t.mTaskAppearedSent = false;
mOrganizer.onTaskVanished(t);
}
@@ -288,8 +291,7 @@
// possible.
while (!mOrganizedTasks.isEmpty()) {
final Task t = mOrganizedTasks.get(0);
- t.updateTaskOrganizerState(true /* forceUpdate */);
- if (mOrganizedTasks.contains(t)) {
+ if (!t.updateTaskOrganizerState(true /* forceUpdate */)) {
removeTask(t);
}
}
@@ -579,11 +581,11 @@
synchronized (mGlobalLock) {
DisplayContent dc = mService.mWindowManager.mRoot
.getDisplayContent(displayId);
- if (dc == null || dc.mInputMethodTarget == null) {
+ if (dc == null || dc.getImeTarget(IME_TARGET_LAYERING) == null) {
return null;
}
// Avoid WindowState#getRootTask() so we don't attribute system windows to a task.
- final Task task = dc.mInputMethodTarget.getTask();
+ final Task task = dc.getImeTarget(IME_TARGET_LAYERING).getWindow().getTask();
if (task == null) {
return null;
}
@@ -686,16 +688,13 @@
if (dc == null) {
throw new IllegalArgumentException("Display " + displayId + " doesn't exist");
}
- ArrayList<RunningTaskInfo> out = new ArrayList<>();
- dc.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (activityTypes != null
- && !ArrayUtils.contains(activityTypes, task.getActivityType())) {
- continue;
- }
- out.add(task.getTaskInfo());
+ final ArrayList<RunningTaskInfo> out = new ArrayList<>();
+ dc.forAllRootTasks(task -> {
+ if (activityTypes != null
+ && !ArrayUtils.contains(activityTypes, task.getActivityType())) {
+ return;
}
+ out.add(task.getTaskInfo());
});
return out;
}
diff --git a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
index 3def091..1779d2a 100644
--- a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
+++ b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
@@ -60,7 +60,7 @@
surface.attachAndQueueBufferWithColorSpace(buffer, screenshotBuffer.getColorSpace());
surface.release();
final float scale = 1.0f * mTask.getBounds().width() / mWidth;
- mSurfaceControl.setMatrix(scale, 0, 0, scale);
+ getPendingTransaction().setMatrix(mSurfaceControl, scale, 0, 0, scale);
}
getPendingTransaction().show(mSurfaceControl);
}
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotController.java b/services/core/java/com/android/server/wm/TaskSnapshotController.java
index 616a789..b2f3062 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotController.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotController.java
@@ -369,7 +369,8 @@
SurfaceControl[] excludeLayers;
final WindowState imeWindow = task.getDisplayContent().mInputMethodWindow;
// Exclude IME window snapshot when IME isn't proper to attach to app.
- if (imeWindow != null && !task.getDisplayContent().isImeAttachedToApp()) {
+ if (imeWindow != null && imeWindow.getSurfaceControl() != null
+ && !task.getDisplayContent().isImeAttachedToApp()) {
excludeLayers = new SurfaceControl[1];
excludeLayers[0] = imeWindow.getSurfaceControl();
} else {
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index 0cdd055..14504d8 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -18,11 +18,18 @@
import static android.view.Display.DEFAULT_DISPLAY;
+import static android.view.WindowManager.TRANSIT_CHANGE;
+import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
+import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_LOCKED;
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
+import static android.view.WindowManager.TRANSIT_NONE;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -282,9 +289,13 @@
mState = STATE_PLAYING;
mController.moveToPlaying(this);
+ if (mController.mAtm.mTaskSupervisor.getKeyguardController().isKeyguardLocked()) {
+ mFlags |= TRANSIT_FLAG_KEYGUARD_LOCKED;
+ }
+
// Resolve the animating targets from the participants
mTargets = calculateTargets(mParticipants, mChanges);
- final TransitionInfo info = calculateTransitionInfo(mType, mTargets, mChanges);
+ final TransitionInfo info = calculateTransitionInfo(mType, mFlags, mTargets, mChanges);
mRootLeash = info.getRootLeash();
handleNonAppWindowsInTransition(displayId, mType, mFlags);
@@ -337,6 +348,9 @@
mController.mAtm.mWindowManager.mPolicy.startKeyguardExitAnimation(
SystemClock.uptimeMillis(), 0 /* duration */);
}
+ if ((flags & TRANSIT_FLAG_KEYGUARD_LOCKED) != 0) {
+ mController.mAtm.mWindowManager.mPolicy.applyKeyguardOcclusionChange();
+ }
}
@Override
@@ -389,7 +403,7 @@
parent == null ? "no parent" : ("parent can't be target " + parent));
return false;
}
- @TransitionInfo.TransitionMode int mode = TransitionInfo.TRANSIT_NONE;
+ @TransitionInfo.TransitionMode int mode = TRANSIT_NONE;
// Go through all siblings of this target to see if any of them would prevent
// the target from promoting.
siblingLoop:
@@ -403,11 +417,11 @@
if (depth < 0) continue;
if (depth == 0) {
final int siblingMode = sibling.isVisibleRequested()
- ? TransitionInfo.TRANSIT_OPEN : TransitionInfo.TRANSIT_CLOSE;
+ ? TRANSIT_OPEN : TRANSIT_CLOSE;
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
" sibling is a top target with mode %s",
TransitionInfo.modeToString(siblingMode));
- if (mode == TransitionInfo.TRANSIT_NONE) {
+ if (mode == TRANSIT_NONE) {
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
" no common mode yet, so set it");
mode = siblingMode;
@@ -587,9 +601,9 @@
*/
@VisibleForTesting
@NonNull
- static TransitionInfo calculateTransitionInfo(int type, ArraySet<WindowContainer> targets,
- ArrayMap<WindowContainer, ChangeInfo> changes) {
- final TransitionInfo out = new TransitionInfo(type);
+ static TransitionInfo calculateTransitionInfo(int type, int flags,
+ ArraySet<WindowContainer> targets, ArrayMap<WindowContainer, ChangeInfo> changes) {
+ final TransitionInfo out = new TransitionInfo(type, flags);
if (targets.isEmpty()) {
out.setRootLeash(new SurfaceControl(), 0, 0);
return out;
@@ -693,12 +707,12 @@
int getTransitMode(@NonNull WindowContainer wc) {
final boolean nowVisible = wc.isVisibleRequested();
if (nowVisible == mVisible) {
- return TransitionInfo.TRANSIT_CHANGE;
+ return TRANSIT_CHANGE;
}
if (mExistenceChanged) {
- return nowVisible ? TransitionInfo.TRANSIT_OPEN : TransitionInfo.TRANSIT_CLOSE;
+ return nowVisible ? TRANSIT_OPEN : TRANSIT_CLOSE;
} else {
- return nowVisible ? TransitionInfo.TRANSIT_SHOW : TransitionInfo.TRANSIT_HIDE;
+ return nowVisible ? TRANSIT_TO_FRONT : TRANSIT_TO_BACK;
}
}
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index adc7a22..6e0fec1 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -1664,6 +1664,39 @@
}
/**
+ * For all root tasks at or below this container call the callback.
+ *
+ * @param callback Calls the {@link ToBooleanFunction#apply} method for each root task found and
+ * stops the search if {@link ToBooleanFunction#apply} returns {@code true}.
+ */
+ boolean forAllRootTasks(Function<Task, Boolean> callback) {
+ return forAllRootTasks(callback, true /* traverseTopToBottom */);
+ }
+
+ boolean forAllRootTasks(Function<Task, Boolean> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ if (mChildren.get(i).forAllRootTasks(callback)) {
+ return true;
+ }
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ if (mChildren.get(i).forAllRootTasks(callback)) {
+ return true;
+ }
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+ return false;
+ }
+
+ /**
* For all tasks at or below this container call the callback.
*
* @param callback Callback to be called for every task.
@@ -1698,6 +1731,33 @@
}
}
+ /**
+ * For all root tasks at or below this container call the callback.
+ *
+ * @param callback Callback to be called for every root task.
+ */
+ void forAllRootTasks(Consumer<Task> callback) {
+ forAllRootTasks(callback, true /* traverseTopToBottom */);
+ }
+
+ void forAllRootTasks(Consumer<Task> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ mChildren.get(i).forAllRootTasks(callback, traverseTopToBottom);
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ mChildren.get(i).forAllRootTasks(callback, traverseTopToBottom);
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+ }
+
Task getTaskAbove(Task t) {
return getTask(
(above) -> true, t, false /*includeBoundary*/, false /*traverseTopToBottom*/);
@@ -1780,6 +1840,44 @@
return null;
}
+ /**
+ * Gets a root task in a branch of the tree.
+ *
+ * @param callback called to test if this is the task that should be returned.
+ * @return The root task if found or null.
+ */
+ @Nullable
+ Task getRootTask(Predicate<Task> callback) {
+ return getRootTask(callback, true /*traverseTopToBottom*/);
+ }
+
+ @Nullable
+ Task getRootTask(Predicate<Task> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ final Task t = mChildren.get(i).getRootTask(callback, traverseTopToBottom);
+ if (t != null) {
+ return t;
+ }
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ final Task t = mChildren.get(i).getRootTask(callback, traverseTopToBottom);
+ if (t != null) {
+ return t;
+ }
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+
+ return null;
+ }
+
private Task processGetTaskWithBoundary(Predicate<Task> callback,
WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom,
boolean[] boundaryFound, WindowContainer wc) {
@@ -1973,6 +2071,47 @@
}
/**
+ * Finds the first non {@code null} return value from calling the callback on all root
+ * {@link Task} at or below this container.
+ * @param callback Applies on each root {@link Task} found and stops the search if it
+ * returns non {@code null}.
+ * @param traverseTopToBottom If {@code true}, traverses the hierarchy from top-to-bottom in
+ * terms of z-order, else from bottom-to-top.
+ * @return the first returned object that is not {@code null}. Returns {@code null} if not
+ * found.
+ */
+ @Nullable
+ <R> R getItemFromRootTasks(Function<Task, R> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ R result = (R) mChildren.get(i).getItemFromRootTasks(callback, traverseTopToBottom);
+ if (result != null) {
+ return result;
+ }
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ R result = (R) mChildren.get(i).getItemFromRootTasks(callback, traverseTopToBottom);
+ if (result != null) {
+ return result;
+ }
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+ return null;
+ }
+
+ @Nullable
+ <R> R getItemFromRootTasks(Function<Task, R> callback) {
+ return getItemFromRootTasks(callback, true /* traverseTopToBottom */);
+ }
+
+ /**
* Returns 1, 0, or -1 depending on if this container is greater than, equal to, or lesser than
* the input container in terms of z-order.
*/
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 8fd342c..6f10edf 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -48,6 +48,7 @@
import static android.provider.Settings.Global.DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static android.view.WindowManager.DISPLAY_IME_POLICY_FALLBACK_DISPLAY;
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
@@ -104,6 +105,9 @@
import static com.android.server.LockGuard.INDEX_WINDOW;
import static com.android.server.LockGuard.installLock;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
+import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
@@ -1036,7 +1040,7 @@
private WindowContentFrameStats mTempWindowRenderStats;
- private final LatencyTracker mLatencyTracker;
+ final LatencyTracker mLatencyTracker;
/**
* Whether the UI is currently running in touch mode (not showing
@@ -1120,18 +1124,16 @@
// While running a recents animation, this will get called early because we show the
// recents animation target activity immediately when the animation starts. Defer the
// mLaunchTaskBehind updates until recents animation finishes.
- final boolean isRecentsAnimationTarget = getRecentsAnimationController() != null
- && getRecentsAnimationController().isTargetApp(atoken);
- if (atoken.mLaunchTaskBehind && !isRecentsAnimationTarget) {
+ if (atoken.mLaunchTaskBehind && !isRecentsAnimationTarget(atoken)) {
mAtmService.mTaskSupervisor.scheduleLaunchTaskBehindComplete(atoken.token);
atoken.mLaunchTaskBehind = false;
} else {
atoken.updateReportedVisibilityLocked();
// We should also defer sending the finished callback until the recents animation
// successfully finishes.
- if (atoken.mEnteringAnimation && !isRecentsAnimationTarget) {
+ if (atoken.mEnteringAnimation && !isRecentsAnimationTarget(atoken)) {
atoken.mEnteringAnimation = false;
- if (atoken != null && atoken.attachedToProcess()) {
+ if (atoken.attachedToProcess()) {
try {
atoken.app.getThread().scheduleEnterAnimationComplete(atoken.appToken);
} catch (RemoteException e) {
@@ -2557,7 +2559,7 @@
// side child surfaces, so they will remain preserved in their current state
// (rather than be cleaned up immediately by the app code).
SurfaceControl.openTransaction();
- winAnimator.detachChildren();
+ winAnimator.detachChildren(getGlobalTransaction());
SurfaceControl.closeTransaction();
return focusMayChange;
@@ -2968,6 +2970,10 @@
}
}
+ boolean isRecentsAnimationTarget(ActivityRecord r) {
+ return mRecentsAnimationController != null && mRecentsAnimationController.isTargetApp(r);
+ }
+
void setWindowOpaqueLocked(IBinder token, boolean isOpaque) {
final ActivityRecord wtoken = mRoot.getActivityRecord(token);
if (wtoken != null) {
@@ -5349,7 +5355,7 @@
void destroyPreservedSurfaceLocked() {
for (int i = mDestroyPreservedSurface.size() - 1; i >= 0 ; i--) {
final WindowState w = mDestroyPreservedSurface.get(i);
- w.mWinAnimator.destroyPreservedSurfaceLocked();
+ w.mWinAnimator.destroyPreservedSurfaceLocked(w.getSyncTransaction());
}
mDestroyPreservedSurface.clear();
}
@@ -6321,20 +6327,20 @@
mRoot.dumpTopFocusedDisplayId(pw);
mRoot.forAllDisplays(dc -> {
final int displayId = dc.getDisplayId();
- final WindowState inputMethodTarget = dc.mInputMethodTarget;
- final WindowState inputMethodInputTarget = dc.mInputMethodInputTarget;
- final InsetsControlTarget inputMethodControlTarget = dc.mInputMethodControlTarget;
- if (inputMethodTarget != null) {
- pw.print(" mInputMethodTarget in display# "); pw.print(displayId);
- pw.print(' '); pw.println(inputMethodTarget);
+ final InsetsControlTarget imeLayeringTarget = dc.getImeTarget(IME_TARGET_LAYERING);
+ final InsetsControlTarget imeInputTarget = dc.getImeTarget(IME_TARGET_INPUT);
+ final InsetsControlTarget imeControlTarget = dc.getImeTarget(IME_TARGET_CONTROL);
+ if (imeLayeringTarget != null) {
+ pw.print(" imeLayeringTarget in display# "); pw.print(displayId);
+ pw.print(' '); pw.println(imeLayeringTarget);
}
- if (inputMethodInputTarget != null) {
- pw.print(" mInputMethodInputTarget in display# "); pw.print(displayId);
- pw.print(' '); pw.println(inputMethodInputTarget);
+ if (imeInputTarget != null) {
+ pw.print(" imeInputTarget in display# "); pw.print(displayId);
+ pw.print(' '); pw.println(imeInputTarget);
}
- if (inputMethodControlTarget != null) {
- pw.print(" inputMethodControlTarget in display# "); pw.print(displayId);
- pw.print(' '); pw.println(inputMethodControlTarget);
+ if (imeControlTarget != null) {
+ pw.print(" imeControlTarget in display# "); pw.print(displayId);
+ pw.print(' '); pw.println(imeControlTarget);
}
});
pw.print(" mInTouchMode="); pw.println(mInTouchMode);
@@ -7629,7 +7635,7 @@
synchronized (mGlobalLock) {
final WindowState imeTarget = mWindowMap.get(imeTargetWindowToken);
if (imeTarget != null) {
- imeTarget.getDisplayContent().setInputMethodInputTarget(imeTarget);
+ imeTarget.getDisplayContent().updateImeInputAndControlTarget(imeTarget);
}
}
}
@@ -7772,10 +7778,10 @@
// requested to be hidden.
dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout();
}
- if (dc != null && dc.mInputMethodControlTarget != null) {
+ if (dc != null && dc.getImeTarget(IME_TARGET_CONTROL) != null) {
ProtoLog.d(WM_DEBUG_IME, "hideIme Control target: %s ",
- dc.mInputMethodControlTarget);
- dc.mInputMethodControlTarget.hideInsets(
+ dc.getImeTarget(IME_TARGET_CONTROL));
+ dc.getImeTarget(IME_TARGET_CONTROL).hideInsets(
WindowInsets.Type.ime(), true /* fromIme */);
}
if (dc != null) {
@@ -7899,7 +7905,7 @@
if (dc == null) {
return null;
}
- final InsetsControlTarget target = dc.mInputMethodControlTarget;
+ final InsetsControlTarget target = dc.getImeTarget(IME_TARGET_CONTROL);
if (target == null) {
return null;
}
@@ -7912,10 +7918,10 @@
public String getImeTargetNameForLogging(int displayId) {
synchronized (mGlobalLock) {
final DisplayContent dc = mRoot.getDisplayContent(displayId);
- if (dc == null) {
+ if (dc == null || dc.getImeTarget(IME_TARGET_LAYERING) == null) {
return null;
}
- return dc.mInputMethodTarget != null ? dc.mInputMethodTarget.getName() : null;
+ return dc.getImeTarget(IME_TARGET_LAYERING).getWindow().getName();
}
}
}
diff --git a/services/core/java/com/android/server/wm/WindowProcessController.java b/services/core/java/com/android/server/wm/WindowProcessController.java
index 8f8fea3..835e803 100644
--- a/services/core/java/com/android/server/wm/WindowProcessController.java
+++ b/services/core/java/com/android/server/wm/WindowProcessController.java
@@ -463,6 +463,10 @@
return mUsingWrapper;
}
+ boolean hasEverLaunchedActivity() {
+ return mLastActivityLaunchTime > 0;
+ }
+
void setLastActivityLaunchTime(long launchTime) {
if (launchTime <= mLastActivityLaunchTime) {
if (launchTime < mLastActivityLaunchTime) {
@@ -815,9 +819,9 @@
if (canUpdate) {
// Make sure the previous top activity in the process no longer be resumed.
if (mPreQTopResumedActivity != null && mPreQTopResumedActivity.isState(RESUMED)) {
- final Task stack = mPreQTopResumedActivity.getRootTask();
- if (stack != null) {
- stack.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
+ final Task task = mPreQTopResumedActivity.getTask();
+ if (task != null) {
+ task.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
activity, "top-resumed-changed");
}
}
@@ -1282,12 +1286,12 @@
hasVisibleActivities = true;
}
- final Task rootTask = r.getRootTask();
- if (rootTask != null) {
+ final Task task = r.getTask();
+ if (task != null) {
// There may be a pausing activity that hasn't shown any window and was requested
// to be hidden. But pausing is also a visible state, it should be regarded as
// visible, so the caller can know the next activity should be resumed.
- hasVisibleActivities |= rootTask.handleAppDied(this);
+ hasVisibleActivities |= task.handleAppDied(this);
}
r.handleAppDied();
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index bc8699e..32b84a8 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -32,6 +32,7 @@
import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
import static android.view.SurfaceControl.Transaction;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
@@ -118,6 +119,8 @@
import static com.android.server.policy.WindowManagerPolicy.TRANSIT_EXIT;
import static com.android.server.policy.WindowManagerPolicy.TRANSIT_PREVIEW_DONE;
import static com.android.server.wm.AnimationSpecProto.MOVE;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.DisplayContent.logsGestureExclusionRestrictions;
import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER;
import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_FREEFORM;
@@ -617,6 +620,8 @@
private final Rect mTmpRect = new Rect();
private final Point mTmpPoint = new Point();
+ private final Transaction mTmpTransaction;
+
/**
* If a window is on a display which has been re-parented to a view in another window,
* use this offset to indicate the correct location.
@@ -861,6 +866,7 @@
int ownerId, int showUserId, boolean ownerCanAddInternalSystemWindow,
PowerManagerWrapper powerManagerWrapper) {
super(service);
+ mTmpTransaction = service.mTransactionFactory.get();
mSession = s;
mClient = c;
mAppOp = appOp;
@@ -1108,9 +1114,10 @@
final int layoutXDiff;
final int layoutYDiff;
final WindowState imeWin = mWmService.mRoot.getCurrentInputMethodWindow();
+ final InsetsControlTarget imeTarget = dc.getImeTarget(IME_TARGET_LAYERING);
final boolean isInputMethodAdjustTarget = windowsAreFloating
- ? dc.mInputMethodTarget != null && task == dc.mInputMethodTarget.getTask()
- : isInputMethodTarget();
+ ? imeTarget != null && task == imeTarget.getWindow().getTask()
+ : isImeLayeringTarget();
final boolean isImeTarget =
imeWin != null && imeWin.isVisibleNow() && isInputMethodAdjustTarget;
if (isFullscreenAndFillsDisplay || layoutInParentFrame()) {
@@ -1447,9 +1454,9 @@
@Override
void onDisplayChanged(DisplayContent dc) {
if (dc != null && mDisplayContent != null && dc != mDisplayContent
- && mDisplayContent.mInputMethodInputTarget == this) {
- dc.setInputMethodInputTarget(mDisplayContent.mInputMethodInputTarget);
- mDisplayContent.mInputMethodInputTarget = null;
+ && getImeInputTarget() == this) {
+ dc.updateImeInputAndControlTarget(getImeInputTarget());
+ mDisplayContent.setImeInputTarget(null);
}
super.onDisplayChanged(dc);
// Window was not laid out for this display yet, so make sure mLayoutSeq does not match.
@@ -2154,14 +2161,14 @@
}
final DisplayContent dc = getDisplayContent();
- if (isInputMethodTarget()) {
- // Make sure to set mInputMethodTarget as null when the removed window is the IME
- // target, in case computeImeTarget may use the outdated target.
- dc.mInputMethodTarget = null;
+ if (isImeLayeringTarget()) {
+ // Make sure to set mImeLayeringTarget as null when the removed window is the
+ // IME target, in case computeImeTarget may use the outdated target.
+ dc.setImeLayeringTarget(null);
dc.computeImeTarget(true /* updateImeTarget */);
}
- if (dc.mInputMethodInputTarget == this) {
- dc.setInputMethodInputTarget(null);
+ if (dc.getImeTarget(IME_TARGET_INPUT) == this) {
+ dc.updateImeInputAndControlTarget(null);
}
final int type = mAttrs.type;
@@ -2176,8 +2183,9 @@
disposeInputChannel();
- mWinAnimator.destroyDeferredSurfaceLocked();
- mWinAnimator.destroySurfaceLocked();
+ mWinAnimator.destroyDeferredSurfaceLocked(mTmpTransaction);
+ mWinAnimator.destroySurfaceLocked(mTmpTransaction);
+ mTmpTransaction.apply();
mSession.windowRemovedLocked();
try {
mClient.asBinder().unlinkToDeath(mDeathRecipient, 0);
@@ -2645,7 +2653,7 @@
clearPolicyVisibilityFlag(LEGACY_POLICY_VISIBILITY);
}
if (!isVisibleByPolicy()) {
- mWinAnimator.hide("checkPolicyVisibilityChange");
+ mWinAnimator.hide(getGlobalTransaction(), "checkPolicyVisibilityChange");
if (isFocused()) {
ProtoLog.i(WM_DEBUG_FOCUS_LIGHT,
"setAnimationLocked: setting mFocusMayChange true");
@@ -3176,10 +3184,10 @@
// detaching any surface control the client added from the client.
for (int i = mChildren.size() - 1; i >= 0; --i) {
final WindowState c = mChildren.get(i);
- c.mWinAnimator.detachChildren();
+ c.mWinAnimator.detachChildren(getGlobalTransaction());
}
- mWinAnimator.detachChildren();
+ mWinAnimator.detachChildren(getGlobalTransaction());
}
try {
@@ -3238,7 +3246,8 @@
}
if (appStopped || mWindowRemovalAllowed) {
- mWinAnimator.destroyPreservedSurfaceLocked();
+ mWinAnimator.destroyPreservedSurfaceLocked(mTmpTransaction);
+ mTmpTransaction.apply();
}
if (mDestroying) {
@@ -3274,7 +3283,8 @@
// various indicators of whether the client has released the surface.
// This is in general unsafe, and most callers should use {@link #destroySurface}
void destroySurfaceUnchecked() {
- mWinAnimator.destroySurfaceLocked();
+ mWinAnimator.destroySurfaceLocked(mTmpTransaction);
+ mTmpTransaction.apply();
// Clear animating flags now, since the surface is now gone. (Note this is true even
// if the surface is saved, to outside world the surface is still NO_SURFACE.)
@@ -4608,7 +4618,7 @@
// directly above it. The exception is if we are in split screen
// in which case we process the IME at the DisplayContent level to
// ensure it is above the docked divider.
- if (isInputMethodTarget() && !inSplitScreenWindowingMode()) {
+ if (isImeLayeringTarget() && !inSplitScreenWindowingMode()) {
if (getDisplayContent().forAllImeWindows(callback, traverseTopToBottom)) {
return true;
}
@@ -4800,7 +4810,7 @@
c.hideWallpaperWindow(wasDeferred, reason);
}
if (!mWinAnimator.mLastHidden || wasDeferred) {
- mWinAnimator.hide(reason);
+ mWinAnimator.hide(getGlobalTransaction(), reason);
getDisplayContent().mWallpaperController.mDeferredHideWallpaper = null;
dispatchWallpaperVisibility(false);
final DisplayContent displayContent = getDisplayContent();
@@ -4942,7 +4952,7 @@
// on the new one. This prevents blinking when we change elevation of freeform and
// pinned windows.
if (!mWinAnimator.tryChangeFormatInPlaceLocked()) {
- mWinAnimator.preserveSurfaceLocked(getPendingTransaction());
+ mWinAnimator.preserveSurfaceLocked(getSyncTransaction());
result |= RELAYOUT_RES_SURFACE_CHANGED
| RELAYOUT_RES_FIRST_TIME;
scheduleAnimation();
@@ -4961,7 +4971,7 @@
// to preserve and destroy windows which are attached to another, they
// will keep their surface and its size may change over time.
if (mHasSurface && !isChildWindow()) {
- mWinAnimator.preserveSurfaceLocked(getPendingTransaction());
+ mWinAnimator.preserveSurfaceLocked(getSyncTransaction());
result |= RELAYOUT_RES_SURFACE_CHANGED |
RELAYOUT_RES_FIRST_TIME;
scheduleAnimation();
@@ -5204,9 +5214,9 @@
@Override
boolean needsZBoost() {
- final WindowState inputMethodTarget = getDisplayContent().mInputMethodTarget;
- if (mIsImWindow && inputMethodTarget != null) {
- final ActivityRecord activity = inputMethodTarget.mActivityRecord;
+ final InsetsControlTarget target = getDisplayContent().getImeTarget(IME_TARGET_LAYERING);
+ if (mIsImWindow && target != null) {
+ final ActivityRecord activity = target.getWindow().mActivityRecord;
if (activity != null) {
return activity.needsZBoost();
}
@@ -5264,7 +5274,7 @@
updateFrameRateSelectionPriorityIfNeeded();
updateGlobalScaleIfNeeded();
- mWinAnimator.prepareSurfaceLocked(SurfaceControl.getGlobalTransaction(), true);
+ mWinAnimator.prepareSurfaceLocked(getSyncTransaction());
super.prepareSurfaces();
}
@@ -5358,14 +5368,14 @@
if (isChildWindow()) {
// If we are a child of the input method target we need this promotion.
- if (getParentWindow().isInputMethodTarget()) {
+ if (getParentWindow().isImeLayeringTarget()) {
return true;
}
} else if (mActivityRecord != null) {
// Likewise if we share a token with the Input method target and are ordered
// above it but not necessarily a child (e.g. a Dialog) then we also need
// this promotion.
- final WindowState imeTarget = getDisplayContent().mInputMethodTarget;
+ final WindowState imeTarget = getImeLayeringTarget();
boolean inTokenWithAndAboveImeTarget = imeTarget != null && imeTarget != this
&& imeTarget.mToken == mToken
&& mAttrs.type != TYPE_APPLICATION_STARTING
@@ -5492,8 +5502,18 @@
return !mTapExcludeRegion.isEmpty();
}
- boolean isInputMethodTarget() {
- return getDisplayContent().mInputMethodTarget == this;
+ boolean isImeLayeringTarget() {
+ return getDisplayContent().getImeTarget(IME_TARGET_LAYERING) == this;
+ }
+
+ WindowState getImeLayeringTarget() {
+ final InsetsControlTarget target = getDisplayContent().getImeTarget(IME_TARGET_LAYERING);
+ return target != null ? target.getWindow() : null;
+ }
+
+ WindowState getImeInputTarget() {
+ final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_INPUT);
+ return target != null ? target.getWindow() : null;
}
long getFrameNumber() {
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 9cc72a2..068d0df 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -57,7 +57,6 @@
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
-import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.Debug;
@@ -130,10 +129,6 @@
float mAlpha = 0;
float mLastAlpha = 0;
- Rect mTmpStackBounds = new Rect();
- private Rect mTmpAnimatingBounds = new Rect();
- private Rect mTmpSourceBounds = new Rect();
-
/**
* This is rectangle of the window's surface that is not covered by
* system decorations.
@@ -154,8 +149,6 @@
* window is first added or shown, cleared when the callback has been made. */
boolean mEnteringAnimation;
- private final SurfaceControl.Transaction mTmpTransaction;
-
/** The pixel format of the underlying SurfaceControl */
int mSurfaceFormat;
@@ -201,12 +194,6 @@
// region.
float mWallpaperScale = 1f;
- /**
- * A flag to determine if the WSA needs to offset its position to compensate for the stack's
- * position update before the WSA surface has resized.
- */
- private boolean mOffsetPositionForStackResize;
-
private final Rect mTmpSize = new Rect();
/**
@@ -220,13 +207,10 @@
private final SurfaceControl.Transaction mPostDrawTransaction =
new SurfaceControl.Transaction();
- private final Point mTmpPos = new Point();
-
WindowStateAnimator(final WindowState win) {
final WindowManagerService service = win.mWmService;
mService = service;
- mTmpTransaction = service.mTransactionFactory.get();
mAnimator = service.mAnimator;
mPolicy = service.mPolicy;
mContext = service.mContext;
@@ -243,7 +227,7 @@
if (DEBUG_ANIM) Slog.v(
TAG, "Animation done in " + this + ": exiting=" + mWin.mAnimatingExit
+ ", reportedVisible="
- + (mWin.mActivityRecord != null ? mWin.mActivityRecord.reportedVisible : false));
+ + (mWin.mActivityRecord != null && mWin.mActivityRecord.reportedVisible));
mWin.checkPolicyVisibilityChange();
final DisplayContent displayContent = mWin.getDisplayContent();
@@ -284,11 +268,6 @@
}
}
- void hide(String reason) {
- hide(mTmpTransaction, reason);
- SurfaceControl.mergeToGlobalTransaction(mTmpTransaction);
- }
-
boolean finishDrawingLocked(SurfaceControl.Transaction postDrawTransaction) {
final boolean startingWindow =
mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
@@ -362,7 +341,7 @@
mSurfaceController.mSurfaceControl,
mPendingDestroySurface.mSurfaceControl).apply();
}
- destroySurfaceLocked();
+ destroySurfaceLocked(t);
mSurfaceDestroyDeferred = true;
return;
}
@@ -375,10 +354,10 @@
}
mDestroyPreservedSurfaceUponRedraw = true;
mSurfaceDestroyDeferred = true;
- destroySurfaceLocked();
+ destroySurfaceLocked(t);
}
- void destroyPreservedSurfaceLocked() {
+ void destroyPreservedSurfaceLocked(SurfaceControl.Transaction t) {
if (!mDestroyPreservedSurfaceUponRedraw) {
return;
}
@@ -397,7 +376,7 @@
mSurfaceController.mSurfaceControl).apply();
}
- destroyDeferredSurfaceLocked();
+ destroyDeferredSurfaceLocked(t);
mDestroyPreservedSurfaceUponRedraw = false;
}
@@ -484,7 +463,6 @@
mSurfaceController.setColorSpaceAgnostic((attrs.privateFlags
& WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC) != 0);
- setOffsetPositionForStackResize(false);
mSurfaceFormat = format;
w.setHasSurface(true);
@@ -529,7 +507,7 @@
return mSurfaceController != null && mSurfaceController.hasSurface();
}
- void destroySurfaceLocked() {
+ void destroySurfaceLocked(SurfaceControl.Transaction t) {
final ActivityRecord activity = mWin.mActivityRecord;
if (activity != null) {
if (mWin == activity.mStartingWindow) {
@@ -557,14 +535,14 @@
if (mPendingDestroySurface != null) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s",
mWin, new RuntimeException().fillInStackTrace());
- mPendingDestroySurface.destroyNotInTransaction();
+ mPendingDestroySurface.destroy(t);
}
mPendingDestroySurface = mSurfaceController;
}
} else {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY: %s. %s",
mWin, new RuntimeException().fillInStackTrace());
- destroySurface();
+ destroySurface(t);
}
// Don't hide wallpaper if we're deferring the surface destroy
// because of a surface change.
@@ -587,12 +565,12 @@
mDrawState = NO_SURFACE;
}
- void destroyDeferredSurfaceLocked() {
+ void destroyDeferredSurfaceLocked(SurfaceControl.Transaction t) {
try {
if (mPendingDestroySurface != null) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s",
mWin, new RuntimeException().fillInStackTrace());
- mPendingDestroySurface.destroyNotInTransaction();
+ mPendingDestroySurface.destroy(t);
// Don't hide wallpaper if we're destroying a deferred surface
// after a surface mode change.
if (!mDestroyPreservedSurfaceUponRedraw) {
@@ -655,93 +633,49 @@
return true;
}
- void setSurfaceBoundariesLocked(SurfaceControl.Transaction t, final boolean recoveringMemory) {
+ void setSurfaceBoundariesLocked(SurfaceControl.Transaction t) {
if (mSurfaceController == null) {
return;
}
final WindowState w = mWin;
- final LayoutParams attrs = mWin.getAttrs();
final Task task = w.getTask();
if (shouldConsumeMainWindowSizeTransaction()) {
- t.deferTransactionUntil(task.getMainWindowSizeChangeTask().getSurfaceControl(),
- mWin.getClientViewRootSurface(), mWin.getFrameNumber());
- t.deferTransactionUntil(mSurfaceController.mSurfaceControl,
- mWin.getClientViewRootSurface(), mWin.getFrameNumber());
- t.merge(task.getMainWindowSizeChangeTransaction());
+ // Use pending transaction here instead of the transaction passed in because we want to
+ // ensure the defer transaction is applied on the main transaction and not on the sync
+ // transaction. This is because the sync transaction could contain the buffer and we'd
+ // defer the transaction that contains the buffer we're deferring on.
+ SurfaceControl.Transaction pendingTransaction = mWin.getPendingTransaction();
+ pendingTransaction.deferTransactionUntil(
+ task.getMainWindowSizeChangeTask().getSurfaceControl(),
+ mWin.getClientViewRootSurface(), mWin.getFrameNumber());
+ pendingTransaction.deferTransactionUntil(mSurfaceController.mSurfaceControl,
+ mWin.getClientViewRootSurface(), mWin.getFrameNumber());
+ pendingTransaction.merge(task.getMainWindowSizeChangeTransaction());
task.setMainWindowSizeChangeTransaction(null);
}
- float surfaceWidth = mSurfaceController.getWidth();
- float surfaceHeight = mSurfaceController.getHeight();
-
- final Rect insets = attrs.surfaceInsets;
-
- // getFrameNumber is only valid in the call-stack of relayoutWindow
- // as this is the only-time we know the client renderer
- // is paused.
- final boolean relayout = !w.mRelayoutCalled || w.mInRelayout;
-
if (!w.mSeamlesslyRotated) {
// Used to offset the WSA when stack position changes before a resize.
int xOffset = mXOffset;
int yOffset = mYOffset;
- if (mOffsetPositionForStackResize) {
- if (relayout) {
- // Once a relayout is called, reset the offset back to 0 and defer
- // setting it until a new frame with the updated size. This ensures that
- // the WS position is reset (so the stack position is shown) at the same
- // time that the buffer size changes.
- setOffsetPositionForStackResize(false);
- t.deferTransactionUntil(mSurfaceController.mSurfaceControl,
- mWin.getClientViewRootSurface(), mWin.getFrameNumber());
- } else {
- final Task stack = mWin.getRootTask();
- mTmpPos.x = 0;
- mTmpPos.y = 0;
- if (stack != null) {
- stack.getRelativePosition(mTmpPos);
- }
- xOffset = -mTmpPos.x;
- yOffset = -mTmpPos.y;
- }
- }
if (!mIsWallpaper) {
- mSurfaceController.setPosition(t, xOffset, yOffset, recoveringMemory);
- } else {
- setWallpaperPositionAndScale(t,
- xOffset, yOffset, mWallpaperScale, recoveringMemory);
- }
- }
-
- if (!w.mSeamlesslyRotated) {
- // Wallpaper is already updated above when calling setWallpaperPositionAndScale so
- // we only need to consider the non-wallpaper case here.
- if (!mIsWallpaper) {
+ mSurfaceController.setPosition(t, xOffset, yOffset);
+ // Wallpaper is already updated above when calling setWallpaperPositionAndScale so
+ // we only need to consider the non-wallpaper case here.
mSurfaceController.setMatrix(t,
- mDsDx * w.mHScale,
- mDtDx * w.mVScale,
- mDtDy * w.mHScale,
- mDsDy * w.mVScale, recoveringMemory);
+ mDsDx * w.mHScale,
+ mDtDx * w.mVScale,
+ mDtDy * w.mHScale,
+ mDsDy * w.mVScale);
+ } else {
+ setWallpaperPositionAndScale(t, xOffset, yOffset, mWallpaperScale);
}
}
}
- /**
- * Get rect of the task this window is currently in. If there is no task, rect will be set to
- * empty.
- */
- void getContainerRect(Rect rect) {
- final Task task = mWin.getTask();
- if (task != null) {
- task.getDimBounds(rect);
- } else {
- rect.left = rect.top = rect.right = rect.bottom = 0;
- }
- }
-
- void prepareSurfaceLocked(SurfaceControl.Transaction t, final boolean recoveringMemory) {
+ void prepareSurfaceLocked(SurfaceControl.Transaction t) {
final WindowState w = mWin;
if (!hasSurface()) {
@@ -758,13 +692,13 @@
computeShownFrameLocked();
- setSurfaceBoundariesLocked(t, recoveringMemory);
+ setSurfaceBoundariesLocked(t);
if (mIsWallpaper && !w.mWallpaperVisible) {
// Wallpaper is no longer visible and there is no wp target => hide it.
- hide("prepareSurfaceLocked");
+ hide(t, "prepareSurfaceLocked");
} else if (w.isParentWindowHidden() || !w.isOnScreen()) {
- hide("prepareSurfaceLocked");
+ hide(t, "prepareSurfaceLocked");
mWallpaperControllerLocked.hideWallpapers(w);
// If we are waiting for this window to handle an orientation change. If this window is
@@ -800,21 +734,20 @@
boolean prepared = true;
if (mIsWallpaper) {
- setWallpaperPositionAndScale(t,
- mXOffset, mYOffset, mWallpaperScale, recoveringMemory);
+ setWallpaperPositionAndScale(t, mXOffset, mYOffset, mWallpaperScale);
} else {
prepared =
- mSurfaceController.prepareToShowInTransaction(mShownAlpha,
+ mSurfaceController.prepareToShowInTransaction(t, mShownAlpha,
mDsDx * w.mHScale,
mDtDx * w.mVScale,
mDtDy * w.mHScale,
- mDsDy * w.mVScale,
- recoveringMemory);
+ mDsDy * w.mVScale
+ );
}
if (prepared && mDrawState == HAS_DRAWN) {
if (mLastHidden) {
- if (showSurfaceRobustlyLocked()) {
+ if (showSurfaceRobustlyLocked(t)) {
markPreservedSurfaceForDestroy();
mAnimator.requestRemovalOfReplacedWindows(w);
mLastHidden = false;
@@ -888,8 +821,7 @@
Slog.i(TAG, ">>> OPEN TRANSACTION setWallpaperOffset");
}
mService.openSurfaceTransaction();
- setWallpaperPositionAndScale(SurfaceControl.getGlobalTransaction(),
- dx, dy, scale, false);
+ setWallpaperPositionAndScale(SurfaceControl.getGlobalTransaction(), dx, dy, scale);
} catch (RuntimeException e) {
Slog.w(TAG, "Error positioning surface of " + mWin
+ " pos=(" + dx + "," + dy + ")", e);
@@ -904,8 +836,8 @@
return true;
}
- private void setWallpaperPositionAndScale(SurfaceControl.Transaction t,
- int dx, int dy, float scale, boolean recoveringMemory) {
+ private void setWallpaperPositionAndScale(SurfaceControl.Transaction t, int dx, int dy,
+ float scale) {
DisplayInfo displayInfo = mWin.getDisplayInfo();
Matrix matrix = mWin.mTmpMatrix;
matrix.setTranslate(dx, dy);
@@ -915,13 +847,12 @@
matrix.reset();
mSurfaceController.setPosition(t,mWin.mTmpMatrixArray[MTRANS_X],
- mWin.mTmpMatrixArray[MTRANS_Y], recoveringMemory);
+ mWin.mTmpMatrixArray[MTRANS_Y]);
mSurfaceController.setMatrix(t,
mDsDx * mWin.mTmpMatrixArray[MSCALE_X] * mWin.mHScale,
mDtDx * mWin.mTmpMatrixArray[MSKEW_Y] * mWin.mVScale,
mDtDy * mWin.mTmpMatrixArray[MSKEW_X] * mWin.mHScale,
- mDsDy * mWin.mTmpMatrixArray[MSCALE_Y] * mWin.mVScale,
- recoveringMemory);
+ mDsDy * mWin.mTmpMatrixArray[MSCALE_Y] * mWin.mVScale);
}
/**
@@ -974,8 +905,8 @@
*
* @return Returns true if the surface was successfully shown.
*/
- private boolean showSurfaceRobustlyLocked() {
- boolean shown = mSurfaceController.showRobustlyInTransaction();
+ private boolean showSurfaceRobustlyLocked(SurfaceControl.Transaction t) {
+ boolean shown = mSurfaceController.showRobustly(t);
if (!shown)
return false;
@@ -993,7 +924,7 @@
}
}
- SurfaceControl.mergeToGlobalTransaction(mPostDrawTransaction);
+ t.merge(mPostDrawTransaction);
return true;
}
@@ -1163,10 +1094,6 @@
return sb.toString();
}
- void reclaimSomeSurfaceMemory(String operation, boolean secure) {
- mService.mRoot.reclaimSomeSurfaceMemory(this, operation, secure);
- }
-
boolean getShown() {
if (mSurfaceController != null) {
return mSurfaceController.getShown();
@@ -1174,10 +1101,10 @@
return false;
}
- void destroySurface() {
+ void destroySurface(SurfaceControl.Transaction t) {
try {
if (mSurfaceController != null) {
- mSurfaceController.destroyNotInTransaction();
+ mSurfaceController.destroy(t);
}
} catch (RuntimeException e) {
Slog.w(TAG, "Exception thrown when destroying surface " + this
@@ -1189,7 +1116,7 @@
}
}
- void detachChildren() {
+ void detachChildren(SurfaceControl.Transaction t) {
// Do not detach children of starting windows, as their lifecycle is well under control and
// it may lead to issues in case we relaunch when we just added the starting window.
@@ -1197,14 +1124,10 @@
return;
}
if (mSurfaceController != null) {
- mSurfaceController.detachChildren();
+ mSurfaceController.detachChildren(t);
}
}
- void setOffsetPositionForStackResize(boolean offsetPositionForStackResize) {
- mOffsetPositionForStackResize = offsetPositionForStackResize;
- }
-
SurfaceControl getSurfaceControl() {
if (!hasSurface()) {
return null;
diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java
index ec79c59..788f004 100644
--- a/services/core/java/com/android/server/wm/WindowSurfaceController.java
+++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java
@@ -20,6 +20,7 @@
import static android.view.SurfaceControl.METADATA_OWNER_PID;
import static android.view.SurfaceControl.METADATA_OWNER_UID;
import static android.view.SurfaceControl.METADATA_WINDOW_TYPE;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static com.android.internal.protolog.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC;
import static com.android.internal.protolog.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
@@ -76,8 +77,6 @@
private final int mWindowType;
private final Session mWindowSession;
- private final SurfaceControl.Transaction mTmpTransaction;
-
// Used to track whether we have called detach children on the way to invisibility.
boolean mChildrenDetached;
@@ -94,7 +93,6 @@
final WindowState win = animator.mWin;
mWindowType = windowType;
mWindowSession = win.mSession;
- mTmpTransaction = mService.mTransactionFactory.get();
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "new SurfaceControl");
final SurfaceControl.Builder b = win.makeSurface()
@@ -120,18 +118,18 @@
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
}
- void detachChildren() {
+ void detachChildren(SurfaceControl.Transaction t) {
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SEVER CHILDREN");
mChildrenDetached = true;
if (mSurfaceControl != null) {
- mSurfaceControl.detachChildren();
+ t.detachChildren(mSurfaceControl);
}
}
void hide(SurfaceControl.Transaction transaction, String reason) {
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE HIDE ( %s ): %s", reason, title);
- mAnimator.destroyPreservedSurfaceLocked();
+ mAnimator.destroyPreservedSurfaceLocked(transaction);
if (mSurfaceShown) {
hideSurface(transaction);
}
@@ -149,12 +147,12 @@
}
}
- void destroyNotInTransaction() {
+ void destroy(SurfaceControl.Transaction t) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- "Destroying surface %s called by %s", this, Debug.getCallers(8));
+ "Destroying surface %s called by %s", this, Debug.getCallers(8));
try {
if (mSurfaceControl != null) {
- mTmpTransaction.remove(mSurfaceControl).apply();
+ t.remove(mSurfaceControl);
}
} catch (RuntimeException e) {
Slog.w(TAG, "Error destroying surface in: " + this, e);
@@ -164,30 +162,22 @@
}
}
- void setPosition(SurfaceControl.Transaction t, float left, float top,
- boolean recoveringMemory) {
+ void setPosition(SurfaceControl.Transaction t, float left, float top) {
final boolean surfaceMoved = mSurfaceX != left || mSurfaceY != top;
- if (surfaceMoved) {
- mSurfaceX = left;
- mSurfaceY = top;
-
- try {
- ProtoLog.i(WM_SHOW_TRANSACTIONS,
- "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s", left, top, title);
-
- t.setPosition(mSurfaceControl, left, top);
- } catch (RuntimeException e) {
- Slog.w(TAG, "Error positioning surface of " + this
- + " pos=(" + left + "," + top + ")", e);
- if (!recoveringMemory) {
- mAnimator.reclaimSomeSurfaceMemory("position", true);
- }
- }
+ if (!surfaceMoved) {
+ return;
}
+
+ mSurfaceX = left;
+ mSurfaceY = top;
+
+ ProtoLog.i(WM_SHOW_TRANSACTIONS,
+ "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s", left, top, title);
+
+ t.setPosition(mSurfaceControl, left, top);
}
- void setMatrix(SurfaceControl.Transaction t, float dsdx, float dtdx,
- float dtdy, float dsdy, boolean recoveringMemory) {
+ void setMatrix(SurfaceControl.Transaction t, float dsdx, float dtdx, float dtdy, float dsdy) {
final boolean matrixChanged = mLastDsdx != dsdx || mLastDtdx != dtdx ||
mLastDtdy != dtdy || mLastDsdy != dsdy;
if (!matrixChanged) {
@@ -199,43 +189,24 @@
mLastDtdy = dtdy;
mLastDsdy = dsdy;
- try {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE MATRIX [%f,%f,%f,%f]: %s",
- dsdx, dtdx, dtdy, dsdy, title);
- t.setMatrix(mSurfaceControl, dsdx, dtdx, dtdy, dsdy);
- } catch (RuntimeException e) {
- // If something goes wrong with the surface (such
- // as running out of memory), don't take down the
- // entire system.
- Slog.e(TAG, "Error setting matrix on surface surface" + title
- + " MATRIX [" + dsdx + "," + dtdx + "," + dtdy + "," + dsdy + "]", null);
- if (!recoveringMemory) {
- mAnimator.reclaimSomeSurfaceMemory("matrix", true);
- }
- }
+ ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE MATRIX [%f,%f,%f,%f]: %s",
+ dsdx, dtdx, dtdy, dsdy, title);
+ t.setMatrix(mSurfaceControl, dsdx, dtdx, dtdy, dsdy);
}
- boolean prepareToShowInTransaction(float alpha,
- float dsdx, float dtdx, float dsdy,
- float dtdy, boolean recoveringMemory) {
- if (mSurfaceControl != null) {
- try {
- mSurfaceAlpha = alpha;
- mSurfaceControl.setAlpha(alpha);
- mLastDsdx = dsdx;
- mLastDtdx = dtdx;
- mLastDsdy = dsdy;
- mLastDtdy = dtdy;
- mSurfaceControl.setMatrix(
- dsdx, dtdx, dsdy, dtdy);
- } catch (RuntimeException e) {
- Slog.w(TAG, "Error updating surface in " + title, e);
- if (!recoveringMemory) {
- mAnimator.reclaimSomeSurfaceMemory("update", true);
- }
- return false;
- }
+ boolean prepareToShowInTransaction(SurfaceControl.Transaction t, float alpha, float dsdx,
+ float dtdx, float dsdy, float dtdy) {
+ if (mSurfaceControl == null) {
+ return false;
}
+
+ mSurfaceAlpha = alpha;
+ t.setAlpha(mSurfaceControl, alpha);
+ mLastDsdx = dsdx;
+ mLastDtdx = dtdx;
+ mLastDsdy = dsdy;
+ mLastDtdy = dtdy;
+ t.setMatrix(mSurfaceControl, dsdx, dtdx, dsdy, dtdy);
return true;
}
@@ -247,7 +218,7 @@
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setTransparentRegion");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setTransparentRegionHint(region);
+ getGlobalTransaction().setTransparentRegionHint(mSurfaceControl, region);
} finally {
mService.closeSurfaceTransaction("setTransparentRegion");
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
@@ -264,7 +235,7 @@
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setOpaqueLocked");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setOpaque(isOpaque);
+ getGlobalTransaction().setOpaque(mSurfaceControl, isOpaque);
} finally {
mService.closeSurfaceTransaction("setOpaqueLocked");
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION setOpaqueLocked");
@@ -282,7 +253,7 @@
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setBackgroundBlurRadius");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setBackgroundBlurRadius(radius);
+ getGlobalTransaction().setBackgroundBlurRadius(mSurfaceControl, radius);
} finally {
mService.closeSurfaceTransaction("setBackgroundBlurRadius");
if (SHOW_LIGHT_TRANSACTIONS) {
@@ -300,7 +271,7 @@
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setSecureLocked");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setSecure(isSecure);
+ getGlobalTransaction().setSecure(mSurfaceControl, isSecure);
} finally {
mService.closeSurfaceTransaction("setSecure");
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION setSecureLocked");
@@ -318,7 +289,7 @@
}
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setColorSpaceAgnostic(agnostic);
+ getGlobalTransaction().setColorSpaceAgnostic(mSurfaceControl, agnostic);
} finally {
mService.closeSurfaceTransaction("setColorSpaceAgnostic");
if (SHOW_LIGHT_TRANSACTIONS) {
@@ -327,7 +298,7 @@
}
}
- boolean showRobustlyInTransaction() {
+ boolean showRobustly(SurfaceControl.Transaction t) {
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SHOW (performLayout): %s", title);
if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + this
+ " during relayout");
@@ -336,21 +307,9 @@
return true;
}
- try {
- setShown(true);
- mSurfaceControl.show();
- return true;
- } catch (RuntimeException e) {
- Slog.w(TAG, "Failure showing surface " + mSurfaceControl + " in " + this, e);
- }
-
- mAnimator.reclaimSomeSurfaceMemory("show", true);
- return false;
- }
-
- void deferTransactionUntil(SurfaceControl barrier, long frame) {
- // TODO: Logging
- mSurfaceControl.deferTransactionUntil(barrier, frame);
+ setShown(true);
+ t.show(mSurfaceControl);
+ return true;
}
boolean clearWindowContentFrameStats() {
@@ -391,14 +350,6 @@
}
}
- int getWidth() {
- return mSurfaceW;
- }
-
- int getHeight() {
- return mSurfaceH;
- }
-
void dumpDebug(ProtoOutputStream proto, long fieldId) {
final long token = proto.start(fieldId);
proto.write(SHOWN, mSurfaceShown);
diff --git a/services/core/jni/OWNERS b/services/core/jni/OWNERS
index 6f74885..7fc5565 100644
--- a/services/core/jni/OWNERS
+++ b/services/core/jni/OWNERS
@@ -12,3 +12,18 @@
per-file com_android_server_HardwarePropertiesManagerService.cpp = michaelwr@google.com, santoscordon@google.com
per-file com_android_server_power_PowerManagerService.* = michaelwr@google.com, santoscordon@google.com
+per-file Android.bp = file:platform/build/soong:/OWNERS
+per-file com_android_server_Usb* = file:/services/usb/OWNERS
+per-file com_android_server_Vibrator* = file:/services/core/java/com/android/server/vibrator/OWNERS
+per-file com_android_server_hdmi_* = file:/core/java/android/hardware/hdmi/OWNERS
+per-file com_android_server_input_* = file:/core/java/android/hardware/input/OWNERS
+per-file com_android_server_lights_* = file:/services/core/java/com/android/server/lights/OWNERS
+per-file com_android_server_location_* = file:/location/java/android/location/OWNERS
+per-file com_android_server_locksettings_* = file:/services/core/java/com/android/server/locksettings/OWNERS
+per-file com_android_server_net_* = file:/services/core/java/com/android/server/net/OWNERS
+per-file com_android_server_pm_* = file:/services/core/java/com/android/server/pm/OWNERS
+per-file com_android_server_power_* = file:/services/core/java/com/android/server/power/OWNERS
+per-file com_android_server_se_* = file:/core/java/android/se/OWNERS
+per-file com_android_server_security_* = file:/core/java/android/security/OWNERS
+per-file com_android_server_tv_* = file:/media/java/android/media/tv/OWNERS
+per-file com_android_server_vibrator_* = file:/services/core/java/com/android/server/vibrator/OWNERS
diff --git a/services/core/jni/com_android_server_VibratorManagerService.cpp b/services/core/jni/com_android_server_VibratorManagerService.cpp
index dae9cef..71de9bd 100644
--- a/services/core/jni/com_android_server_VibratorManagerService.cpp
+++ b/services/core/jni/com_android_server_VibratorManagerService.cpp
@@ -26,8 +26,13 @@
#include <vibratorservice/VibratorManagerHalWrapper.h>
+#include "com_android_server_VibratorManagerService.h"
+
namespace android {
+static std::mutex gManagerMutex;
+static vibrator::ManagerHalWrapper* gManager GUARDED_BY(gManagerMutex) = nullptr;
+
class NativeVibratorManagerService {
public:
NativeVibratorManagerService() : mHal(std::make_unique<vibrator::LegacyManagerHalWrapper>()) {}
@@ -39,9 +44,16 @@
const std::unique_ptr<vibrator::ManagerHalWrapper> mHal;
};
+vibrator::ManagerHalWrapper* android_server_VibratorManagerService_getManager() {
+ std::lock_guard<std::mutex> lock(gManagerMutex);
+ return gManager;
+}
+
static void destroyNativeService(void* ptr) {
NativeVibratorManagerService* service = reinterpret_cast<NativeVibratorManagerService*>(ptr);
if (service) {
+ std::lock_guard<std::mutex> lock(gManagerMutex);
+ gManager = nullptr;
delete service;
}
}
@@ -49,6 +61,10 @@
static jlong nativeInit(JNIEnv* /* env */, jclass /* clazz */) {
std::unique_ptr<NativeVibratorManagerService> service =
std::make_unique<NativeVibratorManagerService>();
+ {
+ std::lock_guard<std::mutex> lock(gManagerMutex);
+ gManager = service->hal();
+ }
return reinterpret_cast<jlong>(service.release());
}
diff --git a/services/core/jni/com_android_server_VibratorManagerService.h b/services/core/jni/com_android_server_VibratorManagerService.h
new file mode 100644
index 0000000..3f2a322
--- /dev/null
+++ b/services/core/jni/com_android_server_VibratorManagerService.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef _ANDROID_SERVER_VIBRATOR_MANAGER_SERVICE_H
+#define _ANDROID_SERVER_VIBRATOR_MANAGER_SERVICE_H
+
+#include <vibratorservice/VibratorManagerHalWrapper.h>
+
+namespace android {
+
+extern vibrator::ManagerHalWrapper* android_server_VibratorManagerService_getManager();
+
+} // namespace android
+
+#endif // _ANDROID_SERVER_VIBRATOR_MANAGER_SERVICE_H
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index 13450be..404b182 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -149,6 +149,14 @@
jmethodID getAffineTransform;
} gTouchCalibrationClassInfo;
+static struct {
+ jclass clazz;
+ jmethodID constructor;
+ jmethodID keyAt;
+ jmethodID valueAt;
+ jmethodID size;
+} gSparseArrayClassInfo;
+
// --- Global functions ---
template<typename T>
@@ -1705,19 +1713,73 @@
patternObj, nullptr));
jint* amplitudes = static_cast<jint*>(env->GetPrimitiveArrayCritical(amplitudesObj, nullptr));
- std::vector<VibrationElement> elements(patternSize);
+ VibrationSequence sequence(patternSize);
+ std::vector<int32_t> vibrators = im->getInputManager()->getReader()->getVibratorIds(deviceId);
for (size_t i = 0; i < patternSize; i++) {
// VibrationEffect.validate guarantees duration > 0.
std::chrono::milliseconds duration(patternMillis[i]);
- elements[i].duration = std::min(duration, MAX_VIBRATE_PATTERN_DELAY_MILLIS);
- // TODO: (b/161629089) apply channel specific amplitudes from development API.
- elements[i].channels = {static_cast<uint8_t>(amplitudes[i]),
- static_cast<uint8_t>(amplitudes[i])};
+ VibrationElement element(CHANNEL_SIZE);
+ element.duration = std::min(duration, MAX_VIBRATE_PATTERN_DELAY_MILLIS);
+ // Vibrate on both channels
+ for (int32_t channel = 0; channel < vibrators.size(); channel++) {
+ element.addChannel(vibrators[channel], static_cast<uint8_t>(amplitudes[i]));
+ }
+ sequence.addElement(element);
}
env->ReleasePrimitiveArrayCritical(patternObj, patternMillis, JNI_ABORT);
env->ReleasePrimitiveArrayCritical(amplitudesObj, amplitudes, JNI_ABORT);
- im->getInputManager()->getReader()->vibrate(deviceId, elements, repeat, token);
+ im->getInputManager()->getReader()->vibrate(deviceId, sequence, repeat, token);
+}
+
+static void nativeVibrateCombined(JNIEnv* env, jclass /* clazz */, jlong ptr, jint deviceId,
+ jlongArray patternObj, jobject amplitudesObj, jint repeat,
+ jint token) {
+ NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
+
+ size_t patternSize = env->GetArrayLength(patternObj);
+
+ if (patternSize > MAX_VIBRATE_PATTERN_SIZE) {
+ ALOGI("Skipped requested vibration because the pattern size is %zu "
+ "which is more than the maximum supported size of %d.",
+ patternSize, MAX_VIBRATE_PATTERN_SIZE);
+ return; // limit to reasonable size
+ }
+ const jlong* patternMillis = env->GetLongArrayElements(patternObj, nullptr);
+
+ std::array<jint*, CHANNEL_SIZE> amplitudesArray;
+ std::array<jint, CHANNEL_SIZE> vibratorIdArray;
+ jint amplSize = env->CallIntMethod(amplitudesObj, gSparseArrayClassInfo.size);
+ if (amplSize > CHANNEL_SIZE) {
+ ALOGE("Can not fit into input device vibration element.");
+ return;
+ }
+
+ for (int i = 0; i < amplSize; i++) {
+ vibratorIdArray[i] = env->CallIntMethod(amplitudesObj, gSparseArrayClassInfo.keyAt, i);
+ jintArray arr = static_cast<jintArray>(
+ env->CallObjectMethod(amplitudesObj, gSparseArrayClassInfo.valueAt, i));
+ amplitudesArray[i] = env->GetIntArrayElements(arr, nullptr);
+ if (env->GetArrayLength(arr) != patternSize) {
+ ALOGE("Amplitude length not equal to pattern length!");
+ return;
+ }
+ }
+
+ VibrationSequence sequence(patternSize);
+ for (size_t i = 0; i < patternSize; i++) {
+ VibrationElement element(CHANNEL_SIZE);
+ // VibrationEffect.validate guarantees duration > 0.
+ std::chrono::milliseconds duration(patternMillis[i]);
+ element.duration = std::min(duration, MAX_VIBRATE_PATTERN_DELAY_MILLIS);
+ for (int32_t channel = 0; channel < CHANNEL_SIZE; channel++) {
+ element.addChannel(vibratorIdArray[channel],
+ static_cast<uint8_t>(amplitudesArray[channel][i]));
+ }
+ sequence.addElement(element);
+ }
+
+ im->getInputManager()->getReader()->vibrate(deviceId, sequence, repeat, token);
}
static void nativeCancelVibrate(JNIEnv* /* env */,
@@ -1727,6 +1789,23 @@
im->getInputManager()->getReader()->cancelVibrate(deviceId, token);
}
+static bool nativeIsVibrating(JNIEnv* /* env */, jclass /* clazz */, jlong ptr, jint deviceId) {
+ NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
+
+ return im->getInputManager()->getReader()->isVibrating(deviceId);
+}
+
+static jintArray nativeGetVibratorIds(JNIEnv* env, jclass clazz, jlong ptr, jint deviceId) {
+ NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
+ std::vector<int32_t> vibrators = im->getInputManager()->getReader()->getVibratorIds(deviceId);
+
+ jintArray vibIdArray = env->NewIntArray(vibrators.size());
+ if (vibIdArray != nullptr) {
+ env->SetIntArrayRegion(vibIdArray, 0, vibrators.size(), vibrators.data());
+ }
+ return vibIdArray;
+}
+
static void nativeReloadKeyboardLayouts(JNIEnv* /* env */,
jclass /* clazz */, jlong ptr) {
NativeInputManager* im = reinterpret_cast<NativeInputManager*>(ptr);
@@ -1872,7 +1951,11 @@
{"nativeSetInteractive", "(JZ)V", (void*)nativeSetInteractive},
{"nativeReloadCalibration", "(J)V", (void*)nativeReloadCalibration},
{"nativeVibrate", "(JI[J[III)V", (void*)nativeVibrate},
+ {"nativeVibrateCombined", "(JI[JLandroid/util/SparseArray;II)V",
+ (void*)nativeVibrateCombined},
{"nativeCancelVibrate", "(JII)V", (void*)nativeCancelVibrate},
+ {"nativeIsVibrating", "(JI)Z", (void*)nativeIsVibrating},
+ {"nativeGetVibratorIds", "(JI)[I", (void*)nativeGetVibratorIds},
{"nativeReloadKeyboardLayouts", "(J)V", (void*)nativeReloadKeyboardLayouts},
{"nativeReloadDeviceAliases", "(J)V", (void*)nativeReloadDeviceAliases},
{"nativeDump", "(J)Ljava/lang/String;", (void*)nativeDump},
@@ -2048,6 +2131,15 @@
GET_METHOD_ID(gTouchCalibrationClassInfo.getAffineTransform, gTouchCalibrationClassInfo.clazz,
"getAffineTransform", "()[F");
+ // SparseArray
+ FIND_CLASS(gSparseArrayClassInfo.clazz, "android/util/SparseArray");
+ gSparseArrayClassInfo.clazz = jclass(env->NewGlobalRef(gSparseArrayClassInfo.clazz));
+ GET_METHOD_ID(gSparseArrayClassInfo.constructor, gSparseArrayClassInfo.clazz, "<init>", "()V");
+ GET_METHOD_ID(gSparseArrayClassInfo.keyAt, gSparseArrayClassInfo.clazz, "keyAt", "(I)I");
+ GET_METHOD_ID(gSparseArrayClassInfo.valueAt, gSparseArrayClassInfo.clazz, "valueAt",
+ "(I)Ljava/lang/Object;");
+ GET_METHOD_ID(gSparseArrayClassInfo.size, gSparseArrayClassInfo.clazz, "size", "()I");
+
return 0;
}
diff --git a/services/core/jni/com_android_server_vibrator_VibratorController.cpp b/services/core/jni/com_android_server_vibrator_VibratorController.cpp
index afce537..7ed3748 100644
--- a/services/core/jni/com_android_server_vibrator_VibratorController.cpp
+++ b/services/core/jni/com_android_server_vibrator_VibratorController.cpp
@@ -29,6 +29,8 @@
#include <vibratorservice/VibratorHalController.h>
+#include "com_android_server_VibratorManagerService.h"
+
namespace V1_0 = android::hardware::vibrator::V1_0;
namespace V1_1 = android::hardware::vibrator::V1_1;
namespace V1_2 = android::hardware::vibrator::V1_2;
@@ -70,13 +72,26 @@
static_assert(static_cast<uint8_t>(V1_3::Effect::TEXTURE_TICK) ==
static_cast<uint8_t>(aidl::Effect::TEXTURE_TICK));
+static std::shared_ptr<vibrator::HalController> findVibrator(int32_t vibratorId) {
+ // TODO(b/167946816): remove this once VibratorService is removed.
+ if (vibratorId < 0) {
+ return std::move(std::make_unique<vibrator::HalController>());
+ }
+ vibrator::ManagerHalWrapper* manager = android_server_VibratorManagerService_getManager();
+ if (manager == nullptr) {
+ return nullptr;
+ }
+ auto result = manager->getVibrator(vibratorId);
+ return result.isOk() ? std::move(result.value()) : nullptr;
+}
+
class VibratorControllerWrapper {
public:
VibratorControllerWrapper(JNIEnv* env, int32_t vibratorId, jobject callbackListener)
- // TODO(b/167946816): use ManagerHalController to get vibrator by id
- : mHal(std::make_unique<vibrator::HalController>()),
+ : mHal(std::move(findVibrator(vibratorId))),
mVibratorId(vibratorId),
mCallbackListener(env->NewGlobalRef(callbackListener)) {
+ LOG_ALWAYS_FATAL_IF(mHal == nullptr, "Unable to find reference to vibrator hal");
LOG_ALWAYS_FATAL_IF(mCallbackListener == nullptr,
"Unable to create global reference to vibration callback handler");
}
@@ -97,7 +112,7 @@
}
private:
- const std::unique_ptr<vibrator::HalController> mHal;
+ const std::shared_ptr<vibrator::HalController> mHal;
const int32_t mVibratorId;
const jobject mCallbackListener;
};
diff --git a/services/core/jni/gnss/OWNERS b/services/core/jni/gnss/OWNERS
new file mode 100644
index 0000000..5ac6028
--- /dev/null
+++ b/services/core/jni/gnss/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/location/OWNERS
diff --git a/services/core/xsd/platform-compat-schema/OWNERS b/services/core/xsd/platform-compat-schema/OWNERS
new file mode 100644
index 0000000..f8c3520
--- /dev/null
+++ b/services/core/xsd/platform-compat-schema/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/compat/OWNERS
diff --git a/services/devicepolicy/OWNERS b/services/devicepolicy/OWNERS
new file mode 100644
index 0000000..e95633a
--- /dev/null
+++ b/services/devicepolicy/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/app/admin/OWNERS
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java b/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java
index ce61d50..6f1d451e 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/BaseIDevicePolicyManager.java
@@ -44,19 +44,19 @@
/**
* To be called by {@link DevicePolicyManagerService#Lifecycle} when a new user starts.
*
- * @see {@link SystemService#onStartUser}
+ * @see {@link SystemService#onUserStarting}
*/
abstract void handleStartUser(int userId);
/**
* To be called by {@link DevicePolicyManagerService#Lifecycle} when a user is being unlocked.
*
- * @see {@link SystemService#onUnlockUser}
+ * @see {@link SystemService#onUserUnlocking}
*/
abstract void handleUnlockUser(int userId);
/**
* To be called by {@link DevicePolicyManagerService#Lifecycle} when a user is being stopped.
*
- * @see {@link SystemService#onStopUser}
+ * @see {@link SystemService#onUserStopping}
*/
abstract void handleStopUser(int userId);
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index edcf9e8..d35d806 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -2328,7 +2328,8 @@
+ admin.info.getTagForPolicy(reqPolicy));
} else {
throw new SecurityException("No active admin owned by uid "
- + callingUid + " for policy #" + reqPolicy);
+ + callingUid + " for policy #" + reqPolicy + (permission == null ? ""
+ : ", which doesn't have " + permission));
}
}
@@ -2388,6 +2389,7 @@
* If not provided, iterate over all of the active admins in the DevicePolicyData for that user
* and return the one with the uid specified as parameter, and has the policy specified.
*/
+ @Nullable
private ActiveAdmin getActiveAdminWithPolicyForUidLocked(ComponentName who, int reqPolicy,
int uid) {
ensureLocked();
@@ -3366,7 +3368,7 @@
final boolean qualityMayApplyToParent =
canSetPasswordQualityOnParent(who.getPackageName(), caller.getUserId());
if (!qualityMayApplyToParent) {
- Preconditions.checkArgument(!parent,
+ Preconditions.checkCallAuthorization(!parent,
"Profile Owner may not apply password quality requirements device-wide");
}
@@ -5190,6 +5192,44 @@
return false;
}
+ @Override
+ public List<String> getKeyPairGrants(String callerPackage, String alias) {
+ final CallerIdentity caller = getCallerIdentity(callerPackage);
+ Preconditions.checkCallAuthorization(canManageCertificates(caller));
+
+ return mInjector.binderWithCleanCallingIdentity(() -> {
+ try (KeyChainConnection keyChainConnection =
+ KeyChain.bindAsUser(mContext, caller.getUserHandle())) {
+ final List<String> result = new ArrayList<>();
+ final int[] granteeUids = keyChainConnection.getService().getGrants(alias);
+ final PackageManager pm = mInjector.getPackageManager(caller.getUserId());
+
+ // TODO: Return Set<Set<String>> when AIDL supports it: b/136048684
+ // Public API returns a set of sets, where each internal set contains all package
+ // names corresponding to the same UID. For now a set of sets is marshalled as a
+ // null-separated list.
+ for (final int uid : granteeUids) {
+ final String[] packages = pm.getPackagesForUid(uid);
+ if (packages == null) {
+ Slog.wtf(LOG_TAG, "No packages found for uid " + uid);
+ continue;
+ }
+ if (!result.isEmpty()) {
+ result.add(null);
+ }
+ result.addAll(Arrays.asList(packages));
+ }
+ return result;
+ } catch (RemoteException e) {
+ Log.e(LOG_TAG, "Querying keypair grants", e);
+ } catch (InterruptedException e) {
+ Log.w(LOG_TAG, "Interrupted while querying keypair grants", e);
+ Thread.currentThread().interrupt();
+ }
+ return Collections.emptyList();
+ });
+ }
+
/**
* Enforce one the following conditions are met:
* (1) The device has a Device Owner, and one of the following holds:
@@ -6096,10 +6136,14 @@
final ActiveAdmin admin;
synchronized (getLockObject()) {
- admin = getActiveAdminForCallerLocked(null, DeviceAdminInfo.USES_POLICY_WIPE_DATA);
+ admin = getActiveAdminWithPolicyForUidLocked(/* who= */ null,
+ DeviceAdminInfo.USES_POLICY_WIPE_DATA, caller.getUid());
}
- Preconditions.checkCallAuthorization(admin != null,
- "No active admin for user %d", caller.getUserId());
+
+ Preconditions.checkCallAuthorization(
+ (admin != null) || hasCallingOrSelfPermission(permission.MASTER_CLEAR),
+ "No active admin for user %d and caller %d does not hold MASTER_CLEAR permission",
+ caller.getUserId(), caller.getUid());
if (TextUtils.isEmpty(wipeReasonForUser)) {
if (calledByProfileOwnerOnOrgOwnedDevice && !calledOnParentInstance) {
@@ -6110,7 +6154,10 @@
}
}
- int userId = admin.getUserHandle().getIdentifier();
+ int userId = admin != null ? admin.getUserHandle().getIdentifier()
+ : caller.getUserId();
+ Slog.i(LOG_TAG, String.format("wipeDataWithReason(%s): admin=%s, user=%d",
+ wipeReasonForUser, admin, userId));
if (calledByProfileOwnerOnOrgOwnedDevice) {
// When wipeData is called on the parent instance, it implies wiping the entire device.
if (calledOnParentInstance) {
@@ -6133,20 +6180,35 @@
});
}
}
-
- DevicePolicyEventLogger
+ DevicePolicyEventLogger event = DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.WIPE_DATA_WITH_REASON)
- .setAdmin(admin.info.getComponent())
.setInt(flags)
.setStrings(calledOnParentInstance ? CALLED_FROM_PARENT : NOT_CALLED_FROM_PARENT)
- .write();
+ ;
+ final String adminName;
+ final ComponentName adminComp;
+ if (admin != null) {
+ adminComp = admin.info.getComponent();
+ adminName = adminComp.flattenToShortString();
+ event.setAdmin(adminComp);
+ } else {
+ adminComp = null;
+ adminName = mInjector.getPackageManager().getPackagesForUid(caller.getUid())[0];
+ Slog.i(LOG_TAG, "Logging wipeData() event admin as " + adminName);
+ event.setAdmin(adminName);
+ if (mInjector.userManagerIsHeadlessSystemUserMode()) {
+ // On headless system user mode, the call is meant to factory reset the whole
+ // device, otherwise the caller could simply remove the current user.
+ userId = UserHandle.USER_SYSTEM;
+ }
+ }
+ event.write();
+
String internalReason = String.format(
"DevicePolicyManager.wipeDataWithReason() from %s, organization-owned? %s",
- admin.info.getComponent().flattenToShortString(),
- calledByProfileOwnerOnOrgOwnedDevice);
+ adminName, calledByProfileOwnerOnOrgOwnedDevice);
- wipeDataNoLock(
- admin.info.getComponent(), flags, internalReason, wipeReasonForUser, userId);
+ wipeDataNoLock(adminComp, flags, internalReason, wipeReasonForUser, userId);
}
private void wipeDataNoLock(ComponentName admin, int flags, String internalReason,
@@ -12502,7 +12564,7 @@
Objects.requireNonNull(admin, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(admin);
Preconditions.checkCallAuthorization(isDeviceOwner(caller));
-
+ checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_REBOOT);
mInjector.binderWithCleanCallingIdentity(() -> {
// Make sure there are no ongoing calls on the device.
if (mTelephonyManager.getCallState() != TelephonyManager.CALL_STATE_IDLE) {
@@ -13416,14 +13478,16 @@
final CallerIdentity caller = getCallerIdentity(admin);
Preconditions.checkCallAuthorization(isDeviceOwner(caller) || isProfileOwner(caller));
- synchronized (getLockObject()) {
- try {
- IBackupManager ibm = mInjector.getIBackupManager();
- return ibm != null && ibm.isBackupServiceActive(caller.getUserId());
- } catch (RemoteException e) {
- throw new IllegalStateException("Failed requesting backup service state.", e);
+ return mInjector.binderWithCleanCallingIdentity(() -> {
+ synchronized (getLockObject()) {
+ try {
+ IBackupManager ibm = mInjector.getIBackupManager();
+ return ibm != null && ibm.isBackupServiceActive(caller.getUserId());
+ } catch (RemoteException e) {
+ throw new IllegalStateException("Failed requesting backup service state.", e);
+ }
}
- }
+ });
}
@Override
diff --git a/services/incremental/OWNERS b/services/incremental/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/incremental/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 6525e11..242cee8 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -1252,6 +1252,10 @@
mSystemServiceManager.startService(DropBoxManagerService.class);
t.traceEnd();
+ t.traceBegin("StartVibratorManagerService");
+ mSystemServiceManager.startService(VibratorManagerService.Lifecycle.class);
+ t.traceEnd();
+
t.traceBegin("StartVibratorService");
vibrator = new VibratorService(context);
ServiceManager.addService("vibrator", vibrator);
@@ -1277,6 +1281,10 @@
inputManager = new InputManagerService(context);
t.traceEnd();
+ t.traceBegin("DeviceStateManagerService");
+ mSystemServiceManager.startService(DeviceStateManagerService.class);
+ t.traceEnd();
+
if (!disableCameraService) {
t.traceBegin("StartCameraServiceProxy");
mSystemServiceManager.startService(CameraServiceProxy.class);
@@ -1370,10 +1378,6 @@
mSystemServiceManager.startService(AppIntegrityManagerService.class);
t.traceEnd();
- t.traceBegin("DeviceStateManagerService");
- mSystemServiceManager.startService(DeviceStateManagerService.class);
- t.traceEnd();
-
} catch (Throwable e) {
Slog.e("System", "******************************************");
Slog.e("System", "************ Failure starting core service");
diff --git a/services/people/OWNERS b/services/people/OWNERS
new file mode 100644
index 0000000..7ac9b73
--- /dev/null
+++ b/services/people/OWNERS
@@ -0,0 +1,2 @@
+danningc@google.com
+juliacr@google.com
diff --git a/services/print/OWNERS b/services/print/OWNERS
new file mode 100644
index 0000000..2c7b881
--- /dev/null
+++ b/services/print/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/print/OWNERS
diff --git a/services/restrictions/OWNERS b/services/restrictions/OWNERS
new file mode 100644
index 0000000..95e614c
--- /dev/null
+++ b/services/restrictions/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/restrictions/OWNERS
diff --git a/services/robotests/backup/OWNERS b/services/robotests/backup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/services/robotests/backup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/services/robotests/src/com/android/server/backup/OWNERS b/services/robotests/src/com/android/server/backup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/services/robotests/src/com/android/server/backup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/services/robotests/src/com/android/server/location/OWNERS b/services/robotests/src/com/android/server/location/OWNERS
new file mode 100644
index 0000000..696a0c2
--- /dev/null
+++ b/services/robotests/src/com/android/server/location/OWNERS
@@ -0,0 +1 @@
+file:/location/java/android/location/OWNERS
diff --git a/services/robotests/src/com/android/server/pm/OWNERS b/services/robotests/src/com/android/server/pm/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/robotests/src/com/android/server/pm/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/startop/OWNERS b/services/startop/OWNERS
new file mode 100644
index 0000000..bd3d829
--- /dev/null
+++ b/services/startop/OWNERS
@@ -0,0 +1 @@
+include /startop/OWNERS
diff --git a/services/tests/PackageManager/OWNERS b/services/tests/PackageManager/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/tests/PackageManager/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/tests/PackageManagerComponentOverrideTests/OWNERS b/services/tests/PackageManagerComponentOverrideTests/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/tests/PackageManagerComponentOverrideTests/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/tests/mockingservicestests/assets/AppOpsUpgradeTest/OWNERS b/services/tests/mockingservicestests/assets/AppOpsUpgradeTest/OWNERS
new file mode 100644
index 0000000..999ea0e
--- /dev/null
+++ b/services/tests/mockingservicestests/assets/AppOpsUpgradeTest/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/permission/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/OWNERS b/services/tests/mockingservicestests/src/com/android/server/OWNERS
new file mode 100644
index 0000000..e779e21
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/OWNERS
@@ -0,0 +1 @@
+per-file *Alarm* = file:/apex/jobscheduler/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS b/services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS
new file mode 100644
index 0000000..6f207fb1
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS
@@ -0,0 +1 @@
+include /apex/jobscheduler/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/OWNERS b/services/tests/mockingservicestests/src/com/android/server/am/OWNERS
new file mode 100644
index 0000000..72c0a9e
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/am/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/am/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/appop/OWNERS b/services/tests/mockingservicestests/src/com/android/server/appop/OWNERS
new file mode 100644
index 0000000..999ea0e
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/appop/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/permission/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/blob/OWNERS b/services/tests/mockingservicestests/src/com/android/server/blob/OWNERS
new file mode 100644
index 0000000..65bb6b8
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/blob/OWNERS
@@ -0,0 +1 @@
+include /apex/blobstore/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java b/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
index dbdee979..af4130d 100644
--- a/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
@@ -19,11 +19,14 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.anyFloat;
+import static org.mockito.Mockito.never;
import android.content.Context;
import android.content.res.Resources;
@@ -40,7 +43,9 @@
import com.android.dx.mockito.inline.extended.StaticMockitoSession;
import com.android.server.LocalServices;
+import com.android.server.display.LocalDisplayAdapter.BacklightAdapter;
import com.android.server.lights.LightsManager;
+import com.android.server.lights.LogicalLight;
import com.google.common.truth.Truth;
@@ -78,6 +83,8 @@
private Resources mMockedResources;
@Mock
private LightsManager mMockedLightsManager;
+ @Mock
+ private LogicalLight mMockedBacklight;
private Handler mHandler;
@@ -492,6 +499,49 @@
waitForHandlerToComplete(mHandler, HANDLER_WAIT_MS);
}
+ @Test
+ public void testBacklightAdapter_withSurfaceControlSupport() {
+ final Binder displayToken = new Binder();
+ doReturn(true).when(() -> SurfaceControl.getDisplayBrightnessSupport(displayToken));
+
+ // Test as default display
+ BacklightAdapter ba = new BacklightAdapter(displayToken, true /*isDefault*/);
+ ba.setBrightness(0.514f);
+ verify(() -> SurfaceControl.setDisplayBrightness(displayToken, 0.514f));
+
+ // Test as not default display
+ BacklightAdapter ba2 = new BacklightAdapter(displayToken,
+ false /*isDefault*/);
+ ba2.setBrightness(0.323f);
+ verify(() -> SurfaceControl.setDisplayBrightness(displayToken, 0.323f));
+ }
+
+ @Test
+ public void testBacklightAdapter_withoutSourceControlSupport_defaultDisplay() {
+ final Binder displayToken = new Binder();
+ doReturn(false).when(() -> SurfaceControl.getDisplayBrightnessSupport(displayToken));
+ doReturn(mMockedBacklight).when(mMockedLightsManager)
+ .getLight(LightsManager.LIGHT_ID_BACKLIGHT);
+
+ BacklightAdapter ba = new BacklightAdapter(displayToken, true /*isDefault*/);
+ ba.setBrightness(0.123f);
+ verify(mMockedBacklight).setBrightness(0.123f);
+ }
+
+ @Test
+ public void testBacklightAdapter_withoutSourceControlSupport_nonDefaultDisplay() {
+ final Binder displayToken = new Binder();
+ doReturn(false).when(() -> SurfaceControl.getDisplayBrightnessSupport(displayToken));
+ doReturn(mMockedBacklight).when(mMockedLightsManager)
+ .getLight(LightsManager.LIGHT_ID_BACKLIGHT);
+
+ BacklightAdapter ba = new BacklightAdapter(displayToken, false /*isDefault*/);
+ ba.setBrightness(0.456f);
+
+ // Adapter does not forward any brightness in this case.
+ verify(mMockedBacklight, never()).setBrightness(anyFloat());
+ }
+
private void assertDisplayDpi(DisplayDeviceInfo info, int expectedPort,
float expectedXdpi,
float expectedYDpi,
diff --git a/services/tests/mockingservicestests/src/com/android/server/display/OWNERS b/services/tests/mockingservicestests/src/com/android/server/display/OWNERS
new file mode 100644
index 0000000..6ce1ee4
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/display/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/display/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/job/OWNERS b/services/tests/mockingservicestests/src/com/android/server/job/OWNERS
new file mode 100644
index 0000000..6f207fb1
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/job/OWNERS
@@ -0,0 +1 @@
+include /apex/jobscheduler/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/power/OWNERS b/services/tests/mockingservicestests/src/com/android/server/power/OWNERS
new file mode 100644
index 0000000..d68066b
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/power/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/power/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/usage/OWNERS b/services/tests/mockingservicestests/src/com/android/server/usage/OWNERS
new file mode 100644
index 0000000..d3227de
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/usage/OWNERS
@@ -0,0 +1 @@
+include /services/usage/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/wallpaper/OWNERS b/services/tests/mockingservicestests/src/com/android/server/wallpaper/OWNERS
new file mode 100644
index 0000000..8ff0f74
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/wallpaper/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/wallpaper/OWNERS
diff --git a/services/tests/servicestests/apks/OWNERS b/services/tests/servicestests/apks/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/tests/servicestests/apks/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/tests/servicestests/assets/NetworkPolicy/OWNERS b/services/tests/servicestests/assets/NetworkPolicy/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/services/tests/servicestests/assets/NetworkPolicy/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/OWNERS b/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/services/tests/servicestests/assets/NetworkPolicyManagerServiceTest/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java b/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
index a02c533..6814c050a 100644
--- a/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
@@ -163,16 +163,26 @@
}
@Test
- public void testIsEmergencyGestureEnabled_settingDisabled() {
+ public void testIsEmergencyGestureSettingEnabled_settingDisabled() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(false);
- assertFalse(mGestureLauncherService.isEmergencyGestureEnabled(
+ assertFalse(mGestureLauncherService.isEmergencyGestureSettingEnabled(
mContext, FAKE_USER_ID));
}
@Test
- public void testIsEmergencyGestureEnabled_settingEnabled() {
+ public void testIsEmergencyGestureSettingEnabled_settingEnabled() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
- assertTrue(mGestureLauncherService.isEmergencyGestureEnabled(
+ assertTrue(mGestureLauncherService.isEmergencyGestureSettingEnabled(
+ mContext, FAKE_USER_ID));
+ }
+
+ @Test
+ public void testIsEmergencyGestureSettingEnabled_supportDisabled() {
+ withEmergencyGestureEnabledConfigValue(false);
+ withEmergencyGestureEnabledSettingValue(true);
+ assertFalse(mGestureLauncherService.isEmergencyGestureSettingEnabled(
mContext, FAKE_USER_ID));
}
@@ -438,6 +448,7 @@
testInterceptPowerKeyDown_fiveInboundPresses_cameraAndEmergencyEnabled_bothLaunch() {
withCameraDoubleTapPowerEnableConfigValue(true);
withCameraDoubleTapPowerDisableSettingValue(0);
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
mGestureLauncherService.updateCameraDoubleTapPowerEnabled();
mGestureLauncherService.updateEmergencyGestureEnabled();
@@ -527,6 +538,7 @@
@Test
public void
testInterceptPowerKeyDown_fiveInboundPresses_emergencyGestureEnabled_launchesFlow() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
mGestureLauncherService.updateEmergencyGestureEnabled();
withUserSetupCompleteValue(true);
@@ -580,6 +592,7 @@
@Test
public void
testInterceptPowerKeyDown_tenInboundPresses_emergencyGestureEnabled_keyIntercepted() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
mGestureLauncherService.updateEmergencyGestureEnabled();
withUserSetupCompleteValue(true);
@@ -1146,6 +1159,12 @@
.thenReturn(enableConfigValue);
}
+ private void withEmergencyGestureEnabledConfigValue(boolean enableConfigValue) {
+ when(mResources.getBoolean(
+ com.android.internal.R.bool.config_emergencyGestureEnabled))
+ .thenReturn(enableConfigValue);
+ }
+
private void withCameraDoubleTapPowerDisableSettingValue(int disableSettingValue) {
Settings.Secure.putIntForUser(
mContentResolver,
diff --git a/services/tests/servicestests/src/com/android/server/OWNERS b/services/tests/servicestests/src/com/android/server/OWNERS
new file mode 100644
index 0000000..6561778
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/OWNERS
@@ -0,0 +1,7 @@
+per-file *Alarm* = file:/apex/jobscheduler/OWNERS
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
+per-file *Bluetooth* = file:/core/java/android/bluetooth/OWNERS
+per-file *Gnss* = file:/services/core/java/com/android/server/location/OWNERS
+per-file *Network* = file:/services/core/java/com/android/server/net/OWNERS
+per-file *Vibrator* = file:/services/core/java/com/android/server/vibrator/OWNERS
+per-file GestureLauncherServiceTest.java = file:platform/packages/apps/EmergencyInfo:/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/VibratorManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/VibratorManagerServiceTest.java
index 044bdba..726536d 100644
--- a/services/tests/servicestests/src/com/android/server/VibratorManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/VibratorManagerServiceTest.java
@@ -19,17 +19,38 @@
import static com.android.server.testutils.TestUtils.assertExpectException;
import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.hardware.vibrator.IVibrator;
import android.os.CombinedVibrationEffect;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.PowerManager;
+import android.os.PowerManagerInternal;
+import android.os.PowerSaveState;
import android.os.Process;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
+import android.os.Vibrator;
+import android.os.VibratorInfo;
+import android.os.test.TestLooper;
import android.platform.test.annotations.Presubmit;
import androidx.test.InstrumentationRegistry;
+import com.android.server.vibrator.VibratorController;
+
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -37,6 +58,9 @@
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Tests for {@link VibratorManagerService}.
*
@@ -51,24 +75,54 @@
private static final VibrationAttributes ALARM_ATTRS =
new VibrationAttributes.Builder().setUsage(VibrationAttributes.USAGE_ALARM).build();
- @Rule
- public MockitoRule rule = MockitoJUnit.rule();
+ @Rule public MockitoRule rule = MockitoJUnit.rule();
- @Mock
- private VibratorManagerService.NativeWrapper mNativeWrapperMock;
+ @Mock private VibratorManagerService.NativeWrapper mNativeWrapperMock;
+ @Mock private PowerManagerInternal mPowerManagerInternalMock;
+ @Mock private PowerSaveState mPowerSaveStateMock;
+
+ private final Map<Integer, VibratorController.NativeWrapper> mNativeWrappers = new HashMap<>();
+
+ private TestLooper mTestLooper;
@Before
public void setUp() throws Exception {
+ mTestLooper = new TestLooper();
+
+ when(mPowerManagerInternalMock.getLowPowerState(PowerManager.ServiceType.VIBRATION))
+ .thenReturn(mPowerSaveStateMock);
+
+ addLocalServiceMock(PowerManagerInternal.class, mPowerManagerInternalMock);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ LocalServices.removeServiceForTest(PowerManagerInternal.class);
}
private VibratorManagerService createService() {
- return new VibratorManagerService(InstrumentationRegistry.getContext(),
+ VibratorManagerService service = new VibratorManagerService(
+ InstrumentationRegistry.getContext(),
new VibratorManagerService.Injector() {
@Override
VibratorManagerService.NativeWrapper getNativeWrapper() {
return mNativeWrapperMock;
}
+
+ @Override
+ Handler createHandler(Looper looper) {
+ return new Handler(mTestLooper.getLooper());
+ }
+
+ @Override
+ VibratorController createVibratorController(int vibratorId,
+ VibratorController.OnVibrationCompleteListener listener) {
+ return new VibratorController(
+ vibratorId, listener, mNativeWrappers.get(vibratorId));
+ }
});
+ service.systemReady();
+ return service;
}
@Test
@@ -85,8 +139,156 @@
@Test
public void getVibratorIds_withNonEmptyResultFromNative_returnsSameArray() {
- when(mNativeWrapperMock.getVibratorIds()).thenReturn(new int[]{1, 2});
- assertArrayEquals(new int[]{1, 2}, createService().getVibratorIds());
+ mNativeWrappers.put(1, mockVibrator(/* capabilities= */ 0));
+ mNativeWrappers.put(2, mockVibrator(/* capabilities= */ 0));
+ when(mNativeWrapperMock.getVibratorIds()).thenReturn(new int[]{2, 1});
+ assertArrayEquals(new int[]{2, 1}, createService().getVibratorIds());
+ }
+
+ @Test
+ public void getVibratorInfo_withMissingVibratorId_returnsNull() {
+ mockVibrators(mockVibrator(/* capabilities= */ 0));
+ assertNull(createService().getVibratorInfo(2));
+ }
+
+ @Test
+ public void getVibratorInfo_withExistingVibratorId_returnsHalInfoForVibrator() {
+ VibratorController.NativeWrapper vibratorMock = mockVibrator(
+ IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_AMPLITUDE_CONTROL);
+ when(vibratorMock.getSupportedEffects()).thenReturn(
+ new int[]{VibrationEffect.EFFECT_CLICK});
+ when(vibratorMock.getSupportedPrimitives()).thenReturn(
+ new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK});
+ mNativeWrappers.put(1, vibratorMock);
+ when(mNativeWrapperMock.getVibratorIds()).thenReturn(new int[]{1});
+ VibratorInfo info = createService().getVibratorInfo(1);
+
+ assertNotNull(info);
+ assertEquals(1, info.getId());
+ assertTrue(info.hasAmplitudeControl());
+ assertTrue(info.hasCapability(IVibrator.CAP_COMPOSE_EFFECTS));
+ assertFalse(info.hasCapability(IVibrator.CAP_ON_CALLBACK));
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_YES,
+ info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_NO,
+ info.isEffectSupported(VibrationEffect.EFFECT_TICK));
+ assertTrue(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ assertFalse(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_TICK));
+ }
+
+ @Test
+ public void setAlwaysOnEffect_withMono_enablesAlwaysOnEffectToAllVibratorsWithCapability() {
+ VibratorController.NativeWrapper[] vibratorMocks = new VibratorController.NativeWrapper[]{
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL),
+ mockVibrator(/* capabilities= */ 0),
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL),
+ };
+ mockVibrators(vibratorMocks);
+
+ CombinedVibrationEffect effect = CombinedVibrationEffect.createSynced(
+ VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK));
+ assertTrue(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1, effect, ALARM_ATTRS));
+
+ // Only vibrators 0 and 2 have always-on capabilities.
+ verify(vibratorMocks[0]).alwaysOnEnable(
+ eq(1L), eq((long) VibrationEffect.EFFECT_CLICK),
+ eq((long) VibrationEffect.EFFECT_STRENGTH_STRONG));
+ verify(vibratorMocks[1], never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
+ verify(vibratorMocks[2]).alwaysOnEnable(
+ eq(1L), eq((long) VibrationEffect.EFFECT_CLICK),
+ eq((long) VibrationEffect.EFFECT_STRENGTH_STRONG));
+ }
+
+ @Test
+ public void setAlwaysOnEffect_withStereo_enablesAlwaysOnEffectToAllVibratorsWithCapability() {
+ VibratorController.NativeWrapper[] vibratorMocks = new VibratorController.NativeWrapper[] {
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL),
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL),
+ mockVibrator(0),
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL),
+ };
+ mockVibrators(vibratorMocks);
+
+ CombinedVibrationEffect effect = CombinedVibrationEffect.startSynced()
+ .addVibrator(0, VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
+ .addVibrator(1, VibrationEffect.createPredefined(VibrationEffect.EFFECT_TICK))
+ .addVibrator(2, VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
+ .combine();
+ assertTrue(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1, effect, ALARM_ATTRS));
+
+ // Enables click on vibrator 0 and tick on vibrator 1 only.
+ verify(vibratorMocks[0]).alwaysOnEnable(
+ eq(1L), eq((long) VibrationEffect.EFFECT_CLICK),
+ eq((long) VibrationEffect.EFFECT_STRENGTH_STRONG));
+ verify(vibratorMocks[1]).alwaysOnEnable(
+ eq(1L), eq((long) VibrationEffect.EFFECT_TICK),
+ eq((long) VibrationEffect.EFFECT_STRENGTH_STRONG));
+ verify(vibratorMocks[2], never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
+ verify(vibratorMocks[3], never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
+ }
+
+ @Test
+ public void setAlwaysOnEffect_withNullEffect_disablesAlwaysOnEffects() {
+ VibratorController.NativeWrapper[] vibratorMocks = new VibratorController.NativeWrapper[] {
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL),
+ mockVibrator(0),
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL),
+ };
+ mockVibrators(vibratorMocks);
+
+ assertTrue(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1, null, ALARM_ATTRS));
+
+ // Disables only 0 and 2 that have capability.
+ verify(vibratorMocks[0]).alwaysOnDisable(eq(1L));
+ verify(vibratorMocks[1], never()).alwaysOnDisable(anyLong());
+ verify(vibratorMocks[2]).alwaysOnDisable(eq(1L));
+ }
+
+ @Test
+ public void setAlwaysOnEffect_withNonPrebakedEffect_ignoresEffect() {
+ VibratorController.NativeWrapper vibratorMock =
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL);
+ mockVibrators(vibratorMock);
+
+ CombinedVibrationEffect effect = CombinedVibrationEffect.createSynced(
+ VibrationEffect.createOneShot(100, VibrationEffect.DEFAULT_AMPLITUDE));
+ assertFalse(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1, effect, ALARM_ATTRS));
+
+ verify(vibratorMock, never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
+ verify(vibratorMock, never()).alwaysOnDisable(anyLong());
+ }
+
+ @Test
+ public void setAlwaysOnEffect_withNonSyncedEffect_ignoresEffect() {
+ VibratorController.NativeWrapper vibratorMock =
+ mockVibrator(IVibrator.CAP_ALWAYS_ON_CONTROL);
+ mockVibrators(vibratorMock);
+
+ CombinedVibrationEffect effect = CombinedVibrationEffect.startSequential()
+ .addNext(0, VibrationEffect.get(VibrationEffect.EFFECT_CLICK))
+ .combine();
+ assertFalse(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1, effect, ALARM_ATTRS));
+
+ verify(vibratorMock, never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
+ verify(vibratorMock, never()).alwaysOnDisable(anyLong());
+ }
+
+ @Test
+ public void setAlwaysOnEffect_withNoVibratorWithCapability_ignoresEffect() {
+ VibratorController.NativeWrapper vibratorMock = mockVibrator(0);
+ mockVibrators(vibratorMock);
+ VibratorManagerService service = createService();
+
+ CombinedVibrationEffect mono = CombinedVibrationEffect.createSynced(
+ VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK));
+ CombinedVibrationEffect stereo = CombinedVibrationEffect.startSynced()
+ .addVibrator(0, VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
+ .combine();
+ assertFalse(service.setAlwaysOnEffect(UID, PACKAGE_NAME, 1, mono, ALARM_ATTRS));
+ assertFalse(service.setAlwaysOnEffect(UID, PACKAGE_NAME, 2, stereo, ALARM_ATTRS));
+
+ verify(vibratorMock, never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
+ verify(vibratorMock, never()).alwaysOnDisable(anyLong());
}
@Test
@@ -107,4 +309,24 @@
assertExpectException(UnsupportedOperationException.class,
"Not implemented", () -> service.cancelVibrate(service));
}
+
+ private VibratorController.NativeWrapper mockVibrator(int capabilities) {
+ VibratorController.NativeWrapper wrapper = mock(VibratorController.NativeWrapper.class);
+ when(wrapper.getCapabilities()).thenReturn((long) capabilities);
+ return wrapper;
+ }
+
+ private void mockVibrators(VibratorController.NativeWrapper... wrappers) {
+ int[] ids = new int[wrappers.length];
+ for (int i = 0; i < wrappers.length; i++) {
+ ids[i] = i;
+ mNativeWrappers.put(i, wrappers[i]);
+ }
+ when(mNativeWrapperMock.getVibratorIds()).thenReturn(ids);
+ }
+
+ private static <T> void addLocalServiceMock(Class<T> clazz, T mock) {
+ LocalServices.removeServiceForTest(clazz);
+ LocalServices.addService(clazz, mock);
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/VibratorServiceTest.java b/services/tests/servicestests/src/com/android/server/VibratorServiceTest.java
index 64f3135..68adacd 100644
--- a/services/tests/servicestests/src/com/android/server/VibratorServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/VibratorServiceTest.java
@@ -16,7 +16,6 @@
package com.android.server;
-import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -52,7 +51,6 @@
import android.os.IBinder;
import android.os.IVibratorStateListener;
import android.os.Looper;
-import android.os.PowerManager;
import android.os.PowerManagerInternal;
import android.os.PowerSaveState;
import android.os.Process;
@@ -62,6 +60,7 @@
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
import android.os.Vibrator;
+import android.os.VibratorInfo;
import android.os.test.TestLooper;
import android.platform.test.annotations.Presubmit;
import android.provider.Settings;
@@ -101,6 +100,9 @@
private static final int UID = Process.ROOT_UID;
private static final String PACKAGE_NAME = "package";
+ private static final PowerSaveState NORMAL_POWER_STATE = new PowerSaveState.Builder().build();
+ private static final PowerSaveState LOW_POWER_STATE = new PowerSaveState.Builder()
+ .setBatterySaverEnabled(true).build();
private static final VibrationAttributes ALARM_ATTRS =
new VibrationAttributes.Builder().setUsage(VibrationAttributes.USAGE_ALARM).build();
private static final VibrationAttributes HAPTIC_FEEDBACK_ATTRS =
@@ -118,7 +120,6 @@
@Mock private PackageManagerInternal mPackageManagerInternalMock;
@Mock private PowerManagerInternal mPowerManagerInternalMock;
- @Mock private PowerSaveState mPowerSaveStateMock;
// TODO(b/131311651): replace with a FakeVibrator instead.
@Mock private Vibrator mVibratorMock;
@Mock private AppOpsManager mAppOpsManagerMock;
@@ -129,6 +130,7 @@
private TestLooper mTestLooper;
private ContextWrapper mContextSpy;
+ private PowerManagerInternal.LowPowerModeListener mRegisteredPowerModeListener;
@Before
public void setUp() throws Exception {
@@ -150,8 +152,10 @@
when(mVibratorStateListenerMock.asBinder()).thenReturn(mVibratorStateListenerBinderMock);
when(mPackageManagerInternalMock.getSystemUiServiceComponent())
.thenReturn(new ComponentName("", ""));
- when(mPowerManagerInternalMock.getLowPowerState(PowerManager.ServiceType.VIBRATION))
- .thenReturn(mPowerSaveStateMock);
+ doAnswer(invocation -> {
+ mRegisteredPowerModeListener = invocation.getArgument(0);
+ return null;
+ }).when(mPowerManagerInternalMock).registerLowPowerModeObserver(any());
when(mIInputManagerMock.getInputDeviceIds()).thenReturn(new int[0]);
setUserSetting(Settings.System.VIBRATE_WHEN_RINGING, 1);
@@ -199,7 +203,7 @@
public void createService_initializesNativeService() {
createService();
verify(mNativeWrapperMock).init(eq(0), notNull());
- verify(mNativeWrapperMock).off();
+ verify(mNativeWrapperMock, times(2)).off(); // Called from constructor and onSystemReady
}
@Test
@@ -235,93 +239,21 @@
}
@Test
- public void areEffectsSupported_withNullResultFromNative_returnsSupportUnknown() {
- when(mNativeWrapperMock.getSupportedEffects()).thenReturn(null);
- assertArrayEquals(new int[]{Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN},
- createService().areEffectsSupported(new int[]{VibrationEffect.EFFECT_CLICK}));
- }
-
- @Test
- public void areEffectsSupported_withSomeEffectsSupported_returnsSupportYesAndNoForEffects() {
- int[] effects = new int[]{VibrationEffect.EFFECT_CLICK, VibrationEffect.EFFECT_TICK};
-
+ public void getVibratorInfo_returnsSameInfoFromNative() {
+ mockVibratorCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_AMPLITUDE_CONTROL);
when(mNativeWrapperMock.getSupportedEffects())
.thenReturn(new int[]{VibrationEffect.EFFECT_CLICK});
- assertArrayEquals(
- new int[]{Vibrator.VIBRATION_EFFECT_SUPPORT_YES,
- Vibrator.VIBRATION_EFFECT_SUPPORT_NO},
- createService().areEffectsSupported(effects));
- }
-
- @Test
- public void arePrimitivesSupported_withoutComposeCapability_returnsAlwaysFalse() {
- assertArrayEquals(new boolean[]{false, false},
- createService().arePrimitivesSupported(new int[]{
- VibrationEffect.Composition.PRIMITIVE_CLICK,
- VibrationEffect.Composition.PRIMITIVE_TICK
- }));
- }
-
- @Test
- public void arePrimitivesSupported_withNullResultFromNative_returnsAlwaysFalse() {
- mockVibratorCapabilities(IVibrator.CAP_COMPOSE_EFFECTS);
- when(mNativeWrapperMock.getSupportedPrimitives()).thenReturn(null);
-
- assertArrayEquals(new boolean[]{false, false},
- createService().arePrimitivesSupported(new int[]{
- VibrationEffect.Composition.PRIMITIVE_CLICK,
- VibrationEffect.Composition.PRIMITIVE_QUICK_RISE
- }));
- }
-
- @Test
- public void arePrimitivesSupported_withSomeSupportedPrimitives_returnsBasedOnNativeResult() {
- mockVibratorCapabilities(IVibrator.CAP_COMPOSE_EFFECTS);
when(mNativeWrapperMock.getSupportedPrimitives())
.thenReturn(new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK});
- assertArrayEquals(new boolean[]{true, false},
- createService().arePrimitivesSupported(new int[]{
- VibrationEffect.Composition.PRIMITIVE_CLICK,
- VibrationEffect.Composition.PRIMITIVE_QUICK_RISE
- }));
- }
-
- @Test
- public void setAlwaysOnEffect_withCapabilityAndValidEffect_enablesAlwaysOnEffect() {
- mockVibratorCapabilities(IVibrator.CAP_ALWAYS_ON_CONTROL);
-
- assertTrue(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1,
- VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK), ALARM_ATTRS));
- verify(mNativeWrapperMock).alwaysOnEnable(
- eq(1L), eq((long) VibrationEffect.EFFECT_CLICK),
- eq((long) VibrationEffect.EFFECT_STRENGTH_STRONG));
- }
-
- @Test
- public void setAlwaysOnEffect_withNonPrebakedEffect_ignoresEffect() {
- mockVibratorCapabilities(IVibrator.CAP_ALWAYS_ON_CONTROL);
-
- assertFalse(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1,
- VibrationEffect.createOneShot(100, 255), ALARM_ATTRS));
- verify(mNativeWrapperMock, never()).alwaysOnDisable(anyLong());
- verify(mNativeWrapperMock, never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
- }
-
- @Test
- public void setAlwaysOnEffect_withNullEffect_disablesAlwaysOnEffect() {
- mockVibratorCapabilities(IVibrator.CAP_ALWAYS_ON_CONTROL);
-
- assertTrue(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1, null, ALARM_ATTRS));
- verify(mNativeWrapperMock).alwaysOnDisable(eq(1L));
- }
-
- @Test
- public void setAlwaysOnEffect_withoutCapability_ignoresEffect() {
- assertFalse(createService().setAlwaysOnEffect(UID, PACKAGE_NAME, 1,
- VibrationEffect.get(VibrationEffect.EFFECT_CLICK), ALARM_ATTRS));
- verify(mNativeWrapperMock, never()).alwaysOnDisable(anyLong());
- verify(mNativeWrapperMock, never()).alwaysOnEnable(anyLong(), anyLong(), anyLong());
+ VibratorInfo info = createService().getVibratorInfo();
+ assertTrue(info.hasAmplitudeControl());
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_YES,
+ info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_NO,
+ info.isEffectSupported(VibrationEffect.EFFECT_TICK));
+ assertTrue(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ assertFalse(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_TICK));
}
@Test
@@ -346,6 +278,24 @@
}
@Test
+ public void vibrate_withPowerModeChange_usesLowPowerModeState() {
+ VibratorService service = createService();
+ mRegisteredPowerModeListener.onLowPowerModeChanged(LOW_POWER_STATE);
+ vibrate(service, VibrationEffect.createOneShot(1, 1), HAPTIC_FEEDBACK_ATTRS);
+ vibrate(service, VibrationEffect.createOneShot(2, 2), RINGTONE_ATTRS);
+
+ mRegisteredPowerModeListener.onLowPowerModeChanged(NORMAL_POWER_STATE);
+ vibrate(service, VibrationEffect.createOneShot(3, 3), /* attributes= */ null);
+ vibrate(service, VibrationEffect.createOneShot(4, 4), NOTIFICATION_ATTRS);
+
+ InOrder inOrderVerifier = inOrder(mNativeWrapperMock);
+ inOrderVerifier.verify(mNativeWrapperMock, never()).on(eq(1L), anyLong());
+ inOrderVerifier.verify(mNativeWrapperMock).on(eq(2L), anyLong());
+ inOrderVerifier.verify(mNativeWrapperMock).on(eq(3L), anyLong());
+ inOrderVerifier.verify(mNativeWrapperMock).on(eq(4L), anyLong());
+ }
+
+ @Test
public void vibrate_withAudioAttributes_usesOriginalAudioUsageInAppOpsManager() {
VibratorService service = createService();
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/OWNERS b/services/tests/servicestests/src/com/android/server/accessibility/OWNERS
new file mode 100644
index 0000000..b74281e
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/accessibility/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/accessibility/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/accounts/OWNERS b/services/tests/servicestests/src/com/android/server/accounts/OWNERS
new file mode 100644
index 0000000..df1b4f4
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/accounts/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/accounts/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/adb/OWNERS b/services/tests/servicestests/src/com/android/server/adb/OWNERS
new file mode 100644
index 0000000..b97f795
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/adb/OWNERS
@@ -0,0 +1 @@
+include platform/packages/modules/adb:/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/am/OWNERS b/services/tests/servicestests/src/com/android/server/am/OWNERS
new file mode 100644
index 0000000..72c0a9e
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/am/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/am/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java b/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java
index 1e602f8..41e1563 100644
--- a/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java
+++ b/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java
@@ -66,11 +66,11 @@
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpNoted(eq(AppOpsManager.OP_FINE_LOCATION),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpNoted(eq(AppOpsManager.OP_CAMERA),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
// Stop watching
appOpsManager.stopWatchingNoted(listener);
@@ -94,7 +94,7 @@
verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(2)).onOpNoted(eq(AppOpsManager.OP_FINE_LOCATION),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
// Finish up
appOpsManager.stopWatchingNoted(listener);
diff --git a/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java b/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java
index 1aa697b..fec8aa9 100644
--- a/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java
+++ b/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java
@@ -63,11 +63,11 @@
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpStarted(eq(AppOpsManager.OP_FINE_LOCATION),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpStarted(eq(AppOpsManager.OP_CAMERA),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
// Stop watching
appOpsManager.stopWatchingStarted(listener);
@@ -91,7 +91,7 @@
verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(2)).onOpStarted(eq(AppOpsManager.OP_CAMERA),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
verifyNoMoreInteractions(listener);
// Finish up
diff --git a/services/tests/servicestests/src/com/android/server/appop/OWNERS b/services/tests/servicestests/src/com/android/server/appop/OWNERS
new file mode 100644
index 0000000..999ea0e
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/appop/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/permission/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/appsearch/OWNERS b/services/tests/servicestests/src/com/android/server/appsearch/OWNERS
new file mode 100644
index 0000000..ebe9e4e
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/appsearch/OWNERS
@@ -0,0 +1 @@
+include /apex/appsearch/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/attention/OWNERS b/services/tests/servicestests/src/com/android/server/attention/OWNERS
new file mode 100644
index 0000000..51fc9bd
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/attention/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/attention/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/backup/OWNERS b/services/tests/servicestests/src/com/android/server/backup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/backup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/compat/OWNERS b/services/tests/servicestests/src/com/android/server/compat/OWNERS
new file mode 100644
index 0000000..f8c3520
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/compat/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/compat/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
index e2c5e97..d9daf17 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -5127,7 +5127,7 @@
admin1.getPackageName(), managedProfileUserId);
try {
- assertExpectException(IllegalArgumentException.class, null, () ->
+ assertExpectException(SecurityException.class, null, () ->
parentDpm.setPasswordQuality(
admin1, DevicePolicyManager.PASSWORD_QUALITY_COMPLEX));
} finally {
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/OWNERS b/services/tests/servicestests/src/com/android/server/devicepolicy/OWNERS
new file mode 100644
index 0000000..e95633a
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/app/admin/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/devicestate/OWNERS b/services/tests/servicestests/src/com/android/server/devicestate/OWNERS
new file mode 100644
index 0000000..d9b0e2e
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/devicestate/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/devicestate/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/display/OWNERS b/services/tests/servicestests/src/com/android/server/display/OWNERS
new file mode 100644
index 0000000..6ce1ee4
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/display/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/display/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
index 2f49fb7..ef77f32 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
@@ -25,6 +25,8 @@
import static com.android.server.hdmi.Constants.MESSAGE_DEVICE_VENDOR_ID;
import static com.android.server.hdmi.Constants.MESSAGE_REPORT_PHYSICAL_ADDRESS;
+import static com.google.common.truth.Truth.assertThat;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
@@ -110,6 +112,7 @@
private HdmiCecMessageValidator mMessageValidator;
private static byte[] param;
private boolean mStandbyMessageReceived;
+ private boolean mWakeupMessageReceived;
private boolean isControlEnabled;
private int mPowerStatus;
@@ -129,9 +132,21 @@
}
@Override
+ boolean isPowerStandbyOrTransient() {
+ return mPowerStatus == HdmiControlManager.POWER_STATUS_STANDBY
+ || mPowerStatus
+ == HdmiControlManager.POWER_STATUS_TRANSIENT_TO_STANDBY;
+ }
+
+ @Override
void standby() {
mStandbyMessageReceived = true;
}
+
+ @Override
+ void wakeUp() {
+ mWakeupMessageReceived = true;
+ }
};
mHdmiControlService.setIoLooper(mTestLooper.getLooper());
mHdmiCecController = HdmiCecController.createWithNativeWrapper(
@@ -264,4 +279,109 @@
assertFalse(result);
}
+
+ @Test
+ public void handleCecVersion_isHandled() {
+ boolean result = mHdmiLocalDevice.onMessage(
+ HdmiCecMessageBuilder.buildCecVersion(ADDR_PLAYBACK_1, mHdmiLocalDevice.mAddress,
+ HdmiControlManager.HDMI_CEC_VERSION_1_4_b));
+
+ assertThat(result).isTrue();
+ }
+
+ @Test
+ public void handleUserControlPressed_power_localDeviceInStandby_shouldTurnOn() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isTrue();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_power_localDeviceOn_shouldNotChangePowerStatus() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerToggleFunction_localDeviceInStandby_shouldTurnOn() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_TOGGLE_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isTrue();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerToggleFunction_localDeviceOn_shouldTurnOff() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_TOGGLE_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isTrue();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOnFunction_localDeviceInStandby_shouldTurnOn() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_ON_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isTrue();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOnFunction_localDeviceOn_noPowerStatusChange() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_ON_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOffFunction_localDeviceStandby_noPowerStatusChange() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_OFF_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOffFunction_localDeviceOn_shouldTurnOff() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_OFF_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isTrue();
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecNetworkTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecNetworkTest.java
index 080b52b..e370018 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecNetworkTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecNetworkTest.java
@@ -36,6 +36,7 @@
import org.junit.runners.JUnit4;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -313,6 +314,7 @@
int powerStatus = HdmiControlManager.POWER_STATUS_ON;
String osdName = "Test Device";
int vendorId = 1234;
+ int cecVersion = HdmiControlManager.HDMI_CEC_VERSION_2_0;
mHdmiCecNetwork.handleCecMessage(
HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(logicalAddress,
@@ -325,6 +327,8 @@
Constants.ADDR_BROADCAST, osdName));
mHdmiCecNetwork.handleCecMessage(
HdmiCecMessageBuilder.buildDeviceVendorIdCommand(logicalAddress, vendorId));
+ mHdmiCecNetwork.handleCecMessage(HdmiCecMessageBuilder.buildCecVersion(logicalAddress,
+ Constants.ADDR_BROADCAST, cecVersion));
assertThat(mHdmiCecNetwork.getSafeCecDevicesLocked()).hasSize(1);
@@ -335,6 +339,7 @@
assertThat(cecDeviceInfo.getDisplayName()).isEqualTo(osdName);
assertThat(cecDeviceInfo.getVendorId()).isEqualTo(vendorId);
assertThat(cecDeviceInfo.getDevicePowerStatus()).isEqualTo(powerStatus);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(cecVersion);
}
@Test
@@ -374,16 +379,18 @@
mHdmiCecNetwork.handleCecMessage(
HdmiCecMessageBuilder.buildReportPowerStatus(logicalAddress,
- Constants.ADDR_BROADCAST, powerStatus));
+ Constants.ADDR_TV, powerStatus));
mHdmiCecNetwork.handleCecMessage(
HdmiCecMessageBuilder.buildReportPowerStatus(logicalAddress,
- Constants.ADDR_BROADCAST, updatedPowerStatus));
+ Constants.ADDR_TV, updatedPowerStatus));
assertThat(mHdmiCecNetwork.getSafeCecDevicesLocked()).hasSize(1);
HdmiDeviceInfo cecDeviceInfo = mHdmiCecNetwork.getCecDeviceInfo(logicalAddress);
assertThat(cecDeviceInfo.getLogicalAddress()).isEqualTo(logicalAddress);
assertThat(cecDeviceInfo.getDevicePowerStatus()).isEqualTo(updatedPowerStatus);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(
+ HdmiControlManager.HDMI_CEC_VERSION_1_4_b);
}
@Test
@@ -428,6 +435,8 @@
assertThat(cecDeviceInfo.getVendorId()).isEqualTo(updatedVendorId);
assertThat(cecDeviceInfo.getDevicePowerStatus()).isEqualTo(
HdmiControlManager.POWER_STATUS_UNKNOWN);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(
+ HdmiControlManager.HDMI_CEC_VERSION_1_4_b);
}
@Test
@@ -446,4 +455,91 @@
HdmiControlManager.DEVICE_EVENT_ADD_DEVICE,
HdmiControlManager.DEVICE_EVENT_REMOVE_DEVICE);
}
+
+ @Test
+ public void cecDevices_tracking_reportPowerStatus_broadcast_infersCec2() {
+ int logicalAddress = Constants.ADDR_PLAYBACK_1;
+ int powerStatus = HdmiControlManager.POWER_STATUS_ON;
+ mHdmiCecNetwork.handleCecMessage(
+ HdmiCecMessageBuilder.buildReportPowerStatus(logicalAddress,
+ Constants.ADDR_BROADCAST, powerStatus));
+
+ assertThat(mHdmiCecNetwork.getSafeCecDevicesLocked()).hasSize(1);
+
+ HdmiDeviceInfo cecDeviceInfo = mHdmiCecNetwork.getCecDeviceInfo(logicalAddress);
+ assertThat(cecDeviceInfo.getLogicalAddress()).isEqualTo(logicalAddress);
+ assertThat(cecDeviceInfo.getPhysicalAddress()).isEqualTo(
+ Constants.INVALID_PHYSICAL_ADDRESS);
+ assertThat(cecDeviceInfo.getDeviceType()).isEqualTo(HdmiDeviceInfo.DEVICE_RESERVED);
+ assertThat(cecDeviceInfo.getVendorId()).isEqualTo(Constants.UNKNOWN_VENDOR_ID);
+ assertThat(cecDeviceInfo.getDisplayName()).isEqualTo(
+ HdmiUtils.getDefaultDeviceName(logicalAddress));
+ assertThat(cecDeviceInfo.getDevicePowerStatus()).isEqualTo(powerStatus);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(
+ HdmiControlManager.HDMI_CEC_VERSION_2_0);
+ }
+
+ @Test
+ public void cecDevices_tracking_reportCecVersion_tracksCecVersion_cec14() {
+ int logicalAddress = Constants.ADDR_PLAYBACK_1;
+ int cecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_b;
+ mHdmiCecNetwork.handleCecMessage(
+ HdmiCecMessageBuilder.buildCecVersion(logicalAddress, Constants.ADDR_BROADCAST,
+ cecVersion));
+
+ assertThat(mHdmiCecNetwork.getSafeCecDevicesLocked()).hasSize(1);
+
+ HdmiDeviceInfo cecDeviceInfo = mHdmiCecNetwork.getCecDeviceInfo(logicalAddress);
+ assertThat(cecDeviceInfo.getLogicalAddress()).isEqualTo(logicalAddress);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(cecVersion);
+ }
+
+ @Test
+ public void cecDevices_tracking_reportCecVersion_tracksCecVersion_cec20() {
+ int logicalAddress = Constants.ADDR_PLAYBACK_1;
+ int cecVersion = HdmiControlManager.HDMI_CEC_VERSION_2_0;
+ mHdmiCecNetwork.handleCecMessage(
+ HdmiCecMessageBuilder.buildCecVersion(logicalAddress, Constants.ADDR_BROADCAST,
+ cecVersion));
+
+ assertThat(mHdmiCecNetwork.getSafeCecDevicesLocked()).hasSize(1);
+
+ HdmiDeviceInfo cecDeviceInfo = mHdmiCecNetwork.getCecDeviceInfo(logicalAddress);
+ assertThat(cecDeviceInfo.getLogicalAddress()).isEqualTo(logicalAddress);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(cecVersion);
+ }
+
+ @Test
+ public void cecDevices_tracking_reportFeatures_tracksCecVersion_cec14() {
+ int logicalAddress = Constants.ADDR_PLAYBACK_1;
+ int cecVersion = HdmiControlManager.HDMI_CEC_VERSION_1_4_b;
+ mHdmiCecNetwork.handleCecMessage(
+ HdmiCecMessageBuilder.buildReportFeatures(logicalAddress,
+ cecVersion, Collections.emptyList(),
+ Constants.RC_PROFILE_SOURCE, Collections.emptyList(),
+ Collections.emptyList()));
+
+ assertThat(mHdmiCecNetwork.getSafeCecDevicesLocked()).hasSize(1);
+
+ HdmiDeviceInfo cecDeviceInfo = mHdmiCecNetwork.getCecDeviceInfo(logicalAddress);
+ assertThat(cecDeviceInfo.getLogicalAddress()).isEqualTo(logicalAddress);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(cecVersion);
+ }
+
+ @Test
+ public void cecDevices_tracking_reportFeatures_tracksCecVersion_cec20() {
+ int logicalAddress = Constants.ADDR_PLAYBACK_1;
+ int cecVersion = HdmiControlManager.HDMI_CEC_VERSION_2_0;
+ mHdmiCecNetwork.handleCecMessage(
+ HdmiCecMessageBuilder.buildReportFeatures(logicalAddress,
+ cecVersion, Collections.emptyList(),
+ Constants.RC_PROFILE_SOURCE, Collections.emptyList(),
+ Collections.emptyList()));
+
+ assertThat(mHdmiCecNetwork.getSafeCecDevicesLocked()).hasSize(1);
+
+ HdmiDeviceInfo cecDeviceInfo = mHdmiCecNetwork.getCecDeviceInfo(logicalAddress);
+ assertThat(cecDeviceInfo.getLogicalAddress()).isEqualTo(logicalAddress);
+ assertThat(cecDeviceInfo.getCecVersion()).isEqualTo(cecVersion);
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/OWNERS b/services/tests/servicestests/src/com/android/server/hdmi/OWNERS
new file mode 100644
index 0000000..c3c47ed
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/hdmi/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/hdmi/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/input/OWNERS b/services/tests/servicestests/src/com/android/server/input/OWNERS
new file mode 100644
index 0000000..d701f23
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/input/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/input/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/inputmethod/OWNERS b/services/tests/servicestests/src/com/android/server/inputmethod/OWNERS
new file mode 100644
index 0000000..5deb2ce
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/inputmethod/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/inputmethod/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/integrity/OWNERS b/services/tests/servicestests/src/com/android/server/integrity/OWNERS
new file mode 100644
index 0000000..653d1c9
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/integrity/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/integrity/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/job/OWNERS b/services/tests/servicestests/src/com/android/server/job/OWNERS
new file mode 100644
index 0000000..6f207fb1
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/job/OWNERS
@@ -0,0 +1 @@
+include /apex/jobscheduler/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/lights/OWNERS b/services/tests/servicestests/src/com/android/server/lights/OWNERS
new file mode 100644
index 0000000..cb46a80
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/lights/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/lights/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/OWNERS b/services/tests/servicestests/src/com/android/server/locksettings/OWNERS
new file mode 100644
index 0000000..0a8dc8c
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/locksettings/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/locksettings/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java b/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
index 7767a28..9d300a6 100644
--- a/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
+++ b/services/tests/servicestests/src/com/android/server/net/IpConfigStoreTest.java
@@ -20,11 +20,11 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
+import android.net.InetAddresses;
import android.net.IpConfiguration;
import android.net.IpConfiguration.IpAssignment;
import android.net.IpConfiguration.ProxySettings;
import android.net.LinkAddress;
-import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.StaticIpConfiguration;
import android.util.ArrayMap;
@@ -79,8 +79,8 @@
StaticIpConfiguration staticIpConfiguration = new StaticIpConfiguration();
staticIpConfiguration.ipAddress = new LinkAddress(IP_ADDR_1);
- staticIpConfiguration.dnsServers.add(NetworkUtils.numericToInetAddress(DNS_IP_ADDR_1));
- staticIpConfiguration.dnsServers.add(NetworkUtils.numericToInetAddress(DNS_IP_ADDR_2));
+ staticIpConfiguration.dnsServers.add(InetAddresses.parseNumericAddress(DNS_IP_ADDR_1));
+ staticIpConfiguration.dnsServers.add(InetAddresses.parseNumericAddress(DNS_IP_ADDR_2));
ProxyInfo proxyInfo = new ProxyInfo("10.10.10.10", 88, "host1,host2");
diff --git a/services/tests/servicestests/src/com/android/server/net/OWNERS b/services/tests/servicestests/src/com/android/server/net/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/net/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/om/OWNERS b/services/tests/servicestests/src/com/android/server/om/OWNERS
new file mode 100644
index 0000000..afb98d4
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/om/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/content/om/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/people/OWNERS b/services/tests/servicestests/src/com/android/server/people/OWNERS
new file mode 100644
index 0000000..3198a5e
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/people/OWNERS
@@ -0,0 +1 @@
+include /services/people/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/pm/OWNERS b/services/tests/servicestests/src/com/android/server/pm/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/pm/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/pm/permission/LegacyPermissionManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/pm/permission/LegacyPermissionManagerServiceTest.java
new file mode 100644
index 0000000..4f6441f
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/pm/permission/LegacyPermissionManagerServiceTest.java
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2020 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.pm.permission;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.when;
+import static org.testng.Assert.assertThrows;
+
+import android.app.AppOpsManager;
+import android.app.admin.DevicePolicyManager;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.Process;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class LegacyPermissionManagerServiceTest {
+ private static final int SYSTEM_UID = 1000;
+ private static final int SYSTEM_PID = 1234;
+ private static final int APP_UID = Process.FIRST_APPLICATION_UID;
+ private static final int APP_PID = 5678;
+
+ private LegacyPermissionManagerService mLegacyPermissionManagerService;
+ private Context mContext;
+
+ @Mock
+ private LegacyPermissionManagerService.Injector mInjector;
+
+ @Mock
+ private AppOpsManager mAppOpsManager;
+
+ @Mock
+ private DevicePolicyManager mDevicePolicyManager;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+
+ mContext = InstrumentationRegistry.getContext();
+ mLegacyPermissionManagerService = new LegacyPermissionManagerService(mContext, mInjector);
+ }
+
+ @Test
+ public void checkDeviceIdentifierAccess_callingAppUidMismatch_throwsException() {
+ // An application should only be able to query its own device identifier access, querying
+ // of any other UIDs should result in a SecurityException.
+ setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
+
+ assertThrows(SecurityException.class,
+ () -> mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
+ mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null,
+ APP_PID, SYSTEM_UID));
+ }
+
+ @Test
+ public void checkDeviceIdentifierAccess_callingAppPidMismatch_throwsException() {
+ // Similar to above an app can only specify its own pid, a mismatch should result in a
+ // SecurityException.
+ setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
+
+ assertThrows(SecurityException.class,
+ () -> mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
+ mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null,
+ SYSTEM_PID, APP_UID));
+ }
+
+ @Test
+ public void checkDeviceIdentifierAccess_callingAppIdWithoutAccess_returnsDenied() {
+ // An application can query its own device identifier access; this test verifies that all
+ // checks can run through completion and return denied.
+ setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
+
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
+ mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
+ APP_UID);
+
+ assertEquals(PackageManager.PERMISSION_DENIED, result);
+ }
+
+ @Test
+ public void checkDeviceIdentifierAccess_systemUid_returnsGranted() {
+ // The system UID should always have access to device identifiers.
+ setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
+ mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, SYSTEM_PID,
+ SYSTEM_UID);
+
+ assertEquals(PackageManager.PERMISSION_GRANTED, result);
+ }
+
+ @Test
+ public void checkDeviceIdentifierAccess_hasPrivilegedPermission_returnsGranted() {
+ // Apps with the READ_PRIVILEGED_PHONE_STATE permission should have access to device
+ // identifiers.
+ setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
+ when(mInjector.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
+ APP_PID, APP_UID)).thenReturn(PackageManager.PERMISSION_GRANTED);
+
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
+ mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
+ APP_UID);
+
+ assertEquals(PackageManager.PERMISSION_GRANTED, result);
+ }
+
+ @Test
+ public void checkDeviceIdentifierAccess_hasAppOp_returnsGranted() {
+ // Apps that have been granted the READ_DEVICE_IDENTIFIERS appop should have access to
+ // device identifiers.
+ setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
+ when(mAppOpsManager.noteOpNoThrow(eq(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS),
+ eq(APP_UID), eq(mContext.getPackageName()), any(), any())).thenReturn(
+ AppOpsManager.MODE_ALLOWED);
+
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
+ mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
+ APP_UID);
+
+ assertEquals(PackageManager.PERMISSION_GRANTED, result);
+ }
+
+ @Test
+ public void checkDeviceIdentifierAccess_hasDpmAccess_returnsGranted() {
+ // Apps that pass a DevicePolicyManager device / profile owner check should have access to
+ // device identifiers.
+ setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
+ when(mDevicePolicyManager.hasDeviceIdentifierAccess(mContext.getPackageName(), APP_PID,
+ APP_UID)).thenReturn(true);
+
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
+ mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
+ APP_UID);
+
+ assertEquals(PackageManager.PERMISSION_GRANTED, result);
+ }
+
+ private void setupCheckDeviceIdentifierAccessTest(int callingPid, int callingUid) {
+ when(mInjector.getCallingPid()).thenReturn(callingPid);
+ when(mInjector.getCallingUid()).thenReturn(callingUid);
+
+ // Configure the checkDeviceIdentifierAccess tests to fail all access checks, then each test
+ // can individually set the access check to pass for verification.
+ when(mInjector.checkPermission(anyString(), anyInt(), anyInt())).thenReturn(
+ PackageManager.PERMISSION_DENIED);
+
+ when(mAppOpsManager.noteOpNoThrow(anyString(), anyInt(), anyString(), any(),
+ any())).thenReturn(AppOpsManager.MODE_DEFAULT);
+ when(mInjector.getSystemService(eq(Context.APP_OPS_SERVICE))).thenReturn(mAppOpsManager);
+
+ when(mDevicePolicyManager.hasDeviceIdentifierAccess(anyString(), anyInt(),
+ anyInt())).thenReturn(false);
+ when(mInjector.getSystemService(eq(Context.DEVICE_POLICY_SERVICE))).thenReturn(
+ mDevicePolicyManager);
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/pm/permission/PermissionManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/pm/permission/PermissionManagerServiceTest.java
deleted file mode 100644
index 6cea928..0000000
--- a/services/tests/servicestests/src/com/android/server/pm/permission/PermissionManagerServiceTest.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (C) 2020 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.pm.permission;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyInt;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
-import static org.testng.Assert.assertThrows;
-
-import android.app.AppOpsManager;
-import android.app.admin.DevicePolicyManager;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.Process;
-import android.permission.PermissionManagerInternal;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.runner.AndroidJUnit4;
-
-import com.android.server.LocalServices;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-@RunWith(AndroidJUnit4.class)
-public class PermissionManagerServiceTest {
- private static final String TAG = "PermissionManagerServiceTag";
-
- private static final int SYSTEM_UID = 1000;
- private static final int SYSTEM_PID = 1234;
- private static final int APP_UID = Process.FIRST_APPLICATION_UID;
- private static final int APP_PID = 5678;
-
- private PermissionManagerService mPermissionManagerService;
- private Context mContext;
-
- @Mock
- private PermissionManagerService.Injector mInjector;
-
- @Mock
- private AppOpsManager mAppOpsManager;
-
- @Mock
- private DevicePolicyManager mDevicePolicyManager;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
-
- mContext = InstrumentationRegistry.getContext();
- mPermissionManagerService = new PermissionManagerService(mContext, mInjector);
- }
-
- @After
- public void tearDown() {
- // The LocalServices added by the constructor of the PermissionManagerService can either be
- // removed here after each test when tests are run serially, or to run them in parallel
- // the Injector can provide methods to add these that can be ignored by the mock.
- LocalServices.removeServiceForTest(PermissionManagerServiceInternal.class);
- LocalServices.removeServiceForTest(PermissionManagerInternal.class);
- }
-
- @Test
- public void checkDeviceIdentifierAccess_callingAppUidMismatch_throwsException() {
- // An application should only be able to query its own device identifier access, querying
- // of any other UIDs should result in a SecurityException.
- setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
-
- assertThrows(SecurityException.class,
- () -> mPermissionManagerService.checkDeviceIdentifierAccess(
- mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null,
- APP_PID, SYSTEM_UID));
- }
-
- @Test
- public void checkDeviceIdentifierAccess_callingAppPidMismatch_throwsException() {
- // Similar to above an app can only specify its own pid, a mismatch should result in a
- // SecurityException.
- setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
-
- assertThrows(SecurityException.class,
- () -> mPermissionManagerService.checkDeviceIdentifierAccess(
- mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null,
- SYSTEM_PID, APP_UID));
- }
-
- @Test
- public void checkDeviceIdentifierAccess_callingAppIdWithoutAccess_returnsDenied() {
- // An application can query its own device identifier access; this test verifies that all
- // checks can run through completion and return denied.
- setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
-
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
- mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
- APP_UID);
-
- assertEquals(PackageManager.PERMISSION_DENIED, result);
- }
-
- @Test
- public void checkDeviceIdentifierAccess_systemUid_returnsGranted() {
- // The system UID should always have access to device identifiers.
- setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
- mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, SYSTEM_PID,
- SYSTEM_UID);
-
- assertEquals(PackageManager.PERMISSION_GRANTED, result);
- }
-
- @Test
- public void checkDeviceIdentifierAccess_hasPrivilegedPermission_returnsGranted() {
- // Apps with the READ_PRIVILEGED_PHONE_STATE permission should have access to device
- // identifiers.
- setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
- when(mInjector.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
- APP_PID, APP_UID)).thenReturn(PackageManager.PERMISSION_GRANTED);
-
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
- mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
- APP_UID);
-
- assertEquals(PackageManager.PERMISSION_GRANTED, result);
- }
-
- @Test
- public void checkDeviceIdentifierAccess_hasAppOp_returnsGranted() {
- // Apps that have been granted the READ_DEVICE_IDENTIFIERS appop should have access to
- // device identifiers.
- setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
- when(mAppOpsManager.noteOpNoThrow(eq(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS),
- eq(APP_UID), eq(mContext.getPackageName()), any(), any())).thenReturn(
- AppOpsManager.MODE_ALLOWED);
-
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
- mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
- APP_UID);
-
- assertEquals(PackageManager.PERMISSION_GRANTED, result);
- }
-
- @Test
- public void checkDeviceIdentifierAccess_hasDpmAccess_returnsGranted() {
- // Apps that pass a DevicePolicyManager device / profile owner check should have access to
- // device identifiers.
- setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
- when(mDevicePolicyManager.hasDeviceIdentifierAccess(mContext.getPackageName(), APP_PID,
- APP_UID)).thenReturn(true);
-
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
- mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
- APP_UID);
-
- assertEquals(PackageManager.PERMISSION_GRANTED, result);
- }
-
- private void setupCheckDeviceIdentifierAccessTest(int callingPid, int callingUid) {
- when(mInjector.getCallingPid()).thenReturn(callingPid);
- when(mInjector.getCallingUid()).thenReturn(callingUid);
-
- // Configure the checkDeviceIdentifierAccess tests to fail all access checks, then each test
- // can individually set the access check to pass for verification.
- when(mInjector.checkPermission(anyString(), anyInt(), anyInt())).thenReturn(
- PackageManager.PERMISSION_DENIED);
-
- when(mAppOpsManager.noteOpNoThrow(anyString(), anyInt(), anyString(), any(),
- any())).thenReturn(AppOpsManager.MODE_DEFAULT);
- when(mInjector.getSystemService(eq(Context.APP_OPS_SERVICE))).thenReturn(mAppOpsManager);
-
- when(mDevicePolicyManager.hasDeviceIdentifierAccess(anyString(), anyInt(),
- anyInt())).thenReturn(false);
- when(mInjector.getSystemService(eq(Context.DEVICE_POLICY_SERVICE))).thenReturn(
- mDevicePolicyManager);
- }
-}
diff --git a/services/tests/servicestests/src/com/android/server/policy/OWNERS b/services/tests/servicestests/src/com/android/server/policy/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/policy/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/power/OWNERS b/services/tests/servicestests/src/com/android/server/power/OWNERS
new file mode 100644
index 0000000..d68066b
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/power/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/power/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/powerstats/OWNERS b/services/tests/servicestests/src/com/android/server/powerstats/OWNERS
new file mode 100644
index 0000000..d68066b
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/powerstats/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/power/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/rollback/OWNERS b/services/tests/servicestests/src/com/android/server/rollback/OWNERS
new file mode 100644
index 0000000..d04a706
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/rollback/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/rollback/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/OWNERS b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/OWNERS
new file mode 100644
index 0000000..816bc6b
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/media/soundtrigger/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/stats/OWNERS b/services/tests/servicestests/src/com/android/server/stats/OWNERS
new file mode 100644
index 0000000..ee865b1
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/stats/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/stats/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/storage/OWNERS b/services/tests/servicestests/src/com/android/server/storage/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/storage/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/textclassifier/OWNERS b/services/tests/servicestests/src/com/android/server/textclassifier/OWNERS
new file mode 100644
index 0000000..46b3cb8
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/textclassifier/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/textclassifier/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/OWNERS b/services/tests/servicestests/src/com/android/server/timedetector/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/timedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
index 4a44005..5276ac4 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
@@ -28,6 +28,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -174,6 +175,36 @@
mStubbedTimeDetectorStrategy.verifySuggestNetworkTimeCalled(NetworkTimeSuggestion);
}
+ @Test(expected = SecurityException.class)
+ public void testSuggestGnssTime_withoutPermission() {
+ doThrow(new SecurityException("Mock"))
+ .when(mMockContext).enforceCallingOrSelfPermission(anyString(), any());
+ GnssTimeSuggestion gnssTimeSuggestion = createGnssTimeSuggestion();
+
+ try {
+ mTimeDetectorService.suggestGnssTime(gnssTimeSuggestion);
+ fail();
+ } finally {
+ verify(mMockContext).enforceCallingOrSelfPermission(
+ eq(android.Manifest.permission.SET_TIME), anyString());
+ }
+ }
+
+ @Test
+ public void testSuggestGnssTime() throws Exception {
+ doNothing().when(mMockContext).enforceCallingOrSelfPermission(anyString(), any());
+
+ GnssTimeSuggestion gnssTimeSuggestion = createGnssTimeSuggestion();
+ mTimeDetectorService.suggestGnssTime(gnssTimeSuggestion);
+ mTestHandler.assertTotalMessagesEnqueued(1);
+
+ verify(mMockContext).enforceCallingOrSelfPermission(
+ eq(android.Manifest.permission.SET_TIME), anyString());
+
+ mTestHandler.waitForMessagesToBeProcessed();
+ mStubbedTimeDetectorStrategy.verifySuggestGnssTimeCalled(gnssTimeSuggestion);
+ }
+
@Test
public void testDump() {
when(mMockContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP))
@@ -219,12 +250,18 @@
return new NetworkTimeSuggestion(timeValue);
}
+ private static GnssTimeSuggestion createGnssTimeSuggestion() {
+ TimestampedValue<Long> timeValue = new TimestampedValue<>(100L, 1_000_000L);
+ return new GnssTimeSuggestion(timeValue);
+ }
+
private static class StubbedTimeDetectorStrategy implements TimeDetectorStrategy {
// Call tracking.
private TelephonyTimeSuggestion mLastTelephonySuggestion;
private ManualTimeSuggestion mLastManualSuggestion;
private NetworkTimeSuggestion mLastNetworkSuggestion;
+ private GnssTimeSuggestion mLastGnssSuggestion;
private boolean mHandleAutoTimeDetectionChangedCalled;
private boolean mDumpCalled;
@@ -245,6 +282,11 @@
}
@Override
+ public void suggestGnssTime(GnssTimeSuggestion timeSuggestion) {
+ mLastGnssSuggestion = timeSuggestion;
+ }
+
+ @Override
public void handleAutoTimeConfigChanged() {
mHandleAutoTimeDetectionChangedCalled = true;
}
@@ -258,6 +300,7 @@
mLastTelephonySuggestion = null;
mLastManualSuggestion = null;
mLastNetworkSuggestion = null;
+ mLastGnssSuggestion = null;
mHandleAutoTimeDetectionChangedCalled = false;
mDumpCalled = false;
}
@@ -274,6 +317,10 @@
assertEquals(expectedSuggestion, mLastNetworkSuggestion);
}
+ void verifySuggestGnssTimeCalled(GnssTimeSuggestion expectedSuggestion) {
+ assertEquals(expectedSuggestion, mLastGnssSuggestion);
+ }
+
void verifyHandleAutoTimeDetectionChangedCalled() {
assertTrue(mHandleAutoTimeDetectionChangedCalled);
}
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java
index 21396fd..b1adb0b 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java
@@ -16,6 +16,7 @@
package com.android.server.timedetector;
+import static com.android.server.timedetector.TimeDetectorStrategy.ORIGIN_GNSS;
import static com.android.server.timedetector.TimeDetectorStrategy.ORIGIN_NETWORK;
import static com.android.server.timedetector.TimeDetectorStrategy.ORIGIN_TELEPHONY;
@@ -25,6 +26,7 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -569,7 +571,53 @@
}
@Test
- public void highPrioritySuggestionsShouldBeatLowerPrioritySuggestions() {
+ public void testSuggestGnssTime_autoTimeEnabled() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoOriginPriorities(ORIGIN_GNSS)
+ .pokeAutoTimeDetectionEnabled(true);
+
+ GnssTimeSuggestion timeSuggestion =
+ mScript.generateGnssTimeSuggestion(ARBITRARY_TEST_TIME);
+
+ mScript.simulateTimePassing();
+
+ long expectedSystemClockMillis =
+ mScript.calculateTimeInMillisForNow(timeSuggestion.getUtcTime());
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .verifySystemClockWasSetAndResetCallTracking(expectedSystemClockMillis);
+ }
+
+ @Test
+ public void testSuggestGnssTime_autoTimeDisabled() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoOriginPriorities(ORIGIN_GNSS)
+ .pokeAutoTimeDetectionEnabled(false);
+
+ GnssTimeSuggestion timeSuggestion =
+ mScript.generateGnssTimeSuggestion(ARBITRARY_TEST_TIME);
+
+ mScript.simulateTimePassing()
+ .simulateGnssTimeSuggestion(timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+ }
+
+ @Test
+ public void gnssTimeSuggestion_ignoredWhenReferencedTimeIsInThePast() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoOriginPriorities(ORIGIN_GNSS)
+ .pokeAutoTimeDetectionEnabled(true);
+
+ Instant suggestedTime = TIME_LOWER_BOUND.minus(Duration.ofDays(1));
+ GnssTimeSuggestion timeSuggestion = mScript
+ .generateGnssTimeSuggestion(suggestedTime);
+
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking()
+ .assertLatestGnssSuggestion(null);
+ }
+
+ @Test
+ public void highPrioritySuggestionsBeatLowerPrioritySuggestions_telephonyNetworkOrigins() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
.pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK);
@@ -672,22 +720,130 @@
}
@Test
+ public void highPrioritySuggestionsBeatLowerPrioritySuggestions_networkGnssOrigins() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_NETWORK, ORIGIN_GNSS);
+
+ // Three obviously different times that could not be mistaken for each other.
+ Instant gnssTime1 = ARBITRARY_TEST_TIME;
+ Instant gnssTime2 = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant networkTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(60));
+ // A small increment used to simulate the passage of time, but not enough to interfere with
+ // macro-level time changes associated with suggestion age.
+ final long smallTimeIncrementMillis = 101;
+
+ // A gnss suggestion is made. It should be used because there is no network suggestion.
+ GnssTimeSuggestion gnssTimeSuggestion1 =
+ mScript.generateGnssTimeSuggestion(gnssTime1);
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion1)
+ .verifySystemClockWasSetAndResetCallTracking(
+ mScript.calculateTimeInMillisForNow(gnssTimeSuggestion1.getUtcTime()));
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(null)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion1);
+ assertEquals(gnssTimeSuggestion1, mScript.peekLatestValidGnssSuggestion());
+ assertNull("No network suggestions were made:", mScript.peekLatestValidNetworkSuggestion());
+
+ // Simulate a little time passing.
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Now a network suggestion is made. Network suggestions are prioritized over gnss
+ // suggestions so it should "win".
+ NetworkTimeSuggestion networkTimeSuggestion =
+ mScript.generateNetworkTimeSuggestion(networkTime);
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .simulateNetworkTimeSuggestion(networkTimeSuggestion)
+ .verifySystemClockWasSetAndResetCallTracking(
+ mScript.calculateTimeInMillisForNow(networkTimeSuggestion.getUtcTime()));
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion1);
+ assertEquals(gnssTimeSuggestion1, mScript.peekLatestValidGnssSuggestion());
+ assertEquals(networkTimeSuggestion, mScript.peekLatestValidNetworkSuggestion());
+
+ // Simulate some significant time passing: half the time allowed before a time signal
+ // becomes "too old to use".
+ mScript.simulateTimePassing(TimeDetectorStrategyImpl.MAX_UTC_TIME_AGE_MILLIS / 2)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Now another gnss suggestion is made. Network suggestions are prioritized over
+ // gnss suggestions so the latest network suggestion should still "win".
+ GnssTimeSuggestion gnssTimeSuggestion2 =
+ mScript.generateGnssTimeSuggestion(gnssTime2);
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion2)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion2);
+ assertEquals(gnssTimeSuggestion2, mScript.peekLatestValidGnssSuggestion());
+ assertEquals(networkTimeSuggestion, mScript.peekLatestValidNetworkSuggestion());
+
+ // Simulate some significant time passing: half the time allowed before a time signal
+ // becomes "too old to use". This should mean that telephonyTimeSuggestion is now too old to
+ // be used but networkTimeSuggestion2 is not.
+ mScript.simulateTimePassing(TimeDetectorStrategyImpl.MAX_UTC_TIME_AGE_MILLIS / 2);
+
+ // NOTE: The TimeDetectorStrategyImpl doesn't set an alarm for the point when the last
+ // suggestion it used becomes too old: it requires a new suggestion or an auto-time toggle
+ // to re-run the detection logic. This may change in future but until then we rely on a
+ // steady stream of suggestions to re-evaluate.
+ mScript.verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion2);
+ assertEquals(gnssTimeSuggestion2, mScript.peekLatestValidGnssSuggestion());
+ assertNull(
+ "Network suggestion should be expired:",
+ mScript.peekLatestValidNetworkSuggestion());
+
+ // Toggle auto-time off and on to force the detection logic to run.
+ mScript.simulateAutoTimeDetectionToggle()
+ .simulateTimePassing(smallTimeIncrementMillis)
+ .simulateAutoTimeDetectionToggle();
+
+ // Verify the latest gnss time now wins.
+ mScript.verifySystemClockWasSetAndResetCallTracking(
+ mScript.calculateTimeInMillisForNow(gnssTimeSuggestion2.getUtcTime()));
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion2);
+ assertEquals(gnssTimeSuggestion2, mScript.peekLatestValidGnssSuggestion());
+ assertNull(
+ "Network suggestion should still be expired:",
+ mScript.peekLatestValidNetworkSuggestion());
+ }
+
+ @Test
public void whenAllTimeSuggestionsAreAvailable_higherPriorityWins_lowerPriorityComesFirst() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
- .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK);
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK, ORIGIN_GNSS);
Instant networkTime = ARBITRARY_TEST_TIME;
- Instant telephonyTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant gnssTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant telephonyTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(60));
NetworkTimeSuggestion networkTimeSuggestion =
mScript.generateNetworkTimeSuggestion(networkTime);
+ GnssTimeSuggestion gnssTimeSuggestion =
+ mScript.generateGnssTimeSuggestion(gnssTime);
TelephonyTimeSuggestion telephonyTimeSuggestion =
mScript.generateTelephonyTimeSuggestion(ARBITRARY_SLOT_INDEX, telephonyTime);
mScript.simulateNetworkTimeSuggestion(networkTimeSuggestion)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion)
.simulateTelephonyTimeSuggestion(telephonyTimeSuggestion)
.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion)
.assertLatestTelephonySuggestion(ARBITRARY_SLOT_INDEX, telephonyTimeSuggestion)
.verifySystemClockWasSetAndResetCallTracking(telephonyTime.toEpochMilli());
}
@@ -696,20 +852,25 @@
public void whenAllTimeSuggestionsAreAvailable_higherPriorityWins_higherPriorityComesFirst() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
- .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK);
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK, ORIGIN_GNSS);
Instant networkTime = ARBITRARY_TEST_TIME;
Instant telephonyTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant gnssTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(60));
NetworkTimeSuggestion networkTimeSuggestion =
mScript.generateNetworkTimeSuggestion(networkTime);
TelephonyTimeSuggestion telephonyTimeSuggestion =
mScript.generateTelephonyTimeSuggestion(ARBITRARY_SLOT_INDEX, telephonyTime);
+ GnssTimeSuggestion gnssTimeSuggestion =
+ mScript.generateGnssTimeSuggestion(gnssTime);
mScript.simulateTelephonyTimeSuggestion(telephonyTimeSuggestion)
.simulateNetworkTimeSuggestion(networkTimeSuggestion)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion)
.assertLatestNetworkSuggestion(networkTimeSuggestion)
.assertLatestTelephonySuggestion(ARBITRARY_SLOT_INDEX, telephonyTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion)
.verifySystemClockWasSetAndResetCallTracking(telephonyTime.toEpochMilli());
}
@@ -728,7 +889,37 @@
}
@Test
- public void suggestionsFromSourceNotListedInPrioritiesList_areIgnored() {
+ public void whenHigherPrioritySuggestionsAreNotAvailable_fallbacksToNext() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK, ORIGIN_GNSS);
+
+ GnssTimeSuggestion timeSuggestion =
+ mScript.generateGnssTimeSuggestion(ARBITRARY_TEST_TIME);
+
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .assertLatestGnssSuggestion(timeSuggestion)
+ .verifySystemClockWasSetAndResetCallTracking(ARBITRARY_TEST_TIME.toEpochMilli());
+ }
+
+ @Test
+ public void suggestionsFromTelephonyOriginNotInPriorityList_areIgnored() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_NETWORK);
+
+ int slotIndex = ARBITRARY_SLOT_INDEX;
+ Instant testTime = ARBITRARY_TEST_TIME;
+ TelephonyTimeSuggestion timeSuggestion =
+ mScript.generateTelephonyTimeSuggestion(slotIndex, testTime);
+
+ mScript.simulateTelephonyTimeSuggestion(timeSuggestion)
+ .assertLatestTelephonySuggestion(ARBITRARY_SLOT_INDEX, timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+ }
+
+ @Test
+ public void suggestionsFromNetworkOriginNotInPriorityList_areIgnored() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
.pokeAutoOriginPriorities(ORIGIN_TELEPHONY);
@@ -742,6 +933,20 @@
}
@Test
+ public void suggestionsFromGnssOriginNotInPriorityList_areIgnored() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY);
+
+ GnssTimeSuggestion timeSuggestion = mScript.generateGnssTimeSuggestion(
+ ARBITRARY_TEST_TIME);
+
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .assertLatestGnssSuggestion(timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+ }
+
+ @Test
public void autoOriginPrioritiesList_doesNotAffectManualSuggestion() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(false)
@@ -945,6 +1150,11 @@
return this;
}
+ Script simulateGnssTimeSuggestion(GnssTimeSuggestion timeSuggestion) {
+ mTimeDetectorStrategy.suggestGnssTime(timeSuggestion);
+ return this;
+ }
+
Script simulateAutoTimeDetectionToggle() {
mFakeCallback.simulateAutoTimeZoneDetectionToggle();
mTimeDetectorStrategy.handleAutoTimeConfigChanged();
@@ -995,6 +1205,14 @@
}
/**
+ * White box test info: Asserts the latest gnss suggestion is as expected.
+ */
+ Script assertLatestGnssSuggestion(GnssTimeSuggestion expected) {
+ assertEquals(expected, mTimeDetectorStrategy.getLatestGnssSuggestion());
+ return this;
+ }
+
+ /**
* White box test info: Returns the telephony suggestion that would be used, if any, given
* the current elapsed real time clock and regardless of origin prioritization.
*/
@@ -1011,6 +1229,14 @@
}
/**
+ * White box test info: Returns the gnss suggestion that would be used, if any, given the
+ * current elapsed real time clock and regardless of origin prioritization.
+ */
+ GnssTimeSuggestion peekLatestValidGnssSuggestion() {
+ return mTimeDetectorStrategy.findLatestValidGnssSuggestionForTests();
+ }
+
+ /**
* Generates a ManualTimeSuggestion using the current elapsed realtime clock for the
* reference time.
*/
@@ -1057,6 +1283,18 @@
}
/**
+ * Generates a GnssTimeSuggestion using the current elapsed realtime clock for the
+ * reference time.
+ */
+ GnssTimeSuggestion generateGnssTimeSuggestion(Instant suggestedTime) {
+ TimestampedValue<Long> utcTime =
+ new TimestampedValue<>(
+ mFakeCallback.peekElapsedRealtimeMillis(),
+ suggestedTime.toEpochMilli());
+ return new GnssTimeSuggestion(utcTime);
+ }
+
+ /**
* Calculates what the supplied time would be when adjusted for the movement of the fake
* elapsed realtime clock.
*/
diff --git a/services/tests/servicestests/src/com/android/server/timezone/OWNERS b/services/tests/servicestests/src/com/android/server/timezone/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS b/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS
new file mode 100644
index 0000000..8f80897
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/tv/OWNERS b/services/tests/servicestests/src/com/android/server/tv/OWNERS
new file mode 100644
index 0000000..305027c
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/tv/OWNERS
@@ -0,0 +1 @@
+include /media/java/android/media/tv/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/uri/OWNERS b/services/tests/servicestests/src/com/android/server/uri/OWNERS
new file mode 100644
index 0000000..ca5d5f98
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/uri/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/uri/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/usage/OWNERS b/services/tests/servicestests/src/com/android/server/usage/OWNERS
new file mode 100644
index 0000000..d3227de
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/usage/OWNERS
@@ -0,0 +1 @@
+include /services/usage/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/vibrator/OWNERS b/services/tests/servicestests/src/com/android/server/vibrator/OWNERS
new file mode 100644
index 0000000..cc63ceb
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/vibrator/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/vibrator/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/vibrator/VibrationScalerTest.java b/services/tests/servicestests/src/com/android/server/vibrator/VibrationScalerTest.java
index fa171fd..1a4ac07 100644
--- a/services/tests/servicestests/src/com/android/server/vibrator/VibrationScalerTest.java
+++ b/services/tests/servicestests/src/com/android/server/vibrator/VibrationScalerTest.java
@@ -28,6 +28,7 @@
import android.content.ContextWrapper;
import android.os.Handler;
import android.os.IExternalVibratorService;
+import android.os.PowerManagerInternal;
import android.os.UserHandle;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
@@ -40,7 +41,9 @@
import com.android.internal.util.test.FakeSettingsProvider;
import com.android.internal.util.test.FakeSettingsProviderRule;
+import com.android.server.LocalServices;
+import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -62,6 +65,7 @@
// TODO(b/131311651): replace with a FakeVibrator instead.
@Mock private Vibrator mVibratorMock;
+ @Mock private PowerManagerInternal mPowerManagerInternalMock;
private TestLooper mTestLooper;
private ContextWrapper mContextSpy;
@@ -77,11 +81,19 @@
when(mContextSpy.getContentResolver()).thenReturn(contentResolver);
when(mContextSpy.getSystemService(eq(Context.VIBRATOR_SERVICE))).thenReturn(mVibratorMock);
+ LocalServices.removeServiceForTest(PowerManagerInternal.class);
+ LocalServices.addService(PowerManagerInternal.class, mPowerManagerInternalMock);
+
mVibrationSettings = new VibrationSettings(
mContextSpy, new Handler(mTestLooper.getLooper()));
mVibrationScaler = new VibrationScaler(mContextSpy, mVibrationSettings);
}
+ @After
+ public void tearDown() throws Exception {
+ LocalServices.removeServiceForTest(PowerManagerInternal.class);
+ }
+
@Test
public void testGetExternalVibrationScale() {
when(mVibratorMock.getDefaultHapticFeedbackIntensity())
diff --git a/services/tests/servicestests/src/com/android/server/vibrator/VibrationSettingsTest.java b/services/tests/servicestests/src/com/android/server/vibrator/VibrationSettingsTest.java
index 04c2cb3..ecdb8bc 100644
--- a/services/tests/servicestests/src/com/android/server/vibrator/VibrationSettingsTest.java
+++ b/services/tests/servicestests/src/com/android/server/vibrator/VibrationSettingsTest.java
@@ -20,7 +20,9 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -32,6 +34,9 @@
import android.content.ContextWrapper;
import android.media.AudioManager;
import android.os.Handler;
+import android.os.PowerManagerInternal;
+import android.os.PowerSaveState;
+import android.os.RemoteException;
import android.os.UserHandle;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
@@ -44,6 +49,7 @@
import com.android.internal.util.test.FakeSettingsProvider;
import com.android.internal.util.test.FakeSettingsProviderRule;
+import com.android.server.LocalServices;
import org.junit.After;
import org.junit.Before;
@@ -62,17 +68,24 @@
@Presubmit
public class VibrationSettingsTest {
+ private static final int UID = 1;
+ private static final PowerSaveState NORMAL_POWER_STATE = new PowerSaveState.Builder().build();
+ private static final PowerSaveState LOW_POWER_STATE = new PowerSaveState.Builder()
+ .setBatterySaverEnabled(true).build();
+
@Rule public MockitoRule mMockitoRule = MockitoJUnit.rule();
@Rule public FakeSettingsProviderRule mSettingsProviderRule = FakeSettingsProvider.rule();
// TODO(b/131311651): replace with a FakeVibrator instead.
@Mock private Vibrator mVibratorMock;
@Mock private VibrationSettings.OnVibratorSettingsChanged mListenerMock;
+ @Mock private PowerManagerInternal mPowerManagerInternalMock;
private TestLooper mTestLooper;
private ContextWrapper mContextSpy;
private AudioManager mAudioManager;
private VibrationSettings mVibrationSettings;
+ private PowerManagerInternal.LowPowerModeListener mRegisteredPowerModeListener;
@Before
public void setUp() throws Exception {
@@ -83,10 +96,17 @@
when(mContextSpy.getContentResolver()).thenReturn(contentResolver);
when(mContextSpy.getSystemService(eq(Context.VIBRATOR_SERVICE))).thenReturn(mVibratorMock);
when(mVibratorMock.hasVibrator()).thenReturn(true);
+ doAnswer(invocation -> {
+ mRegisteredPowerModeListener = invocation.getArgument(0);
+ return null;
+ }).when(mPowerManagerInternalMock).registerLowPowerModeObserver(any());
+
+ LocalServices.removeServiceForTest(PowerManagerInternal.class);
+ LocalServices.addService(PowerManagerInternal.class, mPowerManagerInternalMock);
mAudioManager = mContextSpy.getSystemService(AudioManager.class);
- mVibrationSettings = new VibrationSettings(
- mContextSpy, new Handler(mTestLooper.getLooper()));
+ mVibrationSettings = new VibrationSettings(mContextSpy,
+ new Handler(mTestLooper.getLooper()));
setUserSetting(Settings.System.VIBRATE_INPUT_DEVICES, 0);
setUserSetting(Settings.System.VIBRATE_WHEN_RINGING, 0);
@@ -96,7 +116,7 @@
@After
public void tearDown() throws Exception {
- FakeSettingsProvider.clearSettingsProvider();
+ LocalServices.removeServiceForTest(PowerManagerInternal.class);
}
@Test
@@ -118,6 +138,17 @@
}
@Test
+ public void addListener_lowPowerModeChangeTriggerListener() {
+ mVibrationSettings.addListener(mListenerMock);
+
+ mRegisteredPowerModeListener.onLowPowerModeChanged(LOW_POWER_STATE);
+ mRegisteredPowerModeListener.onLowPowerModeChanged(NORMAL_POWER_STATE);
+ mRegisteredPowerModeListener.onLowPowerModeChanged(NORMAL_POWER_STATE); // No change.
+
+ verify(mListenerMock, times(2)).onChange();
+ }
+
+ @Test
public void removeListener_noMoreCallbacksToListener() {
mVibrationSettings.addListener(mListenerMock);
@@ -132,56 +163,103 @@
}
@Test
- public void shouldVibrateForRingtones_withVibrateWhenRinging_onlyIgnoreSettingsForSilentMode() {
- setUserSetting(Settings.System.VIBRATE_WHEN_RINGING, 1);
-
- setRingerMode(AudioManager.RINGER_MODE_SILENT);
- assertFalse(mVibrationSettings.shouldVibrateForRingtone());
-
- setRingerMode(AudioManager.RINGER_MODE_MAX);
- assertTrue(mVibrationSettings.shouldVibrateForRingtone());
-
- setRingerMode(AudioManager.RINGER_MODE_NORMAL);
- assertTrue(mVibrationSettings.shouldVibrateForRingtone());
-
- setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
- assertTrue(mVibrationSettings.shouldVibrateForRingtone());
+ public void shouldVibrateForRingerMode_withoutRingtoneUsage_returnsTrue() {
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(VibrationAttributes.USAGE_ALARM));
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(VibrationAttributes.USAGE_TOUCH));
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(
+ VibrationAttributes.USAGE_NOTIFICATION));
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(
+ VibrationAttributes.USAGE_COMMUNICATION_REQUEST));
}
@Test
- public void shouldVibrateForRingtones_withApplyRampingRinger_onlyIgnoreSettingsForSilentMode() {
+ public void shouldVibrateForRingerMode_withVibrateWhenRinging_ignoreSettingsForSilentMode() {
+ int usageRingtone = VibrationAttributes.USAGE_RINGTONE;
+ setUserSetting(Settings.System.VIBRATE_WHEN_RINGING, 1);
+
+ setRingerMode(AudioManager.RINGER_MODE_SILENT);
+ assertFalse(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
+
+ setRingerMode(AudioManager.RINGER_MODE_MAX);
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
+
+ setRingerMode(AudioManager.RINGER_MODE_NORMAL);
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
+
+ setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
+ }
+
+ @Test
+ public void shouldVibrateForRingerMode_withApplyRampingRinger_ignoreSettingsForSilentMode() {
+ int usageRingtone = VibrationAttributes.USAGE_RINGTONE;
setUserSetting(Settings.System.VIBRATE_WHEN_RINGING, 0);
setGlobalSetting(Settings.Global.APPLY_RAMPING_RINGER, 1);
setRingerMode(AudioManager.RINGER_MODE_SILENT);
- assertFalse(mVibrationSettings.shouldVibrateForRingtone());
+ assertFalse(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
setRingerMode(AudioManager.RINGER_MODE_MAX);
- assertTrue(mVibrationSettings.shouldVibrateForRingtone());
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
setRingerMode(AudioManager.RINGER_MODE_NORMAL);
- assertTrue(mVibrationSettings.shouldVibrateForRingtone());
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
- assertTrue(mVibrationSettings.shouldVibrateForRingtone());
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
}
@Test
- public void shouldVibrateForRingtones_withAllSettingsOff_onlyVibratesForVibrateMode() {
+ public void shouldVibrateForRingerMode_withAllSettingsOff_onlyVibratesForVibrateMode() {
+ int usageRingtone = VibrationAttributes.USAGE_RINGTONE;
setUserSetting(Settings.System.VIBRATE_WHEN_RINGING, 0);
setGlobalSetting(Settings.Global.APPLY_RAMPING_RINGER, 0);
setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
- assertTrue(mVibrationSettings.shouldVibrateForRingtone());
+ assertTrue(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
setRingerMode(AudioManager.RINGER_MODE_SILENT);
- assertFalse(mVibrationSettings.shouldVibrateForRingtone());
+ assertFalse(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
setRingerMode(AudioManager.RINGER_MODE_MAX);
- assertFalse(mVibrationSettings.shouldVibrateForRingtone());
+ assertFalse(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
setRingerMode(AudioManager.RINGER_MODE_NORMAL);
- assertFalse(mVibrationSettings.shouldVibrateForRingtone());
+ assertFalse(mVibrationSettings.shouldVibrateForRingerMode(usageRingtone));
+ }
+
+ @Test
+ public void shouldVibrateForUid_withBackgroundAllowedUsage_returnTrue() throws RemoteException {
+ assertTrue(mVibrationSettings.shouldVibrateForUid(UID, VibrationAttributes.USAGE_ALARM));
+ assertTrue(mVibrationSettings.shouldVibrateForUid(UID,
+ VibrationAttributes.USAGE_NOTIFICATION));
+ assertTrue(mVibrationSettings.shouldVibrateForUid(UID, VibrationAttributes.USAGE_RINGTONE));
+ }
+
+ @Test
+ public void shouldVibrateForPowerMode_withLowPowerAndAllowedUsage_returnTrue() {
+ mRegisteredPowerModeListener.onLowPowerModeChanged(LOW_POWER_STATE);
+
+ assertTrue(mVibrationSettings.shouldVibrateForPowerMode(VibrationAttributes.USAGE_ALARM));
+ assertTrue(mVibrationSettings.shouldVibrateForPowerMode(
+ VibrationAttributes.USAGE_RINGTONE));
+ assertTrue(mVibrationSettings.shouldVibrateForPowerMode(
+ VibrationAttributes.USAGE_COMMUNICATION_REQUEST));
+ }
+
+ @Test
+ public void shouldVibrateForPowerMode_withRestrictedUsage_returnsFalseWhileInLowPowerMode() {
+ mRegisteredPowerModeListener.onLowPowerModeChanged(NORMAL_POWER_STATE);
+
+ assertTrue(mVibrationSettings.shouldVibrateForPowerMode(VibrationAttributes.USAGE_TOUCH));
+ assertTrue(mVibrationSettings.shouldVibrateForPowerMode(
+ VibrationAttributes.USAGE_NOTIFICATION));
+
+ mRegisteredPowerModeListener.onLowPowerModeChanged(LOW_POWER_STATE);
+
+ assertFalse(mVibrationSettings.shouldVibrateForPowerMode(VibrationAttributes.USAGE_TOUCH));
+ assertFalse(mVibrationSettings.shouldVibrateForPowerMode(
+ VibrationAttributes.USAGE_NOTIFICATION));
}
@Test
@@ -299,4 +377,5 @@
mAudioManager.setRingerModeInternal(ringerMode);
assertEquals(ringerMode, mAudioManager.getRingerModeInternal());
}
+
}
diff --git a/services/tests/servicestests/src/com/android/server/vibrator/VibratorControllerTest.java b/services/tests/servicestests/src/com/android/server/vibrator/VibratorControllerTest.java
index 1f163bd..815aa8e 100644
--- a/services/tests/servicestests/src/com/android/server/vibrator/VibratorControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/vibrator/VibratorControllerTest.java
@@ -16,7 +16,6 @@
package com.android.server.vibrator;
-import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -38,7 +37,6 @@
import android.os.IBinder;
import android.os.IVibratorStateListener;
import android.os.VibrationEffect;
-import android.os.Vibrator;
import android.os.test.TestLooper;
import android.platform.test.annotations.Presubmit;
@@ -100,7 +98,7 @@
public void createController_initializesNativeWrapper() {
int vibratorId = 13;
VibratorController controller = createController(vibratorId);
- assertEquals(vibratorId, controller.getVibratorId());
+ assertEquals(vibratorId, controller.getVibratorInfo().getId());
verify(mNativeWrapperMock).init(eq(vibratorId), notNull());
}
@@ -132,59 +130,6 @@
}
@Test
- public void areEffectsSupported_withNullResultFromNative_returnsSupportUnknown() {
- when(mNativeWrapperMock.getSupportedEffects()).thenReturn(null);
- assertArrayEquals(new int[]{Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN},
- createController().areEffectsSupported(new int[]{VibrationEffect.EFFECT_CLICK}));
- }
-
- @Test
- public void areEffectsSupported_withSomeEffectsSupported_returnsSupportYesAndNoForEffects() {
- int[] effects = new int[]{VibrationEffect.EFFECT_CLICK, VibrationEffect.EFFECT_TICK};
-
- when(mNativeWrapperMock.getSupportedEffects())
- .thenReturn(new int[]{VibrationEffect.EFFECT_CLICK});
- assertArrayEquals(
- new int[]{Vibrator.VIBRATION_EFFECT_SUPPORT_YES,
- Vibrator.VIBRATION_EFFECT_SUPPORT_NO},
- createController().areEffectsSupported(effects));
- }
-
- @Test
- public void arePrimitivesSupported_withoutComposeCapability_returnsAlwaysFalse() {
- assertArrayEquals(new boolean[]{false, false},
- createController().arePrimitivesSupported(new int[]{
- VibrationEffect.Composition.PRIMITIVE_CLICK,
- VibrationEffect.Composition.PRIMITIVE_TICK
- }));
- }
-
- @Test
- public void arePrimitivesSupported_withNullResultFromNative_returnsAlwaysFalse() {
- mockVibratorCapabilities(IVibrator.CAP_COMPOSE_EFFECTS);
- when(mNativeWrapperMock.getSupportedPrimitives()).thenReturn(null);
-
- assertArrayEquals(new boolean[]{false, false},
- createController().arePrimitivesSupported(new int[]{
- VibrationEffect.Composition.PRIMITIVE_CLICK,
- VibrationEffect.Composition.PRIMITIVE_QUICK_RISE
- }));
- }
-
- @Test
- public void arePrimitivesSupported_withSomeSupportedPrimitives_returnsBasedOnNativeResult() {
- mockVibratorCapabilities(IVibrator.CAP_COMPOSE_EFFECTS);
- when(mNativeWrapperMock.getSupportedPrimitives())
- .thenReturn(new int[]{VibrationEffect.Composition.PRIMITIVE_CLICK});
-
- assertArrayEquals(new boolean[]{true, false},
- createController().arePrimitivesSupported(new int[]{
- VibrationEffect.Composition.PRIMITIVE_CLICK,
- VibrationEffect.Composition.PRIMITIVE_QUICK_RISE
- }));
- }
-
- @Test
public void setExternalControl_withCapability_enablesExternalControl() {
mockVibratorCapabilities(IVibrator.CAP_EXTERNAL_CONTROL);
VibratorController controller = createController();
diff --git a/services/tests/servicestests/src/com/android/server/wallpaper/OWNERS b/services/tests/servicestests/src/com/android/server/wallpaper/OWNERS
new file mode 100644
index 0000000..8ff0f74
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/wallpaper/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/wallpaper/OWNERS
diff --git a/services/tests/servicestests/test-apps/JobTestApp/OWNERS b/services/tests/servicestests/test-apps/JobTestApp/OWNERS
new file mode 100644
index 0000000..6f207fb1
--- /dev/null
+++ b/services/tests/servicestests/test-apps/JobTestApp/OWNERS
@@ -0,0 +1 @@
+include /apex/jobscheduler/OWNERS
diff --git a/services/tests/servicestests/test-apps/PackageParserApp/OWNERS b/services/tests/servicestests/test-apps/PackageParserApp/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/tests/servicestests/test-apps/PackageParserApp/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/tests/servicestests/test-apps/PackageParsingTestManifests/OWNERS b/services/tests/servicestests/test-apps/PackageParsingTestManifests/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/services/tests/servicestests/test-apps/PackageParsingTestManifests/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/services/tests/uiservicestests/src/com/android/server/OWNERS b/services/tests/uiservicestests/src/com/android/server/OWNERS
new file mode 100644
index 0000000..05944c0
--- /dev/null
+++ b/services/tests/uiservicestests/src/com/android/server/OWNERS
@@ -0,0 +1 @@
+per-file UiModeManagerServiceTest.java = file:/packages/SystemUI/OWNERS
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java
index 824c05e..18ca09b 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java
@@ -127,6 +127,6 @@
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
"action",
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
+ PendingIntent.FLAG_IMMUTABLE)).build();
}
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java
index a9a3b2b..ac9a77b 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java
@@ -58,10 +58,8 @@
NotificationChannel channel = new NotificationChannel("a", "a", IMPORTANCE_DEFAULT);
final Notification.Builder builder = new Notification.Builder(getContext())
.setContentTitle("foo")
- // TODO(b/174258141) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
.setFullScreenIntent(PendingIntent.getActivity(
- getContext(), 0, new Intent(""), PendingIntent.FLAG_MUTABLE_UNAUDITED),
+ getContext(), 0, new Intent(""), PendingIntent.FLAG_IMMUTABLE),
true)
.setSmallIcon(android.R.drawable.sym_def_app_icon);
@@ -79,10 +77,8 @@
NotificationChannel channel = new NotificationChannel("a", "a", IMPORTANCE_DEFAULT);
final Notification.Builder builder = new Notification.Builder(getContext())
.setContentTitle("foo")
- // TODO(b/174258141) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
.setFullScreenIntent(PendingIntent.getActivity(
- getContext(), 0, new Intent(""), PendingIntent.FLAG_MUTABLE_UNAUDITED),
+ getContext(), 0, new Intent(""), PendingIntent.FLAG_IMMUTABLE),
true)
.setSmallIcon(android.R.drawable.sym_def_app_icon);
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
index c634706..be489c3 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
@@ -357,13 +357,11 @@
private ArrayList<Notification.Action> getSmartActions(String key, int index) {
ArrayList<Notification.Action> actions = new ArrayList<>();
for (int i = 0; i < index; i++) {
- // TODO(b/174935955) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent intent = PendingIntent.getBroadcast(
getContext(),
index /*requestCode*/,
new Intent("ACTION_" + key),
- PendingIntent.FLAG_MUTABLE_UNAUDITED /*flags*/);
+ PendingIntent.FLAG_IMMUTABLE /*flags*/);
actions.add(new Notification.Action.Builder(null /*icon*/, key, intent).build());
}
return actions;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 849477c..45b6bce 100755
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -305,6 +305,8 @@
@Mock
StatusBarManagerInternal mStatusBar;
+ private NotificationManagerService.WorkerHandler mWorkerHandler;
+
// Use a Testable subclass so we can simulate calls from the system without failing.
private static class TestableNotificationManagerService extends NotificationManagerService {
int countSystemChecks = 0;
@@ -482,14 +484,13 @@
when(mAssistants.isAdjustmentAllowed(anyString())).thenReturn(true);
- mService.init(mService.new WorkerHandler(mTestableLooper.getLooper()),
- mRankingHandler, mPackageManager, mPackageManagerClient, mockLightsManager,
- mListeners, mAssistants, mConditionProviders,
- mCompanionMgr, mSnoozeHelper, mUsageStats, mPolicyFile, mActivityManager,
- mGroupHelper, mAm, mAtm, mAppUsageStats,
- mock(DevicePolicyManagerInternal.class), mUgm, mUgmInternal,
- mAppOpsManager, mUm, mHistoryManager, mStatsManager,
- mock(TelephonyManager.class), mAmi, mToastRateLimiter);
+ mWorkerHandler = mService.new WorkerHandler(mTestableLooper.getLooper());
+ mService.init(mWorkerHandler, mRankingHandler, mPackageManager, mPackageManagerClient,
+ mockLightsManager, mListeners, mAssistants, mConditionProviders, mCompanionMgr,
+ mSnoozeHelper, mUsageStats, mPolicyFile, mActivityManager, mGroupHelper, mAm, mAtm,
+ mAppUsageStats, mock(DevicePolicyManagerInternal.class), mUgm, mUgmInternal,
+ mAppOpsManager, mUm, mHistoryManager, mStatsManager, mock(TelephonyManager.class),
+ mAmi, mToastRateLimiter);
mService.onBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY);
mService.setAudioManager(mAudioManager);
@@ -575,6 +576,10 @@
InstrumentationRegistry.getInstrumentation()
.getUiAutomation().dropShellPermissionIdentity();
+ // Remove scheduled messages that would be processed when the test is already done, and
+ // could cause issues, for example, messages that remove/cancel shown toasts (this causes
+ // problematic interactions with mocks when they're no longer working as expected).
+ mWorkerHandler.removeCallbacksAndMessages(null);
}
private void simulatePackageSuspendBroadcast(boolean suspend, String pkg,
@@ -790,10 +795,8 @@
.setName("bubblebot")
.build();
RemoteInput remoteInput = new RemoteInput.Builder("reply_key").setLabel("reply").build();
- // TODO(b/174965245) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent inputIntent = PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
Icon icon = Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
Notification.Action replyAction = new Notification.Action.Builder(icon, "Reply",
inputIntent).addRemoteInput(remoteInput)
@@ -4980,6 +4983,40 @@
}
@Test
+ public void testCustomToastPostedWhileInForeground_blockedIfAppGoesToBackground()
+ throws Exception {
+ final String testPackage = "testPackageName";
+ assertEquals(0, mService.mToastQueue.size());
+ mService.isSystemUid = false;
+ setToastRateIsWithinQuota(true);
+
+ // package is not suspended
+ when(mPackageManager.isPackageSuspendedForUser(testPackage, UserHandle.getUserId(mUid)))
+ .thenReturn(false);
+
+ setAppInForegroundForToasts(mUid, true);
+
+ Binder token1 = new Binder();
+ Binder token2 = new Binder();
+ ITransientNotification callback1 = mock(ITransientNotification.class);
+ ITransientNotification callback2 = mock(ITransientNotification.class);
+ INotificationManager nmService = (INotificationManager) mService.mService;
+
+ nmService.enqueueToast(testPackage, token1, callback1, 2000, 0);
+ nmService.enqueueToast(testPackage, token2, callback2, 2000, 0);
+
+ assertEquals(2, mService.mToastQueue.size()); // Both toasts enqueued.
+ verify(callback1, times(1)).show(any()); // First toast shown.
+
+ setAppInForegroundForToasts(mUid, false);
+
+ mService.cancelToastLocked(0); // Remove the first toast, and show next.
+
+ assertEquals(0, mService.mToastQueue.size()); // Both toasts processed.
+ verify(callback2, never()).show(any()); // Second toast was never shown.
+ }
+
+ @Test
public void testAllowForegroundTextToasts() throws Exception {
final String testPackage = "testPackageName";
assertEquals(0, mService.mToastQueue.size());
@@ -7369,10 +7406,8 @@
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
ArrayList<Notification.Action> extraAction = new ArrayList<>();
RemoteInput remoteInput = new RemoteInput.Builder("reply_key").setLabel("reply").build();
- // TODO(b/174965245) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent inputIntent = PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_IMMUTABLE);
Icon icon = Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
Notification.Action replyAction = new Notification.Action.Builder(icon, "Reply",
inputIntent).addRemoteInput(remoteInput)
@@ -7402,10 +7437,8 @@
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
ArrayList<Notification.Action> extraAction = new ArrayList<>();
RemoteInput remoteInput = new RemoteInput.Builder("reply_key").setLabel("reply").build();
- // TODO(b/174965245) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent inputIntent = PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
Icon icon = Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
Notification.Action replyAction = new Notification.Action.Builder(icon, "Reply",
inputIntent).addRemoteInput(remoteInput)
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/OWNERS b/services/tests/uiservicestests/src/com/android/server/notification/OWNERS
new file mode 100644
index 0000000..396fd12
--- /dev/null
+++ b/services/tests/uiservicestests/src/com/android/server/notification/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/notification/OWNERS
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/OWNERS b/services/tests/uiservicestests/src/com/android/server/slice/OWNERS
new file mode 100644
index 0000000..3d0859f
--- /dev/null
+++ b/services/tests/uiservicestests/src/com/android/server/slice/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/app/slice/OWNERS
diff --git a/services/tests/wmtests/Android.bp b/services/tests/wmtests/Android.bp
index 4ca5b9e..1ecf850 100644
--- a/services/tests/wmtests/Android.bp
+++ b/services/tests/wmtests/Android.bp
@@ -47,7 +47,6 @@
"testables",
"ub-uiautomator",
"hamcrest-library",
- "compatibility-device-util-axt",
],
libs: [
diff --git a/services/tests/wmtests/OWNERS b/services/tests/wmtests/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/services/tests/wmtests/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
index 99bd0d7..466b861 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
@@ -248,7 +248,7 @@
int topPosition = taskDisplayArea.getRootTaskCount() - 1;
// Ensure the new alwaysOnTop stack is put below the pinned stack, but on top of the
// existing alwaysOnTop stack.
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 1));
+ assertEquals(topPosition - 1, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
final Task nonAlwaysOnTopStack = taskDisplayArea.createRootTask(
WINDOWING_MODE_FREEFORM, ACTIVITY_TYPE_STANDARD, true /* onTop */);
@@ -256,7 +256,7 @@
topPosition = taskDisplayArea.getRootTaskCount() - 1;
// Ensure the non-alwaysOnTop stack is put below the three alwaysOnTop stacks, but above the
// existing other non-alwaysOnTop stacks.
- assertEquals(nonAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 3));
+ assertEquals(topPosition - 3, taskDisplayArea.getIndexOf(nonAlwaysOnTopStack));
anotherAlwaysOnTopStack.setAlwaysOnTop(false);
taskDisplayArea.positionChildAt(POSITION_TOP, anotherAlwaysOnTopStack,
@@ -264,16 +264,16 @@
assertFalse(anotherAlwaysOnTopStack.isAlwaysOnTop());
// Ensure, when always on top is turned off for a stack, the stack is put just below all
// other always on top stacks.
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 2));
+ assertEquals(topPosition - 2, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
anotherAlwaysOnTopStack.setAlwaysOnTop(true);
// Ensure always on top state changes properly when windowing mode changes.
anotherAlwaysOnTopStack.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
assertFalse(anotherAlwaysOnTopStack.isAlwaysOnTop());
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 2));
+ assertEquals(topPosition - 2, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
anotherAlwaysOnTopStack.setWindowingMode(WINDOWING_MODE_FREEFORM);
assertTrue(anotherAlwaysOnTopStack.isAlwaysOnTop());
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 1));
+ assertEquals(topPosition - 1, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
final Task dreamStack = taskDisplayArea.createRootTask(
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_DREAM, true /* onTop */);
@@ -282,7 +282,7 @@
topPosition = taskDisplayArea.getRootTaskCount() - 1;
// Ensure dream shows above all activities, including PiP
assertEquals(dreamStack, taskDisplayArea.getTopRootTask());
- assertEquals(pinnedStack, taskDisplayArea.getRootTaskAt(topPosition - 1));
+ assertEquals(topPosition - 1, taskDisplayArea.getIndexOf(pinnedStack));
final Task assistStack = taskDisplayArea.createRootTask(
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_ASSISTANT, true /* onTop */);
@@ -294,8 +294,8 @@
// is false and on top of everything when true.
final boolean isAssistantOnTop = mContext.getResources()
.getBoolean(com.android.internal.R.bool.config_assistantOnTopOfDream);
- assertEquals(assistStack, taskDisplayArea.getRootTaskAt(
- isAssistantOnTop ? topPosition : topPosition - 4));
+ assertEquals(isAssistantOnTop ? topPosition : topPosition - 4,
+ taskDisplayArea.getIndexOf(assistStack));
}
@Test
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index 2f34f70..78cebf3 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -1051,7 +1051,7 @@
final ActivityRecord nextTop = nextStack.getTopNonFinishingActivity();
nextTop.setState(STOPPED, "test");
- task.mPausingActivity = currentTop;
+ task.setPausingActivity(currentTop);
currentTop.finishing = true;
currentTop.setState(PAUSED, "test");
currentTop.completeFinishing("completePauseLocked");
@@ -1211,7 +1211,7 @@
focusedActivity.nowVisible = true;
focusedActivity.mVisibleRequested = true;
focusedActivity.setState(RESUMED, "test");
- stack.mResumedActivity = focusedActivity;
+ stack.setResumedActivity(focusedActivity, "test");
topActivity.completeFinishing("test");
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
index 8e3e668..5504460 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
@@ -1014,7 +1014,7 @@
final ActivityRecord secondActivity = new ActivityBuilder(mAtm).setTask(task).build();
firstActivity.setState(STOPPED, "testFinishDisabledPackageActivities");
secondActivity.setState(RESUMED, "testFinishDisabledPackageActivities");
- task.mResumedActivity = secondActivity;
+ task.setResumedActivity(secondActivity, "test");
// Note the activities have non-null ActivityRecord.app, so it won't remove directly.
mRootWindowContainer.mFinishDisabledPackageActivitiesHelper.process(
@@ -1140,8 +1140,8 @@
final Task task = new TaskBuilder(mSupervisor).build();
final ActivityRecord bottomActivity = new ActivityBuilder(mAtm).setTask(task).build();
doReturn(true).when(bottomActivity).attachedToProcess();
- task.mPausingActivity = null;
- task.mResumedActivity = bottomActivity;
+ task.setPausingActivity(null);
+ task.setResumedActivity(bottomActivity, "test");
final ActivityRecord topActivity = new ActivityBuilder(mAtm).setTask(task).build();
topActivity.info.flags |= FLAG_RESUME_WHILE_PAUSING;
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
index ef2e889..5695412 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
@@ -512,11 +512,8 @@
}
private void assertNoTasks(DisplayContent display) {
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- assertFalse(stack.hasChild());
- }
+ display.forAllRootTasks(stack -> {
+ assertFalse(stack.hasChild());
});
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
index 080f04ef..d34e2c4 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
@@ -247,7 +247,7 @@
activity.finishing = true;
activity.mVisibleRequested = false;
activity.setVisible(false);
- activity.getRootTask().mPausingActivity = activity;
+ activity.getTask().setPausingActivity(activity);
homeActivity.setState(Task.ActivityState.PAUSED, "test");
// Even the visibility states are invisible, the next activity should be resumed because
@@ -262,8 +262,8 @@
public void testUpdateSleep() {
doCallRealMethod().when(mWm.mRoot).hasAwakeDisplay();
mSupervisor.mGoingToSleepWakeLock = mock(PowerManager.WakeLock.class);
- final ActivityRecord homeActivity = new ActivityBuilder(mAtm)
- .setTask(mWm.mRoot.getDefaultTaskDisplayArea().getOrCreateRootHomeTask()).build();
+ final Task rootHomeTask = mWm.mRoot.getDefaultTaskDisplayArea().getOrCreateRootHomeTask();
+ final ActivityRecord homeActivity = new ActivityBuilder(mAtm).setTask(rootHomeTask).build();
final ActivityRecord topActivity = new ActivityBuilder(mAtm).setCreateTask(true).build();
topActivity.setState(Task.ActivityState.RESUMED, "test");
@@ -277,6 +277,9 @@
// Sleep all displays.
mWm.mRoot.forAllDisplays(display -> doReturn(true).when(display).shouldSleep());
mAtm.updateSleepIfNeededLocked();
+ // Simulate holding sleep wake lock if it is acquired.
+ verify(mSupervisor.mGoingToSleepWakeLock).acquire();
+ doReturn(true).when(mSupervisor.mGoingToSleepWakeLock).isHeld();
assertEquals(Task.ActivityState.PAUSING, topActivity.getState());
assertTrue(mAtm.mInternal.isSleeping());
@@ -285,8 +288,17 @@
// The top app should not change while sleeping.
assertEquals(topActivity.app, mAtm.mInternal.getTopApp());
+ // If all activities are stopped, the sleep wake lock must be released.
+ final Task topRootTask = topActivity.getRootTask();
+ doReturn(true).when(rootHomeTask).goToSleepIfPossible(anyBoolean());
+ doReturn(true).when(topRootTask).goToSleepIfPossible(anyBoolean());
+ topActivity.setState(Task.ActivityState.STOPPING, "test");
+ topActivity.activityStopped(null /* newIcicle */, null /* newPersistentState */,
+ null /* description */);
+ verify(mSupervisor.mGoingToSleepWakeLock).release();
+
// Move the current top to back, the top app should update to the next activity.
- topActivity.getRootTask().moveToBack("test", null /* self */);
+ topRootTask.moveToBack("test", null /* self */);
assertEquals(homeActivity.app, mAtm.mInternal.getTopApp());
// Wake all displays.
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
index 8cad56a..295c50b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
@@ -20,7 +20,7 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_OLD_ACTIVITY_OPEN;
import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE;
@@ -111,7 +111,7 @@
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD);
translucentOpening.setOccludesParent(false);
translucentOpening.setVisible(false);
- mDisplayContent.prepareAppTransition(TRANSIT_CHANGE_WINDOWING_MODE);
+ mDisplayContent.prepareAppTransition(TRANSIT_CHANGE);
mDisplayContent.mOpeningApps.add(behind);
mDisplayContent.mOpeningApps.add(translucentOpening);
assertEquals(TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE,
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyBuilderTest.java b/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyBuilderTest.java
index e47913f..8e78dce 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyBuilderTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyBuilderTest.java
@@ -40,6 +40,7 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertThrows;
@@ -100,6 +101,7 @@
mRoot = new SurfacelessDisplayAreaRoot(mWms);
mImeContainer = new DisplayArea.Tokens(mWms, ABOVE_TASKS, "ImeContainer");
mDisplayContent = mock(DisplayContent.class);
+ doReturn(true).when(mDisplayContent).isTrusted();
mDefaultTaskDisplayArea = new TaskDisplayArea(mDisplayContent, mWms, "Tasks",
FEATURE_DEFAULT_TASK_CONTAINER);
mTaskDisplayAreaList = new ArrayList<>();
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyTests.java
index 496b2b7..d451180 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayAreaPolicyTests.java
@@ -22,15 +22,18 @@
import static android.window.DisplayAreaOrganizer.FEATURE_VENDOR_FIRST;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
-import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.server.wm.DisplayArea.Type.ABOVE_TASKS;
import static com.android.server.wm.WindowContainer.POSITION_BOTTOM;
import static com.android.server.wm.WindowContainer.POSITION_TOP;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import android.platform.test.annotations.Presubmit;
+import android.util.Pair;
+import android.view.Display;
+import android.view.DisplayInfo;
import androidx.test.filters.SmallTest;
@@ -38,9 +41,8 @@
import com.google.android.collect.Lists;
-import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
+import org.junit.runner.RunWith;
import java.util.ArrayList;
import java.util.Collections;
@@ -54,78 +56,65 @@
*/
@SmallTest
@Presubmit
-public class DisplayAreaPolicyTests {
-
- @Rule
- public final SystemServicesTestRule mSystemServices = new SystemServicesTestRule();
-
- private DisplayAreaPolicyBuilder.Result mPolicy;
- private TaskDisplayArea mTaskDisplayArea1;
- private TaskDisplayArea mTaskDisplayArea2;
- private RootDisplayArea mRoot;
-
- @Before
- public void setUp() throws Exception {
- WindowManagerService wms = mSystemServices.getWindowManagerService();
- mRoot = new SurfacelessDisplayAreaRoot(wms);
- spyOn(mRoot);
- DisplayArea.Tokens ime = new DisplayArea.Tokens(wms, ABOVE_TASKS, "Ime");
- DisplayContent displayContent = mock(DisplayContent.class);
- doReturn(true).when(displayContent).isTrusted();
- mTaskDisplayArea1 = new TaskDisplayArea(displayContent, wms, "Tasks1",
- FEATURE_DEFAULT_TASK_CONTAINER);
- mTaskDisplayArea2 = new TaskDisplayArea(displayContent, wms, "Tasks2",
- FEATURE_VENDOR_FIRST);
- List<TaskDisplayArea> taskDisplayAreaList = new ArrayList<>();
- taskDisplayAreaList.add(mTaskDisplayArea1);
- taskDisplayAreaList.add(mTaskDisplayArea2);
-
- mPolicy = new DisplayAreaPolicyBuilder()
- .setRootHierarchy(new DisplayAreaPolicyBuilder.HierarchyBuilder(mRoot)
- .setImeContainer(ime)
- .setTaskDisplayAreas(taskDisplayAreaList))
- .build(wms);
- }
+@RunWith(WindowTestRunner.class)
+public class DisplayAreaPolicyTests extends WindowTestsBase {
@Test
public void testGetDefaultTaskDisplayArea() {
- assertEquals(mTaskDisplayArea1, mPolicy.getDefaultTaskDisplayArea());
+ final Pair<DisplayAreaPolicy, List<TaskDisplayArea>> result =
+ createPolicyWith2TaskDisplayAreas();
+ final DisplayAreaPolicy policy = result.first;
+ final TaskDisplayArea taskDisplayArea1 = result.second.get(0);
+ assertEquals(taskDisplayArea1, policy.getDefaultTaskDisplayArea());
}
@Test
public void testTaskDisplayArea_taskPositionChanged_updatesTaskDisplayAreaPosition() {
- final Task stack1 = mTaskDisplayArea1.createRootTask(
+ final Pair<DisplayAreaPolicy, List<TaskDisplayArea>> result =
+ createPolicyWith2TaskDisplayAreas();
+ final DisplayAreaPolicy policy = result.first;
+ final TaskDisplayArea taskDisplayArea1 = result.second.get(0);
+ final TaskDisplayArea taskDisplayArea2 = result.second.get(1);
+ final Task stack1 = taskDisplayArea1.createRootTask(
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD, true /* onTop */);
- final Task stack2 = mTaskDisplayArea2.createRootTask(
+ final Task stack2 = taskDisplayArea2.createRootTask(
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD, true /* onTop */);
// Initial order
- assertTaskDisplayAreasOrder(mPolicy, mTaskDisplayArea1, mTaskDisplayArea2);
+ assertTaskDisplayAreasOrder(policy, taskDisplayArea1, taskDisplayArea2);
// Move stack in tda1 to top
stack1.getParent().positionChildAt(POSITION_TOP, stack1, true /* includingParents */);
- assertTaskDisplayAreasOrder(mPolicy, mTaskDisplayArea2, mTaskDisplayArea1);
+ assertTaskDisplayAreasOrder(policy, taskDisplayArea2, taskDisplayArea1);
// Move stack in tda2 to top, but not including parents
stack2.getParent().positionChildAt(POSITION_TOP, stack2, false /* includingParents */);
- assertTaskDisplayAreasOrder(mPolicy, mTaskDisplayArea2, mTaskDisplayArea1);
+ assertTaskDisplayAreasOrder(policy, taskDisplayArea2, taskDisplayArea1);
// Move stack in tda1 to bottom
stack1.getParent().positionChildAt(POSITION_BOTTOM, stack1, true /* includingParents */);
- assertTaskDisplayAreasOrder(mPolicy, mTaskDisplayArea1, mTaskDisplayArea2);
+ assertTaskDisplayAreasOrder(policy, taskDisplayArea1, taskDisplayArea2);
// Move stack in tda2 to bottom, but not including parents
stack2.getParent().positionChildAt(POSITION_BOTTOM, stack2, false /* includingParents */);
- assertTaskDisplayAreasOrder(mPolicy, mTaskDisplayArea1, mTaskDisplayArea2);
+ assertTaskDisplayAreasOrder(policy, taskDisplayArea1, taskDisplayArea2);
+ }
+
+ @Test
+ public void testEmptyFeaturesOnUntrustedDisplay() {
+ final DisplayInfo info = new DisplayInfo(mDisplayInfo);
+ info.flags &= ~Display.FLAG_TRUSTED;
+ final DisplayContent untrustedDisplay = new TestDisplayContent.Builder(mAtm, info).build();
+ assertTrue(untrustedDisplay.mFeatures.isEmpty());
}
@Test
public void testDisplayAreaGroup_taskPositionChanged_updatesDisplayAreaGroupPosition() {
- final WindowManagerService wms = mSystemServices.getWindowManagerService();
+ final WindowManagerService wms = mWm;
final DisplayContent displayContent = mock(DisplayContent.class);
doReturn(true).when(displayContent).isTrusted();
final RootDisplayArea root = new SurfacelessDisplayAreaRoot(wms);
@@ -203,4 +192,24 @@
}, false /* traverseTopToBottom */);
assertEquals(expectOrder, actualOrder);
}
+
+ private Pair<DisplayAreaPolicy, List<TaskDisplayArea>> createPolicyWith2TaskDisplayAreas() {
+ final SurfacelessDisplayAreaRoot root = new SurfacelessDisplayAreaRoot(mWm);
+ final DisplayArea.Tokens ime = new DisplayArea.Tokens(mWm, ABOVE_TASKS, "Ime");
+ final DisplayContent displayContent = mock(DisplayContent.class);
+ doReturn(true).when(displayContent).isTrusted();
+ final TaskDisplayArea taskDisplayArea1 = new TaskDisplayArea(displayContent, mWm, "Tasks1",
+ FEATURE_DEFAULT_TASK_CONTAINER);
+ final TaskDisplayArea taskDisplayArea2 = new TaskDisplayArea(displayContent, mWm, "Tasks2",
+ FEATURE_VENDOR_FIRST);
+ final List<TaskDisplayArea> taskDisplayAreaList = new ArrayList<>();
+ taskDisplayAreaList.add(taskDisplayArea1);
+ taskDisplayAreaList.add(taskDisplayArea2);
+
+ return Pair.create(new DisplayAreaPolicyBuilder()
+ .setRootHierarchy(new DisplayAreaPolicyBuilder.HierarchyBuilder(root)
+ .setImeContainer(ime)
+ .setTaskDisplayAreas(taskDisplayAreaList))
+ .build(mWm), taskDisplayAreaList);
+ }
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
index 2053bfb..b451d9f 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
@@ -62,6 +62,8 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.times;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_FIXED_TRANSFORM;
import static com.android.server.wm.WindowContainer.POSITION_TOP;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
@@ -168,7 +170,7 @@
final WindowState imeAppTarget =
createWindow(null, TYPE_BASE_APPLICATION, mDisplayContent, "imeAppTarget");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -187,7 +189,7 @@
@UseTestDisplay(addAllCommonWindows = true)
@Test
public void testForAllWindows_WithChildWindowImeTarget() throws Exception {
- mDisplayContent.mInputMethodTarget = mChildAppWindowAbove;
+ mDisplayContent.setImeLayeringTarget(mChildAppWindowAbove);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -205,7 +207,7 @@
@UseTestDisplay(addAllCommonWindows = true)
@Test
public void testForAllWindows_WithStatusBarImeTarget() throws Exception {
- mDisplayContent.mInputMethodTarget = mStatusBarWindow;
+ mDisplayContent.setImeLayeringTarget(mStatusBarWindow);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -223,7 +225,7 @@
@UseTestDisplay(addAllCommonWindows = true)
@Test
public void testForAllWindows_WithNotificationShadeImeTarget() throws Exception {
- mDisplayContent.mInputMethodTarget = mNotificationShadeWindow;
+ mDisplayContent.setImeLayeringTarget(mNotificationShadeWindow);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -855,15 +857,17 @@
mDisplayContent.setInputMethodWindowLocked(mImeWindow);
newDisplay.setInputMethodWindowLocked(null);
assertEquals("appWin should be IME target window",
- appWin, mDisplayContent.mInputMethodTarget);
- assertNull("newDisplay Ime target: ", newDisplay.mInputMethodTarget);
+ appWin, mDisplayContent.getImeTarget(IME_TARGET_LAYERING));
+ assertNull("newDisplay Ime target: ", newDisplay.getImeTarget(IME_TARGET_LAYERING));
// Switch input method window on new display & make sure the input method target also
// switched as expected.
newDisplay.setInputMethodWindowLocked(mImeWindow);
mDisplayContent.setInputMethodWindowLocked(null);
- assertEquals("appWin1 should be IME target window", appWin1, newDisplay.mInputMethodTarget);
- assertNull("default display Ime target: ", mDisplayContent.mInputMethodTarget);
+ assertEquals("appWin1 should be IME target window", appWin1,
+ newDisplay.getImeTarget(IME_TARGET_LAYERING));
+ assertNull("default display Ime target: ",
+ mDisplayContent.getImeTarget(IME_TARGET_LAYERING));
}
@Test
@@ -937,17 +941,17 @@
@Test
public void testComputeImeParent_app() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodTarget = createWindow(null, TYPE_BASE_APPLICATION, "app");
- dc.mInputMethodInputTarget = dc.mInputMethodTarget;
- assertEquals(dc.mInputMethodTarget.mActivityRecord.getSurfaceControl(),
- dc.computeImeParent());
+ dc.setImeLayeringTarget(createWindow(null, TYPE_BASE_APPLICATION, "app"));
+ dc.setImeInputTarget(dc.getImeTarget(IME_TARGET_LAYERING).getWindow());
+ assertEquals(dc.getImeTarget(IME_TARGET_LAYERING).getWindow()
+ .mActivityRecord.getSurfaceControl(), dc.computeImeParent());
}
@Test
public void testComputeImeParent_app_notFullscreen() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodTarget = createWindow(null, TYPE_STATUS_BAR, "app");
- dc.mInputMethodTarget.setWindowingMode(
+ dc.setImeLayeringTarget(createWindow(null, TYPE_STATUS_BAR, "app"));
+ dc.getImeTarget(IME_TARGET_LAYERING).getWindow().setWindowingMode(
WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
assertEquals(dc.getImeContainer().getParentSurfaceControl(), dc.computeImeParent());
}
@@ -957,7 +961,7 @@
public void testComputeImeParent_app_notMatchParentBounds() {
spyOn(mAppWindow.mActivityRecord);
doReturn(false).when(mAppWindow.mActivityRecord).matchParentBounds();
- mDisplayContent.mInputMethodTarget = mAppWindow;
+ mDisplayContent.setImeLayeringTarget(mAppWindow);
// The surface parent of IME should be the display instead of app window.
assertEquals(mDisplayContent.getImeContainer().getParentSurfaceControl(),
mDisplayContent.computeImeParent());
@@ -966,7 +970,7 @@
@Test
public void testComputeImeParent_noApp() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodTarget = createWindow(null, TYPE_STATUS_BAR, "statusBar");
+ dc.setImeLayeringTarget(createWindow(null, TYPE_STATUS_BAR, "statusBar"));
assertEquals(dc.getImeContainer().getParentSurfaceControl(), dc.computeImeParent());
}
@@ -976,12 +980,12 @@
WindowState app = createWindow(null, TYPE_BASE_APPLICATION, dc, "app");
- dc.mInputMethodInputTarget = app;
+ dc.setImeInputTarget(app);
assertEquals(app, dc.computeImeControlTarget());
app.removeImmediately();
- assertNull(dc.mInputMethodInputTarget);
+ assertNull(dc.getImeTarget(IME_TARGET_INPUT));
assertNull(dc.computeImeControlTarget());
}
@@ -989,20 +993,21 @@
public void testComputeImeControlTarget() throws Exception {
final DisplayContent dc = createNewDisplay();
dc.setRemoteInsetsController(createDisplayWindowInsetsController());
- dc.mInputMethodInputTarget = createWindow(null, TYPE_BASE_APPLICATION, "app");
- dc.mInputMethodTarget = dc.mInputMethodInputTarget;
- assertEquals(dc.mInputMethodInputTarget, dc.computeImeControlTarget());
+ dc.setImeInputTarget(createWindow(null, TYPE_BASE_APPLICATION, "app"));
+ dc.setImeLayeringTarget(dc.getImeTarget(IME_TARGET_INPUT).getWindow());
+ assertEquals(dc.getImeTarget(IME_TARGET_INPUT).getWindow(), dc.computeImeControlTarget());
}
@Test
public void testComputeImeControlTarget_splitscreen() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodInputTarget = createWindow(null, TYPE_BASE_APPLICATION, "app");
- dc.mInputMethodInputTarget.setWindowingMode(
+ dc.setImeInputTarget(createWindow(null, TYPE_BASE_APPLICATION, "app"));
+ dc.getImeTarget(IME_TARGET_INPUT).getWindow().setWindowingMode(
WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
- dc.mInputMethodTarget = dc.mInputMethodInputTarget;
+ dc.setImeLayeringTarget(dc.getImeTarget(IME_TARGET_INPUT).getWindow());
dc.setRemoteInsetsController(createDisplayWindowInsetsController());
- assertNotEquals(dc.mInputMethodInputTarget, dc.computeImeControlTarget());
+ assertNotEquals(dc.getImeTarget(IME_TARGET_INPUT).getWindow(),
+ dc.computeImeControlTarget());
}
@UseTestDisplay(addWindows = W_ACTIVITY)
@@ -1010,8 +1015,9 @@
public void testComputeImeControlTarget_notMatchParentBounds() throws Exception {
spyOn(mAppWindow.mActivityRecord);
doReturn(false).when(mAppWindow.mActivityRecord).matchParentBounds();
- mDisplayContent.mInputMethodInputTarget = mAppWindow;
- mDisplayContent.mInputMethodTarget = mDisplayContent.mInputMethodInputTarget;
+ mDisplayContent.setImeInputTarget(mAppWindow);
+ mDisplayContent.setImeLayeringTarget(
+ mDisplayContent.getImeTarget(IME_TARGET_INPUT).getWindow());
mDisplayContent.setRemoteInsetsController(createDisplayWindowInsetsController());
assertEquals(mAppWindow, mDisplayContent.computeImeControlTarget());
}
@@ -1637,7 +1643,7 @@
TYPE_BASE_APPLICATION, "nextImeTargetApp");
spyOn(child1);
doReturn(true).when(child1).inSplitScreenWindowingMode();
- mDisplayContent.mInputMethodTarget = child1;
+ mDisplayContent.setImeLayeringTarget(child1);
spyOn(nextImeTargetApp);
spyOn(mAppWindow);
@@ -1648,7 +1654,7 @@
child1.removeImmediately();
verify(mDisplayContent).computeImeTarget(true);
- assertNull(mDisplayContent.mInputMethodInputTarget);
+ assertNull(mDisplayContent.getImeTarget(IME_TARGET_INPUT));
verify(child1, never()).needsRelativeLayeringToIme();
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java b/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java
index 59d195b..5f96267 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java
@@ -52,19 +52,19 @@
public void testTransparentControlTargetWindowCanShowIme() {
final WindowState appWin = createWindow(null, TYPE_APPLICATION, "app");
final WindowState popup = createWindow(appWin, TYPE_APPLICATION, "popup");
- mDisplayContent.mInputMethodControlTarget = popup;
- mDisplayContent.mInputMethodTarget = appWin;
+ mDisplayContent.setImeControlTarget(popup);
+ mDisplayContent.setImeLayeringTarget(appWin);
popup.mAttrs.format = PixelFormat.TRANSPARENT;
mImeProvider.scheduleShowImePostLayout(appWin);
- assertTrue(mImeProvider.isImeTargetFromDisplayContentAndImeSame());
+ assertTrue(mImeProvider.isReadyToShowIme());
}
@Test
public void testInputMethodInputTargetCanShowIme() {
WindowState target = createWindow(null, TYPE_APPLICATION, "app");
- mDisplayContent.mInputMethodTarget = target;
+ mDisplayContent.setImeLayeringTarget(target);
mImeProvider.scheduleShowImePostLayout(target);
- assertTrue(mImeProvider.isImeTargetFromDisplayContentAndImeSame());
+ assertTrue(mImeProvider.isReadyToShowIme());
}
@Test
@@ -74,8 +74,8 @@
mImeProvider.setWindow(ime, null, null);
WindowState target = createWindow(null, TYPE_APPLICATION, "app");
- mDisplayContent.mInputMethodTarget = target;
- mDisplayContent.mInputMethodControlTarget = target;
+ mDisplayContent.setImeLayeringTarget(target);
+ mDisplayContent.setImeControlTarget(target);
mImeProvider.scheduleShowImePostLayout(target);
assertFalse(mImeProvider.isImeShowing());
diff --git a/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java
index 90caf35..2766438 100644
--- a/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java
@@ -31,6 +31,7 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -181,16 +182,18 @@
// This can be the IME z-order target while app cannot be the IME z-order target.
// This is also the only IME control target in this test, so IME won't be invisible caused
// by the control-target change.
- mDisplayContent.mInputMethodInputTarget = createWindow(null, TYPE_APPLICATION, "base");
+ mDisplayContent.updateImeInputAndControlTarget(
+ createWindow(null, TYPE_APPLICATION, "base"));
// Make IME and stay visible during the test.
mImeWindow.setHasSurface(true);
getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
- getController().onImeControlTargetChanged(mDisplayContent.mInputMethodInputTarget);
+ getController().onImeControlTargetChanged(mDisplayContent.getImeTarget(IME_TARGET_INPUT));
final InsetsState requestedState = new InsetsState();
requestedState.getSource(ITYPE_IME).setVisible(true);
- mDisplayContent.mInputMethodInputTarget.updateRequestedVisibility(requestedState);
- getController().onInsetsModified(mDisplayContent.mInputMethodInputTarget);
+ mDisplayContent.getImeTarget(IME_TARGET_INPUT).getWindow()
+ .updateRequestedVisibility(requestedState);
+ getController().onInsetsModified(mDisplayContent.getImeTarget(IME_TARGET_INPUT));
// Send our spy window (app) into the system so that we can detect the invocation.
final WindowState win = createWindow(null, TYPE_APPLICATION, "app");
diff --git a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
index 9af2b96..171aa76 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
@@ -91,10 +91,9 @@
@Test
public void testAllPausedActivitiesComplete() {
DisplayContent displayContent = mWm.mRoot.getDisplayContent(DEFAULT_DISPLAY);
- TaskDisplayArea taskDisplayArea = displayContent.getDefaultTaskDisplayArea();
- Task stack = taskDisplayArea.getRootTaskAt(0);
ActivityRecord activity = createActivityRecord(displayContent);
- stack.mPausingActivity = activity;
+ Task task = activity.getTask();
+ task.setPausingActivity(activity);
activity.setState(PAUSING, "test PAUSING");
assertThat(mWm.mRoot.allPausedActivitiesComplete()).isFalse();
diff --git a/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java b/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java
index 6821d47..e2be39b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java
@@ -34,6 +34,7 @@
import org.junit.runner.RunWith;
import java.util.ArrayList;
+import java.util.List;
/**
* Build/Install/Run:
@@ -70,9 +71,12 @@
final int numTasks = 10;
int activeTime = 0;
+ final List<Task> rootTasks = new ArrayList<>();
+ display.getDefaultTaskDisplayArea().forAllRootTasks(task -> {
+ rootTasks.add(task);
+ }, false /* traverseTopToBottom */);
for (int i = 0; i < numTasks; i++) {
- createTask(display.getDefaultTaskDisplayArea().getRootTaskAt(i % numStacks),
- ".Task" + i, i, activeTime++, null);
+ createTask(rootTasks.get(i % numStacks), ".Task" + i, i, activeTime++, null);
}
// Ensure that the latest tasks were returned in order of decreasing last active time,
diff --git a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
index dd6e490..c7175a0c 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
@@ -30,6 +30,7 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.never;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.Task.ActivityState.STOPPED;
import static org.junit.Assert.assertEquals;
@@ -270,7 +271,7 @@
// The position should be horizontal centered.
assertEquals((displayWidth - bounds.width()) / 2, bounds.left);
- mActivity.mDisplayContent.mInputMethodTarget = addWindowToActivity(mActivity);
+ mActivity.mDisplayContent.setImeLayeringTarget(addWindowToActivity(mActivity));
// Make sure IME cannot attach to the app, otherwise IME window will also be shifted.
assertFalse(mActivity.mDisplayContent.isImeAttachedToApp());
@@ -290,9 +291,9 @@
assertFitted();
rotateDisplay(mActivity.mDisplayContent, ROTATION_90);
- mActivity.mDisplayContent.mInputMethodTarget = addWindowToActivity(mActivity);
- mActivity.mDisplayContent.mInputMethodInputTarget =
- mActivity.mDisplayContent.mInputMethodTarget;
+ mActivity.mDisplayContent.setImeLayeringTarget(addWindowToActivity(mActivity));
+ mActivity.mDisplayContent.setImeInputTarget(
+ mActivity.mDisplayContent.getImeTarget(IME_TARGET_LAYERING).getWindow());
// Because the aspect ratio of display doesn't exceed the max aspect ratio of activity.
// The activity should still fill its parent container and IME can attach to the activity.
assertTrue(mActivity.matchParentBounds());
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java
index 0bb2867..ec65085 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java
@@ -30,6 +30,8 @@
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.when;
import android.app.ActivityManager;
import android.app.WindowConfiguration;
@@ -183,6 +185,24 @@
}
}
+ @UseTestDisplay(addWindows = {W_ACTIVITY, W_INPUT_METHOD})
+ @Test
+ public void testCreateTaskSnapshotWithExcludingIme() {
+ Task task = mAppWindow.mActivityRecord.getTask();
+ spyOn(task);
+ spyOn(mDisplayContent);
+ when(task.getDisplayContent().isImeAttachedToApp()).thenReturn(false);
+ // Intentionally set the SurfaceControl of input method window as null.
+ mDisplayContent.mInputMethodWindow.setSurfaceControl(null);
+ // Verify no NPE happens when calling createTaskSnapshot.
+ try {
+ mWm.mTaskSnapshotController.createTaskSnapshot(mAppWindow.mActivityRecord.getTask(),
+ 1f /* scaleFraction */, PixelFormat.UNKNOWN, null /* outTaskSize */);
+ } catch (NullPointerException e) {
+ fail("There should be no exception when calling createTaskSnapshot");
+ }
+ }
+
@UseTestDisplay(addWindows = W_ACTIVITY)
@Test
public void testPrepareTaskSnapshot() {
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
index 788ef5a..6046c9b2 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
@@ -20,20 +20,19 @@
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+import static com.android.server.wm.utils.CommonUtils.runWithShellPermissionIdentity;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import android.app.Activity;
-import android.app.ActivityManager;
import android.app.ActivityManager.TaskDescription;
import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
import android.app.ActivityView;
-import android.app.IActivityManager;
import android.app.ITaskStackListener;
-import android.app.Instrumentation;
import android.app.Instrumentation.ActivityMonitor;
import android.app.TaskStackListener;
import android.content.ComponentName;
@@ -44,7 +43,6 @@
import android.os.RemoteException;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
-import android.support.test.uiautomator.UiDevice;
import android.text.TextUtils;
import android.view.Display;
import android.view.ViewGroup;
@@ -52,10 +50,7 @@
import androidx.test.filters.FlakyTest;
import androidx.test.filters.MediumTest;
-import com.android.compatibility.common.util.SystemUtil;
-
import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.ArrayBlockingQueue;
@@ -70,17 +65,11 @@
@MediumTest
public class TaskStackChangedListenerTest {
- private IActivityManager mService;
private ITaskStackListener mTaskStackListener;
private static final int WAIT_TIMEOUT_MS = 5000;
private static final Object sLock = new Object();
- @Before
- public void setUp() throws Exception {
- mService = ActivityManager.getService();
- }
-
@After
public void tearDown() throws Exception {
ActivityTaskManager.getService().unregisterTaskStackListener(mTaskStackListener);
@@ -374,7 +363,7 @@
final ActivityMonitor monitor = new ActivityMonitor(activityClass.getName(), null, false);
getInstrumentation().addMonitor(monitor);
final Context context = getInstrumentation().getContext();
- SystemUtil.runWithShellPermissionIdentity(() -> context.startActivity(
+ runWithShellPermissionIdentity(() -> context.startActivity(
new Intent(context, activityClass).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
options.toBundle()));
final TestActivity activity =
diff --git a/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java
index eb5f1f9..ccf2394 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java
@@ -372,6 +372,11 @@
}
@Override
+ public int applyKeyguardOcclusionChange() {
+ return 0;
+ }
+
+ @Override
public void setPipVisibilityLw(boolean visible) {
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
index 4909b1d..00c2aa5 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
@@ -20,8 +20,8 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.WindowManager.TRANSIT_OLD_TASK_OPEN;
-import static android.window.TransitionInfo.TRANSIT_HIDE;
-import static android.window.TransitionInfo.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -74,21 +74,22 @@
closing.mVisibleRequested = false;
opening.mVisibleRequested = true;
- int transitType = TRANSIT_OLD_TASK_OPEN;
+ int transit = TRANSIT_OLD_TASK_OPEN;
+ int flags = 0;
// Check basic both tasks participating
participants.add(oldTask);
participants.add(newTask);
ArraySet<WindowContainer> targets = Transition.calculateTargets(participants, changes);
- TransitionInfo info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ TransitionInfo info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
- assertEquals(transitType, info.getType());
+ assertEquals(transit, info.getType());
// Check that children are pruned
participants.add(opening);
participants.add(closing);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -96,7 +97,7 @@
// Check combined prune and promote
participants.remove(newTask);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -104,7 +105,7 @@
// Check multi promote
participants.remove(oldTask);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -138,23 +139,24 @@
opening.mVisibleRequested = true;
opening2.mVisibleRequested = true;
- int transitType = TRANSIT_OLD_TASK_OPEN;
+ int transit = TRANSIT_OLD_TASK_OPEN;
+ int flags = 0;
// Check full promotion from leaf
participants.add(oldTask);
participants.add(opening);
participants.add(opening2);
ArraySet<WindowContainer> targets = Transition.calculateTargets(participants, changes);
- TransitionInfo info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ TransitionInfo info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
- assertEquals(transitType, info.getType());
+ assertEquals(transit, info.getType());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
// Check that unchanging but visible descendant of sibling prevents promotion
participants.remove(opening2);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newNestedTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -184,29 +186,30 @@
showing.mVisibleRequested = true;
showing2.mVisibleRequested = true;
- int transitType = TRANSIT_OLD_TASK_OPEN;
+ int transit = TRANSIT_OLD_TASK_OPEN;
+ int flags = 0;
// Check promotion to DisplayArea
participants.add(showing);
participants.add(showing2);
ArraySet<WindowContainer> targets = Transition.calculateTargets(participants, changes);
- TransitionInfo info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ TransitionInfo info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(1, info.getChanges().size());
- assertEquals(transitType, info.getType());
+ assertEquals(transit, info.getType());
assertNotNull(info.getChange(tda.mRemoteToken.toWindowContainerToken()));
ITaskOrganizer mockOrg = mock(ITaskOrganizer.class);
// Check that organized tasks get reported even if not top
showTask.mTaskOrganizer = mockOrg;
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(tda.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(showTask.mRemoteToken.toWindowContainerToken()));
// Even if DisplayArea explicitly participating
participants.add(tda);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
}
@@ -231,13 +234,14 @@
ArraySet<WindowContainer> targets = Transition.calculateTargets(
transition.mParticipants, transition.mChanges);
- TransitionInfo info = Transition.calculateTransitionInfo(0, targets, transition.mChanges);
+ TransitionInfo info = Transition.calculateTransitionInfo(
+ 0, 0, targets, transition.mChanges);
assertEquals(2, info.getChanges().size());
// There was an existence change on open, so it should be OPEN rather than SHOW
assertEquals(TRANSIT_OPEN,
info.getChange(openTask.mRemoteToken.toWindowContainerToken()).getMode());
// No exestence change on closing, so HIDE rather than CLOSE
- assertEquals(TRANSIT_HIDE,
+ assertEquals(TRANSIT_TO_BACK,
info.getChange(closeTask.mRemoteToken.toWindowContainerToken()).getMode());
}
@@ -267,7 +271,8 @@
ArraySet<WindowContainer> targets = Transition.calculateTargets(
transition.mParticipants, transition.mChanges);
- TransitionInfo info = Transition.calculateTransitionInfo(0, targets, transition.mChanges);
+ TransitionInfo info = Transition.calculateTransitionInfo(
+ 0, 0, targets, transition.mChanges);
assertEquals(taskCount, info.getChanges().size());
// verify order is top-to-bottem
for (int i = 0; i < taskCount; ++i) {
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
index 78e873e..f138475 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
@@ -56,7 +56,7 @@
WINDOWING_MODE_SPLIT_SCREEN_SECONDARY, ACTIVITY_TYPE_STANDARD,
TYPE_BASE_APPLICATION, mDisplayContent, "splitScreenSecondaryWindow");
- mDisplayContent.mInputMethodTarget = splitScreenWindow;
+ mDisplayContent.setImeLayeringTarget(splitScreenWindow);
Consumer<WindowState> c = mock(Consumer.class);
mDisplayContent.forAllWindows(c, false);
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
index d2be50d..4a6906b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
@@ -292,7 +292,7 @@
// Make IME attach to the window and can produce insets.
final DisplayContent dc = mTestDisplayContent;
- dc.mInputMethodTarget = w;
+ dc.setImeLayeringTarget(w);
WindowState mockIme = mock(WindowState.class);
Mockito.doReturn(true).when(mockIme).isVisibleNow();
dc.mInputMethodWindow = mockIme;
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
index f123bc1..3c82685 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
@@ -741,11 +741,10 @@
}
private List<Task> getTasksCreatedByOrganizer(DisplayContent dc) {
- ArrayList<Task> out = new ArrayList<>();
- dc.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task t = taskDisplayArea.getRootTaskAt(sNdx);
- if (t.mCreatedByOrganizer) out.add(t);
+ final ArrayList<Task> out = new ArrayList<>();
+ dc.forAllRootTasks(task -> {
+ if (task.mCreatedByOrganizer) {
+ out.add(task);
}
});
return out;
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
index a57de09..76f8207 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
@@ -789,7 +789,7 @@
public void testNeedsRelativeLayeringToIme_notAttached() {
WindowState sameTokenWindow = createWindow(null, TYPE_BASE_APPLICATION, mAppWindow.mToken,
"SameTokenWindow");
- mDisplayContent.mInputMethodTarget = mAppWindow;
+ mDisplayContent.setImeLayeringTarget(mAppWindow);
sameTokenWindow.mActivityRecord.getStack().setWindowingMode(
WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
assertTrue(sameTokenWindow.needsRelativeLayeringToIme());
@@ -802,7 +802,7 @@
public void testNeedsRelativeLayeringToIme_startingWindow() {
WindowState sameTokenWindow = createWindow(null, TYPE_APPLICATION_STARTING,
mAppWindow.mToken, "SameTokenWindow");
- mDisplayContent.mInputMethodTarget = mAppWindow;
+ mDisplayContent.setImeLayeringTarget(mAppWindow);
sameTokenWindow.mActivityRecord.getStack().setWindowingMode(
WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
assertFalse(sameTokenWindow.needsRelativeLayeringToIme());
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
index d64b46d..e13a595 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
@@ -1121,12 +1121,9 @@
mService.mTaskOrganizerController.setLaunchRoot(mDisplayId,
mSecondary.mRemoteToken.toWindowContainerToken());
DisplayContent dc = mService.mRootWindowContainer.getDisplayContent(mDisplayId);
- dc.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (!WindowConfiguration.isSplitScreenWindowingMode(stack.getWindowingMode())) {
- stack.reparent(mSecondary, POSITION_BOTTOM);
- }
+ dc.forAllRootTasks(stack -> {
+ if (!WindowConfiguration.isSplitScreenWindowingMode(stack.getWindowingMode())) {
+ stack.reparent(mSecondary, POSITION_BOTTOM);
}
});
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java b/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
index e44d47a..811a146 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
@@ -218,7 +218,7 @@
@Test
public void testAssignWindowLayers_ForImeWithNoTarget() {
- mDisplayContent.mInputMethodTarget = null;
+ mDisplayContent.setImeLayeringTarget(null);
mDisplayContent.assignChildLayers(mTransaction);
// The Ime has an higher base layer than app windows and lower base layer than system
@@ -236,7 +236,7 @@
@Test
public void testAssignWindowLayers_ForImeWithAppTarget() {
final WindowState imeAppTarget = createWindow("imeAppTarget");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
mDisplayContent.assignChildLayers(mTransaction);
@@ -262,7 +262,7 @@
TYPE_APPLICATION_MEDIA_OVERLAY, imeAppTarget.mToken,
"imeAppTargetChildBelowWindow");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
mDisplayContent.assignChildLayers(mTransaction);
// Ime should be above all app windows except for child windows that are z-ordered above it
@@ -284,7 +284,7 @@
final WindowState imeAppTarget = createWindow("imeAppTarget");
final WindowState appAboveImeTarget = createWindow("appAboveImeTarget");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
mDisplayContent.assignChildLayers(mTransaction);
// Ime should be above all app windows except for non-fullscreen app window above it and
@@ -307,7 +307,7 @@
mDisplayContent, "imeSystemOverlayTarget",
true /* ownerCanAddInternalSystemWindow */);
- mDisplayContent.mInputMethodTarget = imeSystemOverlayTarget;
+ mDisplayContent.setImeLayeringTarget(imeSystemOverlayTarget);
mDisplayContent.assignChildLayers(mTransaction);
// The IME target base layer is higher than all window except for the nav bar window, so the
@@ -330,7 +330,7 @@
@Test
public void testAssignWindowLayers_ForStatusBarImeTarget() {
- mDisplayContent.mInputMethodTarget = mStatusBarWindow;
+ mDisplayContent.setImeLayeringTarget(mStatusBarWindow);
mDisplayContent.assignChildLayers(mTransaction);
assertWindowHigher(mImeWindow, mChildAppWindowAbove);
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java b/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java
new file mode 100644
index 0000000..99d73cf
--- /dev/null
+++ b/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 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.wm.utils;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+
+import android.app.UiAutomation;
+
+/** Provides common utility functions. */
+public class CommonUtils {
+ public static UiAutomation getUiAutomation() {
+ return getInstrumentation().getUiAutomation();
+ }
+
+ public static void runWithShellPermissionIdentity(Runnable runnable) {
+ getUiAutomation().adoptShellPermissionIdentity();
+ try {
+ runnable.run();
+ } finally {
+ getUiAutomation().dropShellPermissionIdentity();
+ }
+ }
+}
diff --git a/services/voiceinteraction/OWNERS b/services/voiceinteraction/OWNERS
new file mode 100644
index 0000000..ef1061b
--- /dev/null
+++ b/services/voiceinteraction/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/voice/OWNERS
diff --git a/services/wifi/OWNERS b/services/wifi/OWNERS
new file mode 100644
index 0000000..2ae7065
--- /dev/null
+++ b/services/wifi/OWNERS
@@ -0,0 +1 @@
+include /wifi/OWNERS
diff --git a/startop/iorap/src/com/google/android/startop/iorap/SystemServiceUserEvent.java b/startop/iorap/src/com/google/android/startop/iorap/SystemServiceUserEvent.java
index b77c03c..2e7bafe 100644
--- a/startop/iorap/src/com/google/android/startop/iorap/SystemServiceUserEvent.java
+++ b/startop/iorap/src/com/google/android/startop/iorap/SystemServiceUserEvent.java
@@ -36,15 +36,15 @@
*/
public class SystemServiceUserEvent implements Parcelable {
- /** @see com.android.server.SystemService#onStartUser */
+ /** @see com.android.server.SystemService#onUserStarting */
public static final int TYPE_START_USER = 0;
- /** @see com.android.server.SystemService#onUnlockUser */
+ /** @see com.android.server.SystemService#onUserUnlocking */
public static final int TYPE_UNLOCK_USER = 1;
- /** @see com.android.server.SystemService#onSwitchUser*/
+ /** @see com.android.server.SystemService#onUserSwitching*/
public static final int TYPE_SWITCH_USER = 2;
- /** @see com.android.server.SystemService#onStopUser */
+ /** @see com.android.server.SystemService#onUserStopping */
public static final int TYPE_STOP_USER = 3;
- /** @see com.android.server.SystemService#onCleanupUser */
+ /** @see com.android.server.SystemService#onUserStopped */
public static final int TYPE_CLEANUP_USER = 4;
private static final int TYPE_MAX = TYPE_CLEANUP_USER;
diff --git a/telecomm/java/android/telecom/OWNERS b/telecomm/java/android/telecom/OWNERS
new file mode 100644
index 0000000..6656a01
--- /dev/null
+++ b/telecomm/java/android/telecom/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
+hallliu@google.com
diff --git a/telephony/common/com/android/internal/telephony/CarrierAppUtils.java b/telephony/common/com/android/internal/telephony/CarrierAppUtils.java
index 7629163..8531b50 100644
--- a/telephony/common/com/android/internal/telephony/CarrierAppUtils.java
+++ b/telephony/common/com/android/internal/telephony/CarrierAppUtils.java
@@ -26,7 +26,7 @@
import android.os.CarrierAssociatedAppEntry;
import android.os.SystemConfigManager;
import android.os.UserHandle;
-import android.permission.PermissionManager;
+import android.permission.LegacyPermissionManager;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.ArrayMap;
@@ -141,8 +141,8 @@
Map<String, List<CarrierAssociatedAppEntry>>
systemCarrierAssociatedAppsDisabledUntilUsed, Context context) {
PackageManager packageManager = context.getPackageManager();
- PermissionManager permissionManager =
- (PermissionManager) context.getSystemService(Context.PERMISSION_SERVICE);
+ LegacyPermissionManager permissionManager = (LegacyPermissionManager)
+ context.getSystemService(Context.LEGACY_PERMISSION_SERVICE);
List<ApplicationInfo> candidates = getDefaultCarrierAppCandidatesHelper(
userId, systemCarrierAppsDisabledUntilUsed, context);
if (candidates == null || candidates.isEmpty()) {
diff --git a/telephony/common/com/android/internal/telephony/TelephonyPermissions.java b/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
index 0c46394..556df88 100644
--- a/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
+++ b/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
@@ -27,7 +27,7 @@
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
-import android.permission.PermissionManager;
+import android.permission.LegacyPermissionManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
@@ -244,7 +244,9 @@
* <ul>
* <li>return true: if the caller has the READ_PRIVILEGED_PHONE_STATE permission, the calling
* package passes a DevicePolicyManager Device Owner / Profile Owner device identifier
- * access check, or the calling package has carrier privileges on any active subscription.
+ * access check, or the calling package has carrier privileges on any active
+ * subscription, or the calling package has the {@link
+ * Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER} appop permission.
* <li>throw SecurityException: if the caller does not meet any of the requirements and is
* targeting Q or is targeting pre-Q and does not have the READ_PHONE_STATE permission
* or carrier privileges of any active subscription.
@@ -256,6 +258,10 @@
*/
public static boolean checkCallingOrSelfReadDeviceIdentifiers(Context context, int subId,
String callingPackage, @Nullable String callingFeatureId, String message) {
+ if (checkCallingOrSelfUseIccAuthWithDeviceIdentifier(context, callingPackage,
+ callingFeatureId, message)) {
+ return true;
+ }
return checkPrivilegedReadPermissionOrCarrierPrivilegePermission(
context, subId, callingPackage, callingFeatureId, message, true);
}
@@ -267,7 +273,9 @@
* <ul>
* <li>return true: if the caller has the READ_PRIVILEGED_PHONE_STATE permission, the calling
* package passes a DevicePolicyManager Device Owner / Profile Owner device identifier
- * access check, or the calling package has carrier privileges on specified subscription.
+ * access check, or the calling package has carrier privileges on specified subscription,
+ * or the calling package has the {@link
+ * Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER} appop permission.
* <li>throw SecurityException: if the caller does not meet any of the requirements and is
* targeting Q or is targeting pre-Q and does not have the READ_PHONE_STATE permission.
* <li>return false: if the caller is targeting pre-Q and does have the READ_PHONE_STATE
@@ -278,6 +286,10 @@
*/
public static boolean checkCallingOrSelfReadSubscriberIdentifiers(Context context, int subId,
String callingPackage, @Nullable String callingFeatureId, String message) {
+ if (checkCallingOrSelfUseIccAuthWithDeviceIdentifier(context, callingPackage,
+ callingFeatureId, message)) {
+ return true;
+ }
return checkPrivilegedReadPermissionOrCarrierPrivilegePermission(
context, subId, callingPackage, callingFeatureId, message, false);
}
@@ -315,8 +327,8 @@
return true;
}
- PermissionManager permissionManager = (PermissionManager) context.getSystemService(
- Context.PERMISSION_SERVICE);
+ LegacyPermissionManager permissionManager = (LegacyPermissionManager)
+ context.getSystemService(Context.LEGACY_PERMISSION_SERVICE);
if (permissionManager.checkDeviceIdentifierAccess(callingPackage, message, callingFeatureId,
pid, uid) == PackageManager.PERMISSION_GRANTED) {
return true;
@@ -385,6 +397,26 @@
}
/**
+ * Check whether the caller (or self, if not processing an IPC) has {@link
+ * Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER} AppOp permission.
+ *
+ * <p>With the permission, the caller can access device/subscriber identifiers and use ICC
+ * authentication like EAP-AKA.
+ */
+ public static boolean checkCallingOrSelfUseIccAuthWithDeviceIdentifier(Context context,
+ String callingPackage, String callingFeatureId, String message) {
+ // Cannot perform appop check if the calling package is null
+ if (callingPackage == null) {
+ return false;
+ }
+ int callingUid = Binder.getCallingUid();
+ AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
+ int opMode = appOps.noteOpNoThrow(AppOpsManager.OPSTR_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER,
+ callingUid, callingPackage, callingFeatureId, message);
+ return opMode == AppOpsManager.MODE_ALLOWED;
+ }
+
+ /**
* Check whether the app with the given pid/uid can read the call log.
* @return {@code true} if the specified app has the read call log permission and AppOpp granted
* to it, {@code false} otherwise.
diff --git a/telephony/java/android/service/euicc/OWNERS b/telephony/java/android/service/euicc/OWNERS
new file mode 100644
index 0000000..6aa399d
--- /dev/null
+++ b/telephony/java/android/service/euicc/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+amitmahajan@google.com
diff --git a/telephony/java/android/service/sms/OWNERS b/telephony/java/android/service/sms/OWNERS
new file mode 100644
index 0000000..6aa399d
--- /dev/null
+++ b/telephony/java/android/service/sms/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+amitmahajan@google.com
diff --git a/telephony/java/android/telephony/Annotation.java b/telephony/java/android/telephony/Annotation.java
index f900c38..99f2e5e 100644
--- a/telephony/java/android/telephony/Annotation.java
+++ b/telephony/java/android/telephony/Annotation.java
@@ -624,6 +624,20 @@
public @interface UiccAppType{}
/**
+ * UICC SIM Application Types including UNKNOWN
+ */
+ @IntDef(prefix = { "APPTYPE_" }, value = {
+ TelephonyManager.APPTYPE_UNKNOWN,
+ TelephonyManager.APPTYPE_SIM,
+ TelephonyManager.APPTYPE_USIM,
+ TelephonyManager.APPTYPE_RUIM,
+ TelephonyManager.APPTYPE_CSIM,
+ TelephonyManager.APPTYPE_ISIM
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface UiccAppTypeExt{}
+
+ /**
* Override network type
*/
@Retention(RetentionPolicy.SOURCE)
diff --git a/telephony/java/android/telephony/DataFailCause.java b/telephony/java/android/telephony/DataFailCause.java
index 8b7a243..d502da9 100644
--- a/telephony/java/android/telephony/DataFailCause.java
+++ b/telephony/java/android/telephony/DataFailCause.java
@@ -916,6 +916,84 @@
/** System preference change back to SRAT during handoff */
public static final int HANDOFF_PREFERENCE_CHANGED = 0x8CB;
+ //IKE error notifications message as specified in 3GPP TS 24.302 (Section 8.1.2.2).
+
+ /** The PDN connection corresponding to the requested APN has been rejected. */
+ public static final int IWLAN_PDN_CONNECTION_REJECTION = 0x2000;
+ /**
+ * The PDN connection has been rejected. No additional PDN connections can be established
+ * for the UE due to the network policies or capabilities.
+ */
+ public static final int IWLAN_MAX_CONNECTION_REACHED = 0x2001;
+ /**
+ * The PDN connection has been rejected due to a semantic error in TFT operation.
+ */
+ public static final int IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION = 0x2031;
+ /**
+ * The PDN connection has been rejected due to a syntactic error in TFT operation.
+ */
+ public static final int IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION = 0x2032;
+ /**
+ * The PDN connection has been rejected due to sematic errors in the packet filter.
+ */
+ public static final int IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS = 0x2034;
+ /**
+ * The PDN connection has been rejected due to syntactic errors in the packet filter.
+ */
+ public static final int IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS = 0x2035;
+ /**
+ * No non-3GPP subscription is associated with the IMSI.
+ * The UE is not allowed to use non-3GPP access to EPC.
+ */
+ public static final int IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED = 0x2328;
+ /** The user identified by the IMSI is unknown. */
+ public static final int IWLAN_USER_UNKNOWN = 0x2329;
+ /**
+ * The requested APN is not included in the user's profile,
+ * and therefore is not authorized for that user.
+ */
+ public static final int IWLAN_NO_APN_SUBSCRIPTION = 0x232A;
+ /** The user is barred from using the non-3GPP access or the subscribed APN. */
+ public static final int IWLAN_AUTHORIZATION_REJECTED = 0x232B;
+ /** The Mobile Equipment used is not acceptable to the network */
+ public static final int IWLAN_ILLEGAL_ME = 0x232E;
+ /**
+ * The network has determined that the requested procedure cannot be completed successfully
+ * due to network failure.
+ */
+ public static final int IWLAN_NETWORK_FAILURE = 0x2904;
+ /** The access type is restricted to the user. */
+ public static final int IWLAN_RAT_TYPE_NOT_ALLOWED = 0x2AF9;
+ /** The network does not accept emergency PDN bringup request using an IMEI */
+ public static final int IWLAN_IMEI_NOT_ACCEPTED = 0x2AFD;
+ /**
+ * The ePDG performs PLMN filtering (based on roaming agreements) and rejects
+ * the request from the UE.
+ * The UE requests service in a PLMN where the UE is not allowed to operate.
+ */
+ public static final int IWLAN_PLMN_NOT_ALLOWED = 0x2B03;
+ /** The ePDG does not support un-authenticated IMSI based emergency PDN bringup **/
+ public static final int IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED = 0x2B2F;
+
+ // Device is unable to establish an IPSec tunnel with the ePDG for any reason
+ // e.g authentication fail or certificate validation or DNS Resolution and timeout failure.
+
+ /** IKE configuration error resulting in failure */
+ public static final int IWLAN_IKEV2_CONFIG_FAILURE = 0x4000;
+ /**
+ * Sent in the response to an IKE_AUTH message when, for some reason,
+ * the authentication failed.
+ */
+ public static final int IWLAN_IKEV2_AUTH_FAILURE = 0x4001;
+ /** IKE message timeout, tunnel setup failed due to no response from EPDG */
+ public static final int IWLAN_IKEV2_MSG_TIMEOUT = 0x4002;
+ /** IKE Certification validation failure */
+ public static final int IWLAN_IKEV2_CERT_INVALID = 0x4003;
+ /** Unable to resolve FQDN for the ePDG to an IP address */
+ public static final int IWLAN_DNS_RESOLUTION_NAME_FAILURE = 0x4004;
+ /** No response received from the DNS Server due to a timeout*/
+ public static final int IWLAN_DNS_RESOLUTION_TIMEOUT = 0x4005;
+
// OEM sepecific error codes. To be used by OEMs when they don't
// want to reveal error code which would be replaced by ERROR_UNSPECIFIED
public static final int OEM_DCFAILCAUSE_1 = 0x1001;
@@ -1341,6 +1419,34 @@
sFailCauseMap.put(VSNCP_RECONNECT_NOT_ALLOWED, "VSNCP_RECONNECT_NOT_ALLOWED");
sFailCauseMap.put(IPV6_PREFIX_UNAVAILABLE, "IPV6_PREFIX_UNAVAILABLE");
sFailCauseMap.put(HANDOFF_PREFERENCE_CHANGED, "HANDOFF_PREFERENCE_CHANGED");
+ sFailCauseMap.put(IWLAN_PDN_CONNECTION_REJECTION, "IWLAN_PDN_CONNECTION_REJECTION");
+ sFailCauseMap.put(IWLAN_MAX_CONNECTION_REACHED, "IWLAN_MAX_CONNECTION_REACHED");
+ sFailCauseMap.put(IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION,
+ "IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION");
+ sFailCauseMap.put(IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION,
+ "IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION");
+ sFailCauseMap.put(IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS,
+ "IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS");
+ sFailCauseMap.put(IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS,
+ "IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS");
+ sFailCauseMap.put(IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED,
+ "IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED");
+ sFailCauseMap.put(IWLAN_USER_UNKNOWN, "IWLAN_USER_UNKNOWN");
+ sFailCauseMap.put(IWLAN_NO_APN_SUBSCRIPTION, "IWLAN_NO_APN_SUBSCRIPTION");
+ sFailCauseMap.put(IWLAN_AUTHORIZATION_REJECTED, "IWLAN_AUTHORIZATION_REJECTED");
+ sFailCauseMap.put(IWLAN_ILLEGAL_ME, "IWLAN_ILLEGAL_ME");
+ sFailCauseMap.put(IWLAN_NETWORK_FAILURE, "IWLAN_NETWORK_FAILURE");
+ sFailCauseMap.put(IWLAN_RAT_TYPE_NOT_ALLOWED, "IWLAN_RAT_TYPE_NOT_ALLOWED");
+ sFailCauseMap.put(IWLAN_IMEI_NOT_ACCEPTED, "IWLAN_IMEI_NOT_ACCEPTED");
+ sFailCauseMap.put(IWLAN_PLMN_NOT_ALLOWED, "IWLAN_PLMN_NOT_ALLOWED");
+ sFailCauseMap.put(IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED,
+ "IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED");
+ sFailCauseMap.put(IWLAN_IKEV2_CONFIG_FAILURE, "IWLAN_IKEV2_CONFIG_FAILURE");
+ sFailCauseMap.put(IWLAN_IKEV2_AUTH_FAILURE, "IWLAN_IKEV2_AUTH_FAILURE");
+ sFailCauseMap.put(IWLAN_IKEV2_MSG_TIMEOUT, "IWLAN_IKEV2_MSG_TIMEOUT");
+ sFailCauseMap.put(IWLAN_IKEV2_CERT_INVALID, "IWLAN_IKEV2_CERT_INVALID");
+ sFailCauseMap.put(IWLAN_DNS_RESOLUTION_NAME_FAILURE, "IWLAN_DNS_RESOLUTION_NAME_FAILURE");
+ sFailCauseMap.put(IWLAN_DNS_RESOLUTION_TIMEOUT, "IWLAN_DNS_RESOLUTION_TIMEOUT");
sFailCauseMap.put(OEM_DCFAILCAUSE_1, "OEM_DCFAILCAUSE_1");
sFailCauseMap.put(OEM_DCFAILCAUSE_2, "OEM_DCFAILCAUSE_2");
sFailCauseMap.put(OEM_DCFAILCAUSE_3, "OEM_DCFAILCAUSE_3");
diff --git a/telephony/java/android/telephony/IBootstrapAuthenticationCallback.aidl b/telephony/java/android/telephony/IBootstrapAuthenticationCallback.aidl
new file mode 100644
index 0000000..d39ad0e
--- /dev/null
+++ b/telephony/java/android/telephony/IBootstrapAuthenticationCallback.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2020 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.telephony;
+
+/**
+ * Callback to handle the response of bootstrapAuthenticationRequest
+ * @hide
+ */
+oneway interface IBootstrapAuthenticationCallback
+{
+ void onKeysAvailable(int token, in byte[] gbaKey, String btId);
+ void onAuthenticationFailure(int token, int reason);
+}
diff --git a/telephony/java/android/telephony/OWNERS b/telephony/java/android/telephony/OWNERS
new file mode 100644
index 0000000..6aa399d
--- /dev/null
+++ b/telephony/java/android/telephony/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+amitmahajan@google.com
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 239329c..df0b9ac 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -23,6 +23,7 @@
import static com.android.internal.util.Preconditions.checkNotNull;
import android.Manifest;
+import android.annotation.BytesLong;
import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.LongDef;
@@ -80,12 +81,14 @@
import android.telephony.Annotation.SimActivationState;
import android.telephony.Annotation.ThermalMitigationResult;
import android.telephony.Annotation.UiccAppType;
+import android.telephony.Annotation.UiccAppTypeExt;
import android.telephony.CallForwardingInfo.CallForwardingReason;
import android.telephony.VisualVoicemailService.VisualVoicemailTask;
import android.telephony.data.ApnSetting;
import android.telephony.data.ApnSetting.MvnoType;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.emergency.EmergencyNumber.EmergencyServiceCategories;
+import android.telephony.gba.UaSecurityProtocolIdentifier;
import android.telephony.ims.ImsMmTelManager;
import android.telephony.ims.aidl.IImsConfig;
import android.telephony.ims.aidl.IImsRegistration;
@@ -124,7 +127,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
-import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
@@ -549,6 +551,21 @@
return getPhoneCount() > 1;
}
+ private static final int MAXIMUM_CALL_COMPOSER_PICTURE_SIZE = 80000;
+
+ // TODO(hallliu): link to upload method in docs
+ /**
+ * Indicates the maximum size of the call composure picture.
+ *
+ * Pictures sent via uploadCallComposerPicture must not exceed this size, or an
+ * {@link IllegalArgumentException} will be thrown.
+ *
+ * @return Maximum file size in bytes.
+ */
+ public static @BytesLong long getMaximumCallComposerPictureSize() {
+ return MAXIMUM_CALL_COMPOSER_PICTURE_SIZE;
+ }
+
//
// Broadcast Intent actions
//
@@ -2009,6 +2026,8 @@
* active subscription.
* <li>If the calling app is the default SMS role holder (see {@link
* RoleManager#isRoleHeld(String)}).
+ * <li>If the calling app has been granted the
+ * {@link Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER} permission.
* </ul>
*
* <p>If the calling app does not meet one of these requirements then this method will behave
@@ -4019,6 +4038,8 @@
* <li>If the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
* <li>If the calling app is the default SMS role holder (see {@link
* RoleManager#isRoleHeld(String)}).
+ * <li>If the calling app has been granted the
+ * {@link Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER} permission.
* </ul>
*
* <p>If the calling app does not meet one of these requirements then this method will behave
@@ -4043,33 +4064,8 @@
* for a subscription.
* Return null if it is unavailable.
*
- * <p>Starting with API level 29, persistent device identifiers are guarded behind additional
- * restrictions, and apps are recommended to use resettable identifiers (see <a
- * href="/training/articles/user-data-ids">Best practices for unique identifiers</a>). This
- * method can be invoked if one of the following requirements is met:
- * <ul>
- * <li>If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this
- * is a privileged permission that can only be granted to apps preloaded on the device.
- * <li>If the calling app is the device or profile owner and has been granted the
- * {@link Manifest.permission#READ_PHONE_STATE} permission. The profile owner is an app that
- * owns a managed profile on the device; for more details see <a
- * href="https://developer.android.com/work/managed-profiles">Work profiles</a>.
- * Profile owner access is deprecated and will be removed in a future release.
- * <li>If the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
- * <li>If the calling app is the default SMS role holder (see {@link
- * RoleManager#isRoleHeld(String)}).
- * </ul>
- *
- * <p>If the calling app does not meet one of these requirements then this method will behave
- * as follows:
- *
- * <ul>
- * <li>If the calling app's target SDK is API level 28 or lower and the app has the
- * READ_PHONE_STATE permission then null is returned.</li>
- * <li>If the calling app's target SDK is API level 28 or lower and the app does not have
- * the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or
- * higher, then a SecurityException is thrown.</li>
- * </ul>
+ * See {@link #getSubscriberId()} for details on the required permissions and behavior
+ * when the caller does not hold sufficient permissions.
*
* @param subId whose subscriber id is returned
* @hide
@@ -5594,57 +5590,6 @@
}
}
- /**
- * Registers a listener object to receive notification of changes
- * in specified telephony states.
- * <p>
- * To register a listener, pass a {@link PhoneStateListener} and specify at least one telephony
- * state of interest in the events argument.
- *
- * At registration, and when a specified telephony state changes, the telephony manager invokes
- * the appropriate callback method on the listener object and passes the current (updated)
- * values.
- * <p>
- * To un-register a listener, pass the listener object and set the events argument to
- * {@link PhoneStateListener#LISTEN_NONE LISTEN_NONE} (0).
- *
- * If this TelephonyManager object has been created with {@link #createForSubscriptionId},
- * applies to the given subId. Otherwise, applies to
- * {@link SubscriptionManager#getDefaultSubscriptionId()}. To listen events for multiple subIds,
- * pass a separate listener object to each TelephonyManager object created with
- * {@link #createForSubscriptionId}.
- *
- * Note: if you call this method while in the middle of a binder transaction, you <b>must</b>
- * call {@link android.os.Binder#clearCallingIdentity()} before calling this method. A
- * {@link SecurityException} will be thrown otherwise.
- *
- * This API should be used sparingly -- large numbers of listeners will cause system
- * instability. If a process has registered too many listeners without unregistering them, it
- * may encounter an {@link IllegalStateException} when trying to register more listeners.
- *
- * @param events The telephony state(s) of interest to the listener,
- * as a bitwise-OR combination of {@link PhoneStateListener}
- * LISTEN_ flags.
- * @param listener The {@link PhoneStateListener} object to register
- * (or unregister)
- * @deprecated Use {@link #registerPhoneStateListener(Executor, PhoneStateListener)}.
- */
- @Deprecated
- public void listen(long events, @NonNull PhoneStateListener listener) {
- mTelephonyRegistryMgr = mContext.getSystemService(TelephonyRegistryManager.class);
- if (mTelephonyRegistryMgr != null) {
- if (events != PhoneStateListener.LISTEN_NONE) {
- mTelephonyRegistryMgr.registerPhoneStateListenerWithEvents(mSubId,
- getOpPackageName(), getAttributionTag(), listener,
- Long.valueOf(events).intValue(), getITelephony() != null);
- } else {
- unregisterPhoneStateListener(listener);
- }
- } else {
- throw new IllegalStateException("telephony service is null.");
- }
- }
-
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"ERI_"}, value = {
@@ -7204,6 +7149,8 @@
}
}
+ /** UICC application type is unknown or not specified */
+ public static final int APPTYPE_UNKNOWN = PhoneConstants.APPTYPE_UNKNOWN;
/** UICC application type is SIM */
public static final int APPTYPE_SIM = PhoneConstants.APPTYPE_SIM;
/** UICC application type is USIM */
@@ -7226,8 +7173,13 @@
* Returns the response of authentication for the default subscription.
* Returns null if the authentication hasn't been successful
*
- * <p>Requires Permission: READ_PRIVILEGED_PHONE_STATE or that the calling
- * app has carrier privileges (see {@link #hasCarrierPrivileges}).
+ * <p>Requires one of the following permissions:
+ * <ul>
+ * <li>READ_PRIVILEGED_PHONE_STATE
+ * <li>the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
+ * <li>the calling app has been granted the
+ * {@link Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER} permission.
+ * </ul>
*
* @param appType the icc application type, like {@link #APPTYPE_USIM}
* @param authType the authentication type, {@link #AUTHTYPE_EAP_AKA} or
@@ -7252,7 +7204,8 @@
* Returns the response of USIM Authentication for specified subId.
* Returns null if the authentication hasn't been successful
*
- * <p>Requires that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
+ * <p>See {@link #getIccAuthentication(int, int, String)} for details on the required
+ * permissions.
*
* @param subId subscription ID used for authentication
* @param appType the icc application type, like {@link #APPTYPE_USIM}
@@ -7275,7 +7228,8 @@
IPhoneSubInfo info = getSubscriberInfoService();
if (info == null)
return null;
- return info.getIccSimChallengeResponse(subId, appType, authType, data);
+ return info.getIccSimChallengeResponse(subId, appType, authType, data,
+ getOpPackageName(), getAttributionTag());
} catch (RemoteException ex) {
return null;
} catch (NullPointerException ex) {
@@ -10023,6 +9977,16 @@
*/
public static final int CARD_POWER_UP_PASS_THROUGH = 2;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = {"CARD_POWER"},
+ value = {
+ CARD_POWER_DOWN,
+ CARD_POWER_UP,
+ CARD_POWER_UP_PASS_THROUGH,
+ })
+ public @interface SimPowerState {}
+
/**
* Set SIM card power state.
*
@@ -10033,12 +9997,17 @@
* Callers should monitor for {@link TelephonyIntents#ACTION_SIM_STATE_CHANGED}
* broadcasts to determine success or failure and timeout if needed.
*
+ * @deprecated prefer {@link setSimPowerState(int, Executor, Consumer<Integer>)}.
+ * There is no guarantee that SIM power changes will trigger ACTION_SIM_STATE_CHANGED on new
+ * devices.
+ *
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
*
* {@hide}
**/
@SystemApi
+ @Deprecated
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setSimPowerState(int state) {
setSimPowerStateForSlot(getSlotIndex(), state);
@@ -10055,12 +10024,16 @@
* Callers should monitor for {@link TelephonyIntents#ACTION_SIM_STATE_CHANGED}
* broadcasts to determine success or failure and timeout if needed.
*
+ * @deprecated prefer {@link setSimPowerStateForSlot(int, int, Executor, Consumer<Integer>)}.
+ * changes will trigger ACTION_SIM_STATE_CHANGED on new devices.
+ *
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
*
* {@hide}
**/
@SystemApi
+ @Deprecated
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setSimPowerStateForSlot(int slotIndex, int state) {
try {
@@ -10076,6 +10049,85 @@
}
/**
+ * Set SIM card power state.
+ *
+ * @param state State of SIM (power down, power up, pass through)
+ * @see #CARD_POWER_DOWN
+ * @see #CARD_POWER_UP
+ * @see #CARD_POWER_UP_PASS_THROUGH
+ * @param executor The executor of where the callback will execute.
+ * @param callback Callback will be triggered once it succeeds or failed.
+ * @see #SET_SIM_POWER_STATE_SUCCESS
+ * @see #SET_SIM_POWER_STATE_ALREADY_IN_STATE
+ * @see #SET_SIM_POWER_STATE_MODEM_ERROR
+ * @see #SET_SIM_POWER_STATE_SIM_ERROR
+ * @see #SET_SIM_POWER_STATE_NOT_SUPPORTED
+ * @throws IllegalArgumentException if requested SIM state is invalid
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ *
+ * {@hide}
+ **/
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setSimPowerState(@SimPowerState int state, @NonNull Executor executor,
+ @NonNull @SetSimPowerStateResult Consumer<Integer> callback) {
+ setSimPowerStateForSlot(getSlotIndex(), state, executor, callback);
+ }
+
+ /**
+ * Set SIM card power state.
+ *
+ * @param slotIndex SIM slot id
+ * @param state State of SIM (power down, power up, pass through)
+ * @see #CARD_POWER_DOWN
+ * @see #CARD_POWER_UP
+ * @see #CARD_POWER_UP_PASS_THROUGH
+ * @param executor The executor of where the callback will execute.
+ * @param callback Callback will be triggered once it succeeds or failed.
+ * @see #SET_SIM_POWER_STATE_SUCCESS
+ * @see #SET_SIM_POWER_STATE_ALREADY_IN_STATE
+ * @see #SET_SIM_POWER_STATE_MODEM_ERROR
+ * @see #SET_SIM_POWER_STATE_SIM_ERROR
+ * @see #SET_SIM_POWER_STATE_NOT_SUPPORTED
+ * @throws IllegalArgumentException if requested SIM state is invalid
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
+ *
+ * {@hide}
+ **/
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setSimPowerStateForSlot(int slotIndex, @SimPowerState int state,
+ @NonNull Executor executor,
+ @NonNull @SetSimPowerStateResult Consumer<Integer> callback) {
+ if (state != CARD_POWER_DOWN && state != CARD_POWER_UP
+ && state != CARD_POWER_UP_PASS_THROUGH) {
+ throw new IllegalArgumentException("requested SIM state is invalid");
+ }
+ try {
+ ITelephony telephony = getITelephony();
+ IIntegerConsumer internalCallback = new IIntegerConsumer.Stub() {
+ @Override
+ public void accept(int result) {
+ executor.execute(() ->
+ Binder.withCleanCallingIdentity(() -> callback.accept(result)));
+ }
+ };
+ if (telephony != null) {
+ telephony.setSimPowerStateForSlotWithCallback(slotIndex, state, internalCallback);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelephony#setSimPowerStateForSlot", e);
+ } catch (SecurityException e) {
+ Log.e(TAG, "Permission error calling ITelephony#setSimPowerStateForSlot",
+ e);
+ }
+ }
+
+ /**
* Set baseband version for the default phone.
*
* @param version baseband version
@@ -11194,6 +11246,55 @@
public @interface SetCarrierRestrictionResult {}
/**
+ * The SIM power state was successfully set.
+ * @hide
+ */
+ @SystemApi
+ public static final int SET_SIM_POWER_STATE_SUCCESS = 0;
+
+ /**
+ * The SIM is already in the requested power state.
+ * @hide
+ */
+ @SystemApi
+ public static final int SET_SIM_POWER_STATE_ALREADY_IN_STATE = 1;
+
+ /**
+ * Failed to connect to the modem to make the power state request. This may happen if the
+ * modem has an error. The user may want to make the request again later.
+ * @hide
+ */
+ @SystemApi
+ public static final int SET_SIM_POWER_STATE_MODEM_ERROR = 2;
+
+ /**
+ * Failed to connect to the SIM to make the power state request. This may happen if the
+ * SIM has been removed. The user may want to make the request again later.
+ * @hide
+ */
+ @SystemApi
+ public static final int SET_SIM_POWER_STATE_SIM_ERROR = 3;
+
+ /**
+ * The modem version does not support synchronous power.
+ * @hide
+ */
+ @SystemApi
+ public static final int SET_SIM_POWER_STATE_NOT_SUPPORTED = 4;
+
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = {"SET_SIM_POWER_STATE_"},
+ value = {
+ SET_SIM_POWER_STATE_SUCCESS,
+ SET_SIM_POWER_STATE_ALREADY_IN_STATE,
+ SET_SIM_POWER_STATE_MODEM_ERROR,
+ SET_SIM_POWER_STATE_SIM_ERROR,
+ SET_SIM_POWER_STATE_NOT_SUPPORTED
+ })
+ public @interface SetSimPowerStateResult {}
+
+ /**
* Set the allowed carrier list and the excluded carrier list indicating the priority between
* the two lists.
* Requires system privileges.
@@ -14415,4 +14516,173 @@
throw new IllegalStateException("telephony service is null.");
}
}
+
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = {"GBA_FAILURE_REASON_"}, value = {
+ GBA_FAILURE_REASON_UNKNOWN,
+ GBA_FAILURE_REASON_FEATURE_NOT_SUPPORTED,
+ GBA_FAILURE_REASON_FEATURE_NOT_READY,
+ GBA_FAILURE_REASON_NETWORK_FAILURE,
+ GBA_FAILURE_REASON_INCORRECT_NAF_ID,
+ GBA_FAILURE_REASON_SECURITY_PROTOCOL_NOT_SUPPORTED})
+ public @interface AuthenticationFailureReason {}
+
+ /**
+ * GBA Authentication has failed for an unknown reason.
+ *
+ * <p>The caller should retry a message that failed with this response.
+ * @hide
+ */
+ @SystemApi
+ public static final int GBA_FAILURE_REASON_UNKNOWN = 0;
+
+ /**
+ * GBA Authentication is not supported by the carrier, SIM or android.
+ *
+ * <p>Application should use other authentication mechanisms if possible.
+ * @hide
+ */
+ @SystemApi
+ public static final int GBA_FAILURE_REASON_FEATURE_NOT_SUPPORTED = 1;
+
+ /**
+ * GBA Authentication service is not ready for use.
+ *
+ * <p>Application could try again at a later time.
+ * @hide
+ */
+ @SystemApi
+ public static final int GBA_FAILURE_REASON_FEATURE_NOT_READY = 2;
+
+ /**
+ * GBA Authentication has been failed by the network.
+ * @hide
+ */
+ @SystemApi
+ public static final int GBA_FAILURE_REASON_NETWORK_FAILURE = 3;
+
+ /**
+ * GBA Authentication has failed due to incorrect NAF URL.
+ * @hide
+ */
+ @SystemApi
+ public static final int GBA_FAILURE_REASON_INCORRECT_NAF_ID = 4;
+
+ /**
+ * GBA Authentication has failed due to unsupported security protocol
+ * @hide
+ */
+ @SystemApi
+ public static final int GBA_FAILURE_REASON_SECURITY_PROTOCOL_NOT_SUPPORTED = 5;
+
+ /**
+ * The callback associated with a {@link #bootstrapAuthenticationRequest()}.
+ * @hide
+ */
+ @SystemApi
+ public static class BootstrapAuthenticationCallback {
+
+ /**
+ * Invoked when the previously requested GBA keys are available (@see
+ * bootstrapAuthenticationRequest()).
+ * @param gbaKey Ks_NAF/Ks_ext_NAF Response
+ * @param transactionId Bootstrapping Transaction Identifier
+ */
+ public void onKeysAvailable(@NonNull byte[] gbaKey, @NonNull String transactionId) {}
+
+ /**
+ * @param reason The reason for the authentication failure.
+ */
+ public void onAuthenticationFailure(@AuthenticationFailureReason int reason) {}
+ }
+
+ /**
+ * Used to get the Generic Bootstrapping Architecture authentication keys
+ * KsNAF/Ks_ext_NAF for a particular NAF as defined in 3GPP spec TS 33.220 for
+ * the specified sub id.
+ *
+ * <p>Application must be prepared to wait for receiving the Gba keys through the
+ * registered callback and not invoke the API on the main application thread.
+ * Application also must call the api to get the fresh key every time instead
+ * of caching the key.
+ *
+ * Following steps may be invoked on the API call depending on the state of the
+ * underlying GBA implementation:
+ * <ol>
+ * <li>Resolve and bind to a Gba implementation.</li>
+ * <li>Run bootstrapping if no valid keys are available or bootstrapping is forced.</li>
+ * <li>Generate the ks_NAF/ ks_Ext_NAF to be returned via the callback.</li>
+ * </ol>
+ *
+ * <p> Requires Permission: MODIFY_PHONE_STATE or that the calling app has carrier
+ * privileges (see {@link #hasCarrierPrivileges}).
+ * @param appType icc application type, like {@link #APPTYPE_USIM} or {@link
+ * #APPTYPE_ISIM} or {@link#APPTYPE_UNKNOWN}
+ * @param nafId Network Application Function(NAF) fully qualified domain name and
+ * the selected GBA mode. It shall contain two parts delimited by "@" sign. The first
+ * part is the constant string "3GPP-bootstrapping" (GBA_ME),
+ * "3GPP-bootstrapping-uicc" (GBA_ U), or "3GPP-bootstrapping-digest" (GBA_Digest),
+ * and the latter part shall be the FQDN of the NAF (e.g.
+ * "3GPP-bootstrapping@naf1.operator.com" or "3GPP-bootstrapping-uicc@naf1.operator.com",
+ * or "3GPP-bootstrapping-digest@naf1.operator.com").
+ * @param securityProtocol Security protocol identifier between UE and NAF. See
+ * 3GPP TS 33.220 Annex H. Application can use
+ * {@link UaSecurityProtocolIdentifier#createDefaultUaSpId},
+ * {@link UaSecurityProtocolIdentifier#create3GppUaSpId},
+ * to create the ua security protocol identifier as needed
+ * @param forceBootStrapping true=force bootstrapping, false=do not force
+ * bootstrapping. Bootstrapping shouldn't be forced unless the application sees
+ * authentication errors from the server.
+ * @param e The {@link Executor} that will be used to call the Gba callback.
+ * @param callback A callback called on the supplied {@link Executor} that will
+ * contain the GBA Ks_NAF/Ks_ext_NAF when available. If the NAF keys are
+ * available and valid at the time of call and bootstrapping is not requested,
+ * then the callback shall be invoked with the available keys.
+ * @hide
+ */
+ @SystemApi
+ @WorkerThread
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void bootstrapAuthenticationRequest(
+ @UiccAppTypeExt int appType, @NonNull Uri nafId,
+ @NonNull UaSecurityProtocolIdentifier securityProtocol,
+ boolean forceBootStrapping, @NonNull Executor e,
+ @NonNull BootstrapAuthenticationCallback callback) {
+ try {
+ ITelephony service = getITelephony();
+ if (service == null) {
+ e.execute(() -> callback.onAuthenticationFailure(
+ GBA_FAILURE_REASON_FEATURE_NOT_READY));
+ return;
+ }
+ service.bootstrapAuthenticationRequest(
+ getSubId(), appType, nafId, securityProtocol, forceBootStrapping,
+ new IBootstrapAuthenticationCallback.Stub() {
+ @Override
+ public void onKeysAvailable(int token, byte[] gbaKey,
+ String transactionId) {
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ e.execute(() -> callback.onKeysAvailable(gbaKey, transactionId));
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ @Override
+ public void onAuthenticationFailure(int token, int reason) {
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ e.execute(() -> callback.onAuthenticationFailure(reason));
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+ });
+ } catch (RemoteException exception) {
+ Log.e(TAG, "Error calling ITelephony#bootstrapAuthenticationRequest", exception);
+ e.execute(() -> callback.onAuthenticationFailure(GBA_FAILURE_REASON_FEATURE_NOT_READY));
+ }
+ }
}
diff --git a/telephony/java/android/telephony/cdma/OWNERS b/telephony/java/android/telephony/cdma/OWNERS
new file mode 100644
index 0000000..6aa399d
--- /dev/null
+++ b/telephony/java/android/telephony/cdma/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+amitmahajan@google.com
diff --git a/telephony/java/android/telephony/data/ApnThrottleStatus.java b/telephony/java/android/telephony/data/ApnThrottleStatus.java
index 51461d1..eec1408 100644
--- a/telephony/java/android/telephony/data/ApnThrottleStatus.java
+++ b/telephony/java/android/telephony/data/ApnThrottleStatus.java
@@ -261,6 +261,10 @@
private long mThrottleExpiryTimeMillis;
private @RetryType int mRetryType;
private @ThrottleType int mThrottleType;
+
+ /**
+ * @hide
+ */
public static final long NO_THROTTLE_EXPIRY_TIME =
DataCallResponse.RETRY_DURATION_UNDEFINED;
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index 090c970..556f2d5 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -253,7 +253,9 @@
public int getCause() { return mCause; }
/**
- * @return The suggested data retry time in milliseconds.
+ * @return The suggested data retry time in milliseconds. 0 when network does not
+ * suggest a retry time (Note this is different from the replacement
+ * {@link #getRetryDurationMillis()}).
*
* @deprecated Use {@link #getRetryDurationMillis()} instead.
*/
diff --git a/telephony/java/android/telephony/data/OWNERS b/telephony/java/android/telephony/data/OWNERS
new file mode 100644
index 0000000..932b35c
--- /dev/null
+++ b/telephony/java/android/telephony/data/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+jackyu@google.com
diff --git a/telephony/java/android/telephony/emergency/OWNERS b/telephony/java/android/telephony/emergency/OWNERS
new file mode 100644
index 0000000..fa07dce
--- /dev/null
+++ b/telephony/java/android/telephony/emergency/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+shuoq@google.com
diff --git a/telephony/java/android/telephony/euicc/OWNERS b/telephony/java/android/telephony/euicc/OWNERS
new file mode 100644
index 0000000..9e51a4b
--- /dev/null
+++ b/telephony/java/android/telephony/euicc/OWNERS
@@ -0,0 +1,6 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+refuhoo@google.com
+amitmahajan@google.com
diff --git a/telephony/java/android/telephony/gba/GbaAuthRequest.aidl b/telephony/java/android/telephony/gba/GbaAuthRequest.aidl
new file mode 100644
index 0000000..ba243a2
--- /dev/null
+++ b/telephony/java/android/telephony/gba/GbaAuthRequest.aidl
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2020 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.telephony.gba;
+
+parcelable GbaAuthRequest;
diff --git a/telephony/java/android/telephony/gba/GbaAuthRequest.java b/telephony/java/android/telephony/gba/GbaAuthRequest.java
new file mode 100644
index 0000000..5366e9a
--- /dev/null
+++ b/telephony/java/android/telephony/gba/GbaAuthRequest.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2020 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.telephony.gba;
+
+import android.annotation.NonNull;
+import android.net.Uri;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.telephony.IBootstrapAuthenticationCallback;
+
+import com.android.internal.telephony.uicc.IccUtils;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * GBA authentication request
+ * {@hide}
+ */
+public final class GbaAuthRequest implements Parcelable {
+ private int mToken;
+ private int mSubId;
+ private int mAppType;
+ private Uri mNafUrl;
+ private byte[] mSecurityProtocol;
+ private boolean mForceBootStrapping;
+ private IBootstrapAuthenticationCallback mCallback;
+
+ private static AtomicInteger sUniqueToken = new AtomicInteger(0);
+
+ public GbaAuthRequest(int subId, int appType, Uri nafUrl, byte[] securityProtocol,
+ boolean forceBootStrapping, IBootstrapAuthenticationCallback callback) {
+ this(nextUniqueToken(), subId, appType, nafUrl,
+ securityProtocol, forceBootStrapping, callback);
+ }
+
+ public GbaAuthRequest(GbaAuthRequest request) {
+ this(request.mToken, request.mSubId, request.mAppType, request.mNafUrl,
+ request.mSecurityProtocol, request.mForceBootStrapping, request.mCallback);
+ }
+
+ public GbaAuthRequest(int token, int subId, int appType, Uri nafUrl, byte[] securityProtocol,
+ boolean forceBootStrapping, IBootstrapAuthenticationCallback callback) {
+ mToken = token;
+ mSubId = subId;
+ mAppType = appType;
+ mNafUrl = nafUrl;
+ mSecurityProtocol = securityProtocol;
+ mCallback = callback;
+ mForceBootStrapping = forceBootStrapping;
+ }
+
+ public int getToken() {
+ return mToken;
+ }
+
+ public int getSubId() {
+ return mSubId;
+ }
+
+ public int getAppType() {
+ return mAppType;
+ }
+
+ public Uri getNafUrl() {
+ return mNafUrl;
+ }
+
+ public byte[] getSecurityProtocol() {
+ return mSecurityProtocol;
+ }
+
+ public boolean isForceBootStrapping() {
+ return mForceBootStrapping;
+ }
+
+ public void setCallback(IBootstrapAuthenticationCallback cb) {
+ mCallback = cb;
+ }
+
+ public IBootstrapAuthenticationCallback getCallback() {
+ return mCallback;
+ }
+
+ /**
+ * {@link Parcelable#writeToParcel}
+ */
+ public void writeToParcel(@NonNull Parcel out, int flags) {
+ out.writeInt(mToken);
+ out.writeInt(mSubId);
+ out.writeInt(mAppType);
+ out.writeParcelable(mNafUrl, 0);
+ out.writeInt(mSecurityProtocol.length);
+ out.writeByteArray(mSecurityProtocol);
+ out.writeBoolean(mForceBootStrapping);
+ out.writeStrongInterface(mCallback);
+ }
+
+ /**
+ * {@link Parcelable.Creator}
+ *
+ */
+ public static final @android.annotation.NonNull Parcelable.Creator<
+ GbaAuthRequest> CREATOR = new Creator<GbaAuthRequest>() {
+ @Override
+ public GbaAuthRequest createFromParcel(Parcel in) {
+ int token = in.readInt();
+ int subId = in.readInt();
+ int appType = in.readInt();
+ Uri nafUrl = in.readParcelable(GbaAuthRequest.class.getClassLoader());
+ int len = in.readInt();
+ byte[] protocol = new byte[len];
+ in.readByteArray(protocol);
+ boolean forceBootStrapping = in.readBoolean();
+ IBootstrapAuthenticationCallback callback =
+ IBootstrapAuthenticationCallback.Stub
+ .asInterface(in.readStrongBinder());
+ return new GbaAuthRequest(token, subId, appType, nafUrl, protocol,
+ forceBootStrapping, callback);
+ }
+
+ @Override
+ public GbaAuthRequest[] newArray(int size) {
+ return new GbaAuthRequest[size];
+ }
+ };
+
+ /**
+ * {@link Parcelable#describeContents}
+ */
+ public int describeContents() {
+ return 0;
+ }
+
+ private static int nextUniqueToken() {
+ return sUniqueToken.getAndIncrement() << 16 | (0xFFFF & (int) System.currentTimeMillis());
+ }
+
+ @Override
+ public String toString() {
+ String str = "Token: " + mToken + "SubId:" + mSubId + ", AppType:"
+ + mAppType + ", NafUrl:" + mNafUrl + ", SecurityProtocol:"
+ + IccUtils.bytesToHexString(mSecurityProtocol)
+ + ", ForceBootStrapping:" + mForceBootStrapping
+ + ", CallBack:" + mCallback;
+ return str;
+ }
+}
diff --git a/telephony/java/android/telephony/gba/GbaService.java b/telephony/java/android/telephony/gba/GbaService.java
new file mode 100644
index 0000000..3962aff
--- /dev/null
+++ b/telephony/java/android/telephony/gba/GbaService.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (C) 2020 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.telephony.gba;
+
+import android.annotation.NonNull;
+import android.annotation.SystemApi;
+import android.app.Service;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.RemoteException;
+import android.telephony.Annotation.UiccAppTypeExt;
+import android.telephony.IBootstrapAuthenticationCallback;
+import android.telephony.TelephonyManager;
+import android.telephony.TelephonyManager.AuthenticationFailureReason;
+import android.util.Log;
+import android.util.SparseArray;
+
+/**
+ * Base class for GBA Service. Any implementation which wants to provide
+ * GBA service must extend this class.
+ *
+ * <p>Note that the application to implement the service must declare to use
+ * the permission {@link android.Manifest.permission#BIND_GBA_SERVICE},
+ * and filter the intent of {@link #SERVICE_INTERFACE}.
+ * The manifest of the service must follow the format below:
+ *
+ * <p>...
+ * <service
+ * android:name=".EgGbaService"
+ * android:directBootAware="true"
+ * android:permission="android.permission.BIND_GBA_SERVICE" >
+ * ...
+ * <intent-filter>
+ * <action android:name="android.telephony.gba.GbaService"/>
+ * </intent-filter>
+ * </service>
+ * ...
+ *
+ * <p>The service should also be file-based encryption (FBE) aware.
+ * {@hide}
+ */
+@SystemApi
+public class GbaService extends Service {
+ private static final boolean DBG = Build.IS_DEBUGGABLE;
+ private static final String TAG = "GbaService";
+
+ /**
+ * The intent must be defined as an intent-filter in the
+ * AndroidManifest of the GbaService.
+ */
+ public static final String SERVICE_INTERFACE = "android.telephony.gba.GbaService";
+
+ private static final int EVENT_GBA_AUTH_REQUEST = 1;
+
+ private final HandlerThread mHandlerThread;
+ private final GbaServiceHandler mHandler;
+
+ private final SparseArray<IBootstrapAuthenticationCallback> mCallbacks = new SparseArray<>();
+ private final IGbaServiceWrapper mBinder = new IGbaServiceWrapper();
+
+ /**
+ * Default constructor.
+ */
+ public GbaService() {
+ mHandlerThread = new HandlerThread(TAG);
+ mHandlerThread.start();
+
+ mHandler = new GbaServiceHandler(mHandlerThread.getLooper());
+ Log.d(TAG, "GBA service created");
+ }
+
+ private class GbaServiceHandler extends Handler {
+
+ GbaServiceHandler(Looper looper) {
+ super(looper);
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case EVENT_GBA_AUTH_REQUEST:
+ GbaAuthRequest req = (GbaAuthRequest) msg.obj;
+ synchronized (mCallbacks) {
+ mCallbacks.put(req.getToken(), req.getCallback());
+ }
+ onAuthenticationRequest(req.getSubId(), req.getToken(), req.getAppType(),
+ req.getNafUrl(), req.getSecurityProtocol(), req.isForceBootStrapping());
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ /**
+ * Called by the platform when a GBA authentication request is received from
+ * {@link TelephonyManager#bootstrapAuthenticationRequest} to get the KsNAF for
+ * a particular NAF.
+ *
+ * @param subscriptionId the ICC card to be used for the bootstrapping authentication.
+ * @param token the identification of the authentication request.
+ * @param appType icc application type, like {@link #APPTYPE_USIM} or {@link
+ * #APPTYPE_ISIM} or {@link#APPTYPE_UNKNOWN}
+ * @param nafUrl Network Application Function(NAF) fully qualified domain name and
+ * the selected GBA mode. It shall contain two parts delimited by "@" sign. The first
+ * part is the constant string "3GPP-bootstrapping" (GBA_ME),
+ * "3GPP-bootstrapping-uicc" (GBA_ U), or "3GPP-bootstrapping-digest" (GBA_Digest),
+ * and the latter part shall be the FQDN of the NAF (e.g.
+ * "3GPP-bootstrapping@naf1.operator.com" or "3GPP-bootstrapping-uicc@naf1.operator.com",
+ * or "3GPP-bootstrapping-digest@naf1.operator.com").
+ * @param securityProtocol Security protocol identifier between UE and NAF. See
+ * 3GPP TS 33.220 Annex H. Application can use
+ * {@link UaSecurityProtocolIdentifier#createDefaultUaSpId},
+ * {@link UaSecurityProtocolIdentifier#create3GppUaSpId},
+ * to create the ua security protocol identifier as needed
+ * @param forceBootStrapping true=force bootstrapping, false=do not force
+ * bootstrapping. Bootstrapping shouldn't be forced unless the application sees
+ * authentication errors from the server.
+ * Response is returned via {@link TelephonyManager#BootstrapAuthenticationCallback}
+ * along with the token to identify the request.
+ *
+ * <p>Note that this is not called in the main thread.
+ */
+ public void onAuthenticationRequest(int subscriptionId, int token, @UiccAppTypeExt int appType,
+ @NonNull Uri nafUrl, @NonNull byte[] securityProtocol, boolean forceBootStrapping) {
+ //Default implementation should be overridden by vendor Gba Service. Vendor Gba Service
+ //should handle the gba bootstrap authentication request, and call reportKeysAvailable or
+ //reportAuthenticationFailure to notify the caller accordingly.
+ reportAuthenticationFailure(
+ token, TelephonyManager.GBA_FAILURE_REASON_FEATURE_NOT_SUPPORTED);
+ }
+
+ /**
+ * Called by {@link GbaService} when the previously requested GBA keys are available
+ * (@see onAuthenticationRequest())
+ *
+ * @param token unique identifier of the request.
+ * @param gbaKey KsNaf Response.
+ * @param transactionId Bootstrapping Transaction ID.
+ * @throws RuntimeException when there is remote failure of callback.
+ */
+ public final void reportKeysAvailable(int token, @NonNull byte[] gbaKey,
+ @NonNull String transactionId) throws RuntimeException {
+ IBootstrapAuthenticationCallback cb = null;
+ synchronized (mCallbacks) {
+ cb = mCallbacks.get(token);
+ mCallbacks.remove(token);
+ }
+ if (cb != null) {
+ try {
+ cb.onKeysAvailable(token, gbaKey, transactionId);
+ } catch (RemoteException exception) {
+ throw exception.rethrowAsRuntimeException();
+ }
+ }
+ }
+
+ /**
+ * Invoked when the previously requested GBA key authentication failed
+ * (@see onAuthenticationRequest())
+ *
+ * @param token unique identifier of the request.
+ * @param reason The reason for the authentication failure.
+ * @throws RuntimeException when there is remote failure of callback.
+ */
+ public final void reportAuthenticationFailure(int token,
+ @AuthenticationFailureReason int reason) throws RuntimeException {
+ IBootstrapAuthenticationCallback cb = null;
+ synchronized (mCallbacks) {
+ cb = mCallbacks.get(token);
+ mCallbacks.remove(token);
+ }
+ if (cb != null) {
+ try {
+ cb.onAuthenticationFailure(token, reason);
+ } catch (RemoteException exception) {
+ throw exception.rethrowAsRuntimeException();
+ }
+ }
+ }
+
+ /** @hide */
+ @Override
+ public IBinder onBind(Intent intent) {
+ if (SERVICE_INTERFACE.equals(intent.getAction())) {
+ Log.d(TAG, "GbaService Bound.");
+ return mBinder;
+ }
+ return null;
+ }
+
+ /** @hide */
+ @Override
+ public void onDestroy() {
+ mHandlerThread.quit();
+ super.onDestroy();
+ }
+
+ private class IGbaServiceWrapper extends IGbaService.Stub {
+ @Override
+ public void authenticationRequest(GbaAuthRequest request) {
+ if (DBG) Log.d(TAG, "receive request: " + request);
+ mHandler.obtainMessage(EVENT_GBA_AUTH_REQUEST, request).sendToTarget();
+ }
+ }
+}
diff --git a/telephony/java/android/telephony/gba/IGbaService.aidl b/telephony/java/android/telephony/gba/IGbaService.aidl
new file mode 100644
index 0000000..b7ba5a4
--- /dev/null
+++ b/telephony/java/android/telephony/gba/IGbaService.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2020 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.telephony.gba;
+
+import android.net.Uri;
+import android.telephony.gba.GbaAuthRequest;
+
+/**
+ * @hide
+ */
+interface IGbaService
+{
+ oneway void authenticationRequest(in GbaAuthRequest request);
+}
diff --git a/telephony/java/android/telephony/gba/TlsParams.java b/telephony/java/android/telephony/gba/TlsParams.java
new file mode 100644
index 0000000..922f4bb
--- /dev/null
+++ b/telephony/java/android/telephony/gba/TlsParams.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2020 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.telephony.gba;
+
+import android.annotation.IntDef;
+import android.annotation.SystemApi;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.Arrays;
+
+/**
+ * Defines the TLS parameters for GBA as per IANA and TS 33.210, which are used
+ * by some UA security protocol identifiers defined in 3GPP TS 33.220 Annex H,
+ * and 3GPP TS 33.222.
+ *
+ * @hide
+ */
+@SystemApi
+public class TlsParams {
+
+ private TlsParams() {}
+
+ /**
+ * TLS protocol version supported by GBA
+ */
+ public static final int PROTOCOL_VERSION_TLS_1_2 = 0x0303;
+ public static final int PROTOCOL_VERSION_TLS_1_3 = 0x0304;
+
+ /**
+ * TLS cipher suites are used to create {@link UaSecurityProtocolIdentifier}
+ * by {@link UaSecurityProtocolIdentifier#create3GppUaSpId}
+ *
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(
+ prefix = {"TLS_"},
+ value = {
+ TLS_NULL_WITH_NULL_NULL,
+ TLS_RSA_WITH_NULL_MD5,
+ TLS_RSA_WITH_NULL_SHA,
+ TLS_RSA_WITH_RC4_128_MD5,
+ TLS_RSA_WITH_RC4_128_SHA,
+ TLS_RSA_WITH_3DES_EDE_CBC_SHA,
+ TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA,
+ TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA,
+ TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
+ TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
+ TLS_DH_ANON_WITH_RC4_128_MD5,
+ TLS_DH_ANON_WITH_3DES_EDE_CBC_SHA,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ TLS_DH_DSS_WITH_AES_128_CBC_SHA,
+ TLS_DH_RSA_WITH_AES_128_CBC_SHA,
+ TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
+ TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
+ TLS_DH_ANON_WITH_AES_128_CBC_SHA,
+ TLS_RSA_WITH_AES_256_CBC_SHA,
+ TLS_DH_DSS_WITH_AES_256_CBC_SHA,
+ TLS_DH_RSA_WITH_AES_256_CBC_SHA,
+ TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
+ TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
+ TLS_DH_ANON_WITH_AES_256_CBC_SHA,
+ TLS_RSA_WITH_NULL_SHA256,
+ TLS_RSA_WITH_AES_128_CBC_SHA256,
+ TLS_RSA_WITH_AES_256_CBC_SHA256,
+ TLS_DH_DSS_WITH_AES_128_CBC_SHA256,
+ TLS_DH_RSA_WITH_AES_128_CBC_SHA256,
+ TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,
+ TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
+ TLS_DH_DSS_WITH_AES_256_CBC_SHA256,
+ TLS_DH_RSA_WITH_AES_256_CBC_SHA256,
+ TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,
+ TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
+ TLS_DH_ANON_WITH_AES_128_CBC_SHA256,
+ TLS_DH_ANON_WITH_AES_256_CBC_SHA256,
+ TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
+ TLS_DHE_PSK_WITH_AES_128_GCM_SHA256,
+ TLS_DHE_PSK_WITH_AES_256_GCM_SHA384,
+ TLS_AES_128_GCM_SHA256,
+ TLS_AES_256_GCM_SHA384,
+ TLS_CHACHA20_POLY1305_SHA256,
+ TLS_AES_128_CCM_SHA256,
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
+ TLS_DHE_RSA_WITH_AES_128_CCM,
+ TLS_DHE_RSA_WITH_AES_256_CCM,
+ TLS_DHE_PSK_WITH_AES_128_CCM,
+ TLS_DHE_PSK_WITH_AES_256_CCM,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384,
+ TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256
+ })
+ public @interface TlsCipherSuite {}
+
+ // Cipher suites for TLS v1.2 per RFC5246
+ public static final int TLS_NULL_WITH_NULL_NULL = 0x0000;
+ public static final int TLS_RSA_WITH_NULL_MD5 = 0x0001;
+ public static final int TLS_RSA_WITH_NULL_SHA = 0x0002;
+ public static final int TLS_RSA_WITH_RC4_128_MD5 = 0x0004;
+ public static final int TLS_RSA_WITH_RC4_128_SHA = 0x0005;
+ public static final int TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A;
+ public static final int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D;
+ public static final int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010;
+ public static final int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013;
+ public static final int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016;
+ public static final int TLS_DH_ANON_WITH_RC4_128_MD5 = 0x0018;
+ public static final int TLS_DH_ANON_WITH_3DES_EDE_CBC_SHA = 0x001B;
+ public static final int TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F;
+ public static final int TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030;
+ public static final int TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031;
+ public static final int TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032;
+ public static final int TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033;
+ public static final int TLS_DH_ANON_WITH_AES_128_CBC_SHA = 0x0034;
+ public static final int TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035;
+ public static final int TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036;
+ public static final int TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037;
+ public static final int TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038;
+ public static final int TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039;
+ public static final int TLS_DH_ANON_WITH_AES_256_CBC_SHA = 0x003A;
+ public static final int TLS_RSA_WITH_NULL_SHA256 = 0x003B;
+ public static final int TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C;
+ public static final int TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D;
+ public static final int TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E;
+ public static final int TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F;
+ public static final int TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040;
+ public static final int TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067;
+ public static final int TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068;
+ public static final int TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069;
+ public static final int TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A;
+ public static final int TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B;
+ public static final int TLS_DH_ANON_WITH_AES_128_CBC_SHA256 = 0x006C;
+ public static final int TLS_DH_ANON_WITH_AES_256_CBC_SHA256 = 0x006D;
+
+ // Cipher suites for TLS v1.3 per RFC8446 and recommended by IANA
+ public static final int TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E;
+ public static final int TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F;
+ public static final int TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0x00AA;
+ public static final int TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0x00AB;
+ public static final int TLS_AES_128_GCM_SHA256 = 0x1301;
+ public static final int TLS_AES_256_GCM_SHA384 = 0x1302;
+ public static final int TLS_CHACHA20_POLY1305_SHA256 = 0x1303;
+ public static final int TLS_AES_128_CCM_SHA256 = 0x1304;
+ public static final int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B;
+ public static final int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C;
+ public static final int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F;
+ public static final int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030;
+ public static final int TLS_DHE_RSA_WITH_AES_128_CCM = 0xC09E;
+ public static final int TLS_DHE_RSA_WITH_AES_256_CCM = 0xC09F;
+ public static final int TLS_DHE_PSK_WITH_AES_128_CCM = 0xC0A6;
+ public static final int TLS_DHE_PSK_WITH_AES_256_CCM = 0xC0A7;
+ public static final int TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA8;
+ public static final int TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA9;
+ public static final int TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAA;
+ public static final int TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAC;
+ public static final int TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAD;
+ public static final int TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 = 0xD001;
+ public static final int TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384 = 0xD002;
+ public static final int TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256 = 0xD005;
+
+ private static final int[] CS_EXPECTED = {
+ TLS_NULL_WITH_NULL_NULL,
+ TLS_RSA_WITH_NULL_MD5,
+ TLS_RSA_WITH_NULL_SHA,
+ TLS_RSA_WITH_RC4_128_MD5,
+ TLS_RSA_WITH_RC4_128_SHA,
+ TLS_RSA_WITH_3DES_EDE_CBC_SHA,
+ TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA,
+ TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA,
+ TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA,
+ TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA,
+ TLS_DH_ANON_WITH_RC4_128_MD5,
+ TLS_DH_ANON_WITH_3DES_EDE_CBC_SHA,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ TLS_DH_DSS_WITH_AES_128_CBC_SHA,
+ TLS_DH_RSA_WITH_AES_128_CBC_SHA,
+ TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
+ TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
+ TLS_DH_ANON_WITH_AES_128_CBC_SHA,
+ TLS_RSA_WITH_AES_256_CBC_SHA,
+ TLS_DH_DSS_WITH_AES_256_CBC_SHA,
+ TLS_DH_RSA_WITH_AES_256_CBC_SHA,
+ TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
+ TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
+ TLS_DH_ANON_WITH_AES_256_CBC_SHA,
+ TLS_RSA_WITH_NULL_SHA256,
+ TLS_RSA_WITH_AES_128_CBC_SHA256,
+ TLS_RSA_WITH_AES_256_CBC_SHA256,
+ TLS_DH_DSS_WITH_AES_128_CBC_SHA256,
+ TLS_DH_RSA_WITH_AES_128_CBC_SHA256,
+ TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,
+ TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
+ TLS_DH_DSS_WITH_AES_256_CBC_SHA256,
+ TLS_DH_RSA_WITH_AES_256_CBC_SHA256,
+ TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,
+ TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
+ TLS_DH_ANON_WITH_AES_128_CBC_SHA256,
+ TLS_DH_ANON_WITH_AES_256_CBC_SHA256,
+ TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
+ TLS_DHE_PSK_WITH_AES_128_GCM_SHA256,
+ TLS_DHE_PSK_WITH_AES_256_GCM_SHA384,
+ TLS_AES_128_GCM_SHA256,
+ TLS_AES_256_GCM_SHA384,
+ TLS_CHACHA20_POLY1305_SHA256,
+ TLS_AES_128_CCM_SHA256,
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
+ TLS_DHE_RSA_WITH_AES_128_CCM,
+ TLS_DHE_RSA_WITH_AES_256_CCM,
+ TLS_DHE_PSK_WITH_AES_128_CCM,
+ TLS_DHE_PSK_WITH_AES_256_CCM,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256,
+ TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384,
+ TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256
+ };
+
+ /**
+ * TLS supported groups required by TS 33.210
+ */
+ public static final int GROUP_SECP256R1 = 23;
+ public static final int GROUP_SECP384R1 = 24;
+ public static final int GROUP_X25519 = 29;
+ public static final int GROUP_X448 = 30;
+
+ /**
+ * Signature algorithms shall be supported as per TS 33.210
+ */
+ public static final int SIG_RSA_PKCS1_SHA1 = 0X0201;
+ public static final int SIG_ECDSA_SHA1 = 0X0203;
+ public static final int SIG_RSA_PKCS1_SHA256 = 0X0401;
+ public static final int SIG_ECDSA_SECP256R1_SHA256 = 0X0403;
+ public static final int SIG_RSA_PKCS1_SHA256_LEGACY = 0X0420;
+ public static final int SIG_RSA_PKCS1_SHA384 = 0X0501;
+ public static final int SIG_ECDSA_SECP384R1_SHA384 = 0X0503;
+ public static final int SIG_RSA_PKCS1_SHA384_LEGACY = 0X0520;
+ public static final int SIG_RSA_PKCS1_SHA512 = 0X0601;
+ public static final int SIG_ECDSA_SECP521R1_SHA512 = 0X0603;
+ public static final int SIG_RSA_PKCS1_SHA512_LEGACY = 0X0620;
+ public static final int SIG_RSA_PSS_RSAE_SHA256 = 0X0804;
+ public static final int SIG_RSA_PSS_RSAE_SHA384 = 0X0805;
+ public static final int SIG_RSA_PSS_RSAE_SHA512 = 0X0806;
+ public static final int SIG_ECDSA_BRAINPOOLP256R1TLS13_SHA256 = 0X081A;
+ public static final int SIG_ECDSA_BRAINPOOLP384R1TLS13_SHA384 = 0X081B;
+ public static final int SIG_ECDSA_BRAINPOOLP512R1TLS13_SHA512 = 0X081C;
+
+ /**
+ * Returns whether the TLS cipher suite id is supported
+ */
+ public static boolean isTlsCipherSuiteSupported(int csId) {
+ return Arrays.binarySearch(CS_EXPECTED, csId) >= 0;
+ }
+}
diff --git a/telephony/java/android/telephony/gba/UaSecurityProtocolIdentifier.aidl b/telephony/java/android/telephony/gba/UaSecurityProtocolIdentifier.aidl
new file mode 100644
index 0000000..a71e860
--- /dev/null
+++ b/telephony/java/android/telephony/gba/UaSecurityProtocolIdentifier.aidl
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2020 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.telephony.gba;
+
+parcelable UaSecurityProtocolIdentifier;
diff --git a/telephony/java/android/telephony/gba/UaSecurityProtocolIdentifier.java b/telephony/java/android/telephony/gba/UaSecurityProtocolIdentifier.java
new file mode 100644
index 0000000..c141875
--- /dev/null
+++ b/telephony/java/android/telephony/gba/UaSecurityProtocolIdentifier.java
@@ -0,0 +1,436 @@
+/*
+ * Copyright (C) 2020 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.telephony.gba;
+
+import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.SystemApi;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.telephony.gba.TlsParams.TlsCipherSuite;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.nio.ByteBuffer;
+import java.util.Objects;
+
+/**
+ * Description of ua security protocol identifier defined in 3GPP TS 33.220 H.2
+ * @hide
+ */
+@SystemApi
+public final class UaSecurityProtocolIdentifier implements Parcelable {
+
+ /**
+ * Organization code defined in 3GPP TS 33.220 H.3
+ *
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = {"ORG_"}, value = {
+ ORG_NONE,
+ ORG_3GPP,
+ ORG_3GPP2,
+ ORG_OMA,
+ ORG_GSMA,
+ ORG_LOCAL})
+ public @interface OrganizationCode {}
+
+ /**
+ * Organization octet value for default ua security protocol
+ */
+ public static final int ORG_NONE = 0;
+ /**
+ * Organization octet value for 3GPP ua security protocol
+ */
+ public static final int ORG_3GPP = 0x01;
+ /**
+ * Organization octet value for 3GPP2 ua security protocol
+ */
+ public static final int ORG_3GPP2 = 0x02;
+ /**
+ * Organization octet value for OMA ua security protocol
+ */
+ public static final int ORG_OMA = 0x03;
+ /**
+ * Organization octet value for GSMA ua security protocol
+ */
+ public static final int ORG_GSMA = 0x04;
+ /**
+ * Internal organization octet value for local/experimental protocols
+ */
+ public static final int ORG_LOCAL = 0xFF;
+
+ /**
+ * 3GPP UA Security Protocol ID defined in 3GPP TS 33.220 H.3
+ *
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(prefix = {"UA_SECURITY_PROTOCOL_3GPP_"}, value = {
+ UA_SECURITY_PROTOCOL_3GPP_SUBSCRIBER_CERTIFICATE,
+ UA_SECURITY_PROTOCOL_3GPP_MBMS,
+ UA_SECURITY_PROTOCOL_3GPP_HTTP_DIGEST_AUTHENTICATION,
+ UA_SECURITY_PROTOCOL_3GPP_HTTP_BASED_MBMS,
+ UA_SECURITY_PROTOCOL_3GPP_SIP_BASED_MBMS,
+ UA_SECURITY_PROTOCOL_3GPP_GENERIC_PUSH_LAYER,
+ UA_SECURITY_PROTOCOL_3GPP_IMS_MEDIA_PLANE,
+ UA_SECURITY_PROTOCOL_3GPP_GENERATION_TMPI,
+ UA_SECURITY_PROTOCOL_3GPP_TLS_DEFAULT,
+ UA_SECURITY_PROTOCOL_3GPP_TLS_BROWSER})
+ public @interface UaSecurityProtocol3gpp {}
+
+ /**
+ * Security protocol param according to TS 33.221 as described in TS
+ * 33.220 Annex H. Mapped to byte stream "0x01,0x00,0x00,0x00,0x00".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_SUBSCRIBER_CERTIFICATE = 0;
+
+ /**
+ * Security protocol param according to TS 33.246 for Multimedia
+ * broadcast/Multimedia services (MBMS) as described in TS
+ * 33.220 Annex H. Mapped to byte stream "0x01,0x00,0x00,0x00,0x01".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_MBMS = 1;
+
+ /**
+ * Security protocol param based on HTTP digest authentication
+ * according to TS 24.109 as described in TS 33.220 Annex H. Mapped to
+ * byte stream "0x01,0x00,0x00,0x00,0x02".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_HTTP_DIGEST_AUTHENTICATION = 2;
+
+ /**
+ * Security protocol param used with HTTP-based security procedures for
+ * Multimedia broadcast/Multimedia services (MBMS) user services
+ * according to TS 26.237 as described in TS 33.220 Annex H.
+ * Mapped to byte stream "0x01,0x00,0x00,0x00,0x03".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_HTTP_BASED_MBMS = 3;
+
+ /**
+ * Security protocol param used with SIP-based security procedures for
+ * Multimedia broadcast/Multimedia services (MBMS) user services
+ * according to TS 26.237 as described in TS 33.220 Annex H.
+ * Mapped to byte stream "0x01,0x00,0x00,0x00,0x04".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_SIP_BASED_MBMS = 4;
+
+ /**
+ * Security protocol param used with Generic Push Layer according to TS
+ * 33.224 as described in TS 33.220 Annex H. Mapped to byte stream
+ * "0x01,0x00,0x00,0x00,0x05".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_GENERIC_PUSH_LAYER = 5;
+
+ /**
+ * Security protocol param used for IMS UE to KMS http based message
+ * exchanges according to "IMS media plane security", TS 33.328 as
+ * described in TS 33.220 Annex H. Mapped to byte stream
+ * "0x01,0x00,0x00,0x00,0x06".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_IMS_MEDIA_PLANE = 6;
+
+ /**
+ * Security protocol param used for Generation of Temporary IP
+ * Multimedia Private Identity (TMPI) according to TS 33.220 Annex B.4
+ * Mapped to byte stream "0x01,0x00,0x00,0x01,0x00".
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_GENERATION_TMPI = 0x0100;
+
+ /**
+ * Security protocol param used for Shared key-based UE authentication with
+ * certificate-based NAF authentication, according to TS 33.222 section 5.3,
+ * or Shared key-based mutual authentication between UE and NAF, according to
+ * TS 33.222 section 5.4. Mapped to byte stream "0x01,0x00,0x01,yy,zz".
+ * "yy, zz" is the TLS CipherSuite code.
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_TLS_DEFAULT = 0x010000;
+
+ /**
+ * Security protocol param used for Shared key-based UE authentication with
+ * certificate-based NAF authentication, according to TS 33.222 Annex D.
+ * Mapped to byte stream "0x01,0x00,0x02,yy,zz".
+ * "yy, zz" is the TLS CipherSuite code.
+ */
+ public static final int UA_SECURITY_PROTOCOL_3GPP_TLS_BROWSER = 0x020000;
+
+ private static final int PROTOCOL_SIZE = 5;
+ private static final int[] sUaSp3gppIds = new int[] {
+ UA_SECURITY_PROTOCOL_3GPP_SUBSCRIBER_CERTIFICATE,
+ UA_SECURITY_PROTOCOL_3GPP_MBMS,
+ UA_SECURITY_PROTOCOL_3GPP_HTTP_DIGEST_AUTHENTICATION,
+ UA_SECURITY_PROTOCOL_3GPP_HTTP_BASED_MBMS,
+ UA_SECURITY_PROTOCOL_3GPP_SIP_BASED_MBMS,
+ UA_SECURITY_PROTOCOL_3GPP_GENERIC_PUSH_LAYER,
+ UA_SECURITY_PROTOCOL_3GPP_IMS_MEDIA_PLANE,
+ UA_SECURITY_PROTOCOL_3GPP_GENERATION_TMPI,
+ UA_SECURITY_PROTOCOL_3GPP_TLS_DEFAULT,
+ UA_SECURITY_PROTOCOL_3GPP_TLS_BROWSER};
+
+ private int mOrg;
+ private int mProtocol;
+ private int mTlsCipherSuite;
+
+ private UaSecurityProtocolIdentifier() {}
+
+ private UaSecurityProtocolIdentifier(UaSecurityProtocolIdentifier sp) {
+ mOrg = sp.mOrg;
+ mProtocol = sp.mProtocol;
+ mTlsCipherSuite = sp.mTlsCipherSuite;
+ }
+
+ /**
+ * Returns the byte array representing the ua security protocol
+ */
+ @NonNull
+ public byte[] toByteArray() {
+ byte[] data = new byte[PROTOCOL_SIZE];
+ ByteBuffer buf = ByteBuffer.wrap(data);
+ buf.put((byte) mOrg);
+ buf.putInt(mProtocol | mTlsCipherSuite);
+ return data;
+ }
+
+ /**
+ * Returns the organization code
+ */
+ public @OrganizationCode int getOrg() {
+ return mOrg;
+ }
+
+ /**
+ * Returns the security procotol id
+ *
+ * <p>Note that only 3GPP UA Security Protocols are supported for now
+ */
+ public @UaSecurityProtocol3gpp int getProtocol() {
+ return mProtocol;
+ }
+
+ /**
+ * Returns the TLS cipher suite
+ */
+ public @TlsCipherSuite int getTlsCipherSuite() {
+ return mTlsCipherSuite;
+ }
+
+ /**
+ * {@link Parcelable#writeToParcel}
+ */
+ @Override
+ public void writeToParcel(@NonNull Parcel out, int flags) {
+ out.writeInt(mOrg);
+ out.writeInt(mProtocol);
+ out.writeInt(mTlsCipherSuite);
+ }
+
+ /**
+ * {@link Parcelable.Creator}
+ *
+ */
+ public static final @NonNull Parcelable.Creator<
+ UaSecurityProtocolIdentifier> CREATOR = new Creator<UaSecurityProtocolIdentifier>() {
+ @Nullable
+ @Override
+ public UaSecurityProtocolIdentifier createFromParcel(Parcel in) {
+ int org = in.readInt();
+ int protocol = in.readInt();
+ int cs = in.readInt();
+ if (org < 0 || protocol < 0 || cs < 0) {
+ return null;
+ }
+ Builder builder = new Builder();
+ try {
+ if (org > 0) {
+ builder.setOrg(org);
+ }
+ if (protocol > 0) {
+ builder.setProtocol(protocol);
+ }
+ if (cs > 0) {
+ builder.setTlsCipherSuite(cs);
+ }
+ } catch (IllegalArgumentException e) {
+ return null;
+ }
+ return builder.build();
+ }
+
+ @NonNull
+ @Override
+ public UaSecurityProtocolIdentifier[] newArray(int size) {
+ return new UaSecurityProtocolIdentifier[size];
+ }
+ };
+
+ /**
+ * {@link Parcelable#describeContents}
+ */
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public String toString() {
+ return "UaSecurityProtocolIdentifier[" + mOrg + " , " + (mProtocol | mTlsCipherSuite) + "]";
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof UaSecurityProtocolIdentifier)) {
+ return false;
+ }
+
+ UaSecurityProtocolIdentifier other = (UaSecurityProtocolIdentifier) obj;
+
+ return mOrg == other.mOrg && mProtocol == other.mProtocol
+ && mTlsCipherSuite == other.mTlsCipherSuite;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mOrg, mProtocol, mTlsCipherSuite);
+ }
+
+ private boolean isTlsSupported() {
+ //TODO May update to support non 3gpp protocol in the future
+ if (mOrg == ORG_3GPP && (mProtocol == UA_SECURITY_PROTOCOL_3GPP_TLS_DEFAULT
+ || mProtocol == UA_SECURITY_PROTOCOL_3GPP_TLS_BROWSER)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Builder class for UaSecurityProtocolIdentifier
+ */
+ public static final class Builder {
+ private final UaSecurityProtocolIdentifier mSp;
+
+ /**
+ * Creates a Builder with default UaSecurityProtocolIdentifier, a.k.a 0x00 00 00 00 00
+ */
+ public Builder() {
+ mSp = new UaSecurityProtocolIdentifier();
+ }
+
+ /**
+ * Creates a Builder from a UaSecurityProtocolIdentifier
+ */
+ public Builder(@NonNull final UaSecurityProtocolIdentifier sp) {
+ Objects.requireNonNull(sp);
+ mSp = new UaSecurityProtocolIdentifier(sp);
+ }
+
+ /**
+ * Sets the organization code
+ *
+ * @param orgCode the organization code with the following value
+ * <ol>
+ * <li>{@link #ORG_NONE} </li>
+ * <li>{@link #ORG_3GPP} </li>
+ * <li>{@link #ORG_3GPP2} </li>
+ * <li>{@link #ORG_OMA} </li>
+ * <li>{@link #ORG_GSMA} </li>
+ * <li>{@link #ORG_LOCAL} </li>
+ * </ol>
+ * @throws IllegalArgumentException if it is not one of the value above.
+ *
+ * <p>Note that this method will reset the security protocol and TLS cipher suite
+ * if they have been set.
+ */
+ @NonNull
+ public Builder setOrg(@OrganizationCode int orgCode) {
+ if (orgCode < ORG_NONE || orgCode > ORG_LOCAL) {
+ throw new IllegalArgumentException("illegal organization code");
+ }
+ mSp.mOrg = orgCode;
+ mSp.mProtocol = 0;
+ mSp.mTlsCipherSuite = 0;
+ return this;
+ }
+
+ /**
+ * Sets the UA security protocol for 3GPP
+ *
+ * @param protocol only 3GPP ua security protocol ID is supported for now, which
+ * is one of the following value
+ * <ol>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_SUBSCRIBER_CERTIFICATE} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_MBMS} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_HTTP_DIGEST_AUTHENTICATION} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_HTTP_BASED_MBMS} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_SIP_BASED_MBMS} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_GENERIC_PUSH_LAYER} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_IMS_MEDIA_PLANE} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_GENERATION_TMPI} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_TLS_DEFAULT} </li>
+ * <li>{@link #UA_SECURITY_PROTOCOL_3GPP_TLS_BROWSER} </li>
+ * </ol>
+ * @throws IllegalArgumentException if the protocol is not one of the value above.
+ *
+ * <p>Note that this method will reset TLS cipher suite if it has been set.
+ */
+ @NonNull
+ public Builder setProtocol(@UaSecurityProtocol3gpp int protocol) {
+ //TODO May update to support non 3gpp protocol in the future
+ if (protocol < UA_SECURITY_PROTOCOL_3GPP_SUBSCRIBER_CERTIFICATE
+ || (protocol > UA_SECURITY_PROTOCOL_3GPP_IMS_MEDIA_PLANE
+ && protocol != UA_SECURITY_PROTOCOL_3GPP_GENERATION_TMPI
+ && protocol != UA_SECURITY_PROTOCOL_3GPP_TLS_DEFAULT
+ && protocol != UA_SECURITY_PROTOCOL_3GPP_TLS_BROWSER)
+ || mSp.mOrg != ORG_3GPP) {
+ throw new IllegalArgumentException("illegal protocol code");
+ }
+ mSp.mProtocol = protocol;
+ mSp.mTlsCipherSuite = 0;
+ return this;
+ }
+
+ /**
+ * Sets the UA security protocol for 3GPP
+ *
+ * @param cs TLS cipher suite value defined by {@link TlsParams#TlsCipherSuite}
+ * @throws IllegalArgumentException if it is not a 3GPP ua security protocol,
+ * the protocol does not support TLS, or does not support the cipher suite.
+ */
+ @NonNull
+ public Builder setTlsCipherSuite(@TlsCipherSuite int cs) {
+ if (!mSp.isTlsSupported()) {
+ throw new IllegalArgumentException("The protocol does not support TLS");
+ }
+ if (!TlsParams.isTlsCipherSuiteSupported(cs)) {
+ throw new IllegalArgumentException("TLS cipher suite is not supported");
+ }
+ mSp.mTlsCipherSuite = cs;
+ return this;
+ }
+
+ /**
+ * Builds the instance of UaSecurityProtocolIdentifier
+ *
+ * @return the built instance of UaSecurityProtocolIdentifier
+ */
+ @NonNull
+ public UaSecurityProtocolIdentifier build() {
+ return new UaSecurityProtocolIdentifier(mSp);
+ }
+ }
+}
diff --git a/telephony/java/android/telephony/gsm/OWNERS b/telephony/java/android/telephony/gsm/OWNERS
new file mode 100644
index 0000000..6aa399d
--- /dev/null
+++ b/telephony/java/android/telephony/gsm/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+amitmahajan@google.com
diff --git a/telephony/java/android/telephony/ims/DelegateRegistrationState.java b/telephony/java/android/telephony/ims/DelegateRegistrationState.java
index 3558a9b..66281ed 100644
--- a/telephony/java/android/telephony/ims/DelegateRegistrationState.java
+++ b/telephony/java/android/telephony/ims/DelegateRegistrationState.java
@@ -62,7 +62,8 @@
/**
* This feature tag is being deregistered because the PDN that the IMS registration is on is
*changing.
- * All open SIP dialogs need to be closed before the PDN change can proceed.
+ * All open SIP dialogs need to be closed before the PDN change can proceed using
+ * {@link SipDelegateConnection#closeDialog(String)}.
*/
public static final int DEREGISTERING_REASON_PDN_CHANGE = 3;
@@ -73,7 +74,8 @@
* a user triggered hange, such as data being enabled/disabled.
* <p>
* All open SIP dialogs associated with the new deprovisioned feature tag need to be closed
- * before the IMS registration modification can proceed.
+ * using {@link SipDelegateConnection#closeDialog(String)} before the IMS registration
+ * modification can proceed.
*/
public static final int DEREGISTERING_REASON_PROVISIONING_CHANGE = 4;
@@ -81,8 +83,8 @@
* This feature tag is deregistering because the SipDelegate associated with this feature tag
* needs to change its supported feature set.
* <p>
- * All open SIP Dialogs associated with this feature tag must be closed before this operation
- * can proceed.
+ * All open SIP Dialogs associated with this feature tag must be closed
+ * using {@link SipDelegateConnection#closeDialog(String)} before this operation can proceed.
*/
public static final int DEREGISTERING_REASON_FEATURE_TAGS_CHANGING = 5;
@@ -90,8 +92,8 @@
* This feature tag is deregistering because the SipDelegate is in the process of being
* destroyed.
* <p>
- * All open SIP Dialogs associated with this feature tag must be closed before this operation
- * can proceed.
+ * All open SIP Dialogs associated with this feature tag must be closed
+ * using {@link SipDelegateConnection#closeDialog(String)} before this operation can proceed.
*/
public static final int DEREGISTERING_REASON_DESTROY_PENDING = 6;
diff --git a/telephony/java/android/telephony/ims/OWNERS b/telephony/java/android/telephony/ims/OWNERS
new file mode 100644
index 0000000..0854c5d
--- /dev/null
+++ b/telephony/java/android/telephony/ims/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
diff --git a/telephony/java/android/telephony/ims/SipDelegateConnection.java b/telephony/java/android/telephony/ims/SipDelegateConnection.java
index c3cc1ed..04a772c 100644
--- a/telephony/java/android/telephony/ims/SipDelegateConnection.java
+++ b/telephony/java/android/telephony/ims/SipDelegateConnection.java
@@ -62,6 +62,22 @@
void notifyMessageReceived(@NonNull String viaTransactionId);
/**
+ * The SIP Dialog associated with the provided Call-ID is being closed and routing resources
+ * associated with the SIP dialog are free to be released.
+ * <p>
+ * Calling this method is also mandatory for situations where the framework IMS stack is waiting
+ * for pending SIP dialogs to be closed before it can perform a handover or apply a provisioning
+ * change. See {@link DelegateRegistrationState} for more information about
+ * the scenarios where this can occur.
+ * <p>
+ * This method will need to be called for each SIP dialog managed by this application when it is
+ * closed.
+ * @param callId The call-ID header value associated with the ongoing SIP Dialog that is
+ * closing.
+ */
+ void closeDialog(@NonNull String callId);
+
+ /**
* Notify the SIP delegate that the SIP message has been received from
* {@link DelegateMessageCallback#onMessageReceived(SipMessage)}, however there was an error
* processing it.
diff --git a/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl b/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
index 5d6766a6..ad75be4 100644
--- a/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
+++ b/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
@@ -26,7 +26,5 @@
void sendMessage(in SipMessage sipMessage, long configVersion);
void notifyMessageReceived(in String viaTransactionId);
void notifyMessageReceiveError(in String viaTransactionId, int reason);
-
- // only used by SipDelegate.
void closeDialog(in String callId);
}
diff --git a/telephony/java/android/telephony/ims/aidl/OWNERS b/telephony/java/android/telephony/ims/aidl/OWNERS
new file mode 100644
index 0000000..0854c5d
--- /dev/null
+++ b/telephony/java/android/telephony/ims/aidl/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
diff --git a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
index 29ba8e2..a35039b 100644
--- a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
+++ b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
@@ -199,6 +199,19 @@
}
}
+ @Override
+ public void closeDialog(String callId) {
+ try {
+ ISipDelegate conn = getSipDelegateBinder();
+ if (conn == null) {
+ return;
+ }
+ conn.closeDialog(callId);
+ } catch (RemoteException e) {
+ // Nothing to do here, app will eventually get remote death callback.
+ }
+ }
+
// Also called upon IImsRcsController death (telephony process dies).
@Override
public void binderDied() {
diff --git a/telephony/java/android/telephony/ims/compat/OWNERS b/telephony/java/android/telephony/ims/compat/OWNERS
new file mode 100644
index 0000000..0854c5d
--- /dev/null
+++ b/telephony/java/android/telephony/ims/compat/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
diff --git a/telephony/java/android/telephony/ims/compat/feature/OWNERS b/telephony/java/android/telephony/ims/compat/feature/OWNERS
new file mode 100644
index 0000000..0854c5d
--- /dev/null
+++ b/telephony/java/android/telephony/ims/compat/feature/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
diff --git a/telephony/java/android/telephony/ims/compat/stub/OWNERS b/telephony/java/android/telephony/ims/compat/stub/OWNERS
new file mode 100644
index 0000000..0854c5d
--- /dev/null
+++ b/telephony/java/android/telephony/ims/compat/stub/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
diff --git a/telephony/java/android/telephony/ims/feature/OWNERS b/telephony/java/android/telephony/ims/feature/OWNERS
new file mode 100644
index 0000000..0854c5d
--- /dev/null
+++ b/telephony/java/android/telephony/ims/feature/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
diff --git a/telephony/java/android/telephony/ims/stub/OWNERS b/telephony/java/android/telephony/ims/stub/OWNERS
new file mode 100644
index 0000000..0854c5d
--- /dev/null
+++ b/telephony/java/android/telephony/ims/stub/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+breadley@google.com
diff --git a/telephony/java/android/telephony/ims/stub/SipDelegate.java b/telephony/java/android/telephony/ims/stub/SipDelegate.java
index d7e7b62..b036b5e 100644
--- a/telephony/java/android/telephony/ims/stub/SipDelegate.java
+++ b/telephony/java/android/telephony/ims/stub/SipDelegate.java
@@ -19,7 +19,9 @@
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.telephony.ims.DelegateMessageCallback;
+import android.telephony.ims.DelegateRegistrationState;
import android.telephony.ims.ImsService;
+import android.telephony.ims.SipDelegateConnection;
import android.telephony.ims.SipDelegateImsConfiguration;
import android.telephony.ims.SipDelegateManager;
import android.telephony.ims.SipMessage;
@@ -65,10 +67,13 @@
* The framework is requesting that routing resources associated with the SIP dialog using the
* provided Call-ID to be cleaned up.
* <p>
- * Typically a SIP Dialog close event will be signalled by that dialog receiving a BYE or 200 OK
- * message, however, in some cases, the framework will request that the ImsService close the
+ * Typically, a SIP Dialog close event will be signalled by that dialog receiving a BYE or
+ * 200 OK message, however, the IMS application will still call
+ * {@link SipDelegateConnection#closeDialog(String)} to signal to the framework that resources
+ * can be released. In some cases, the framework will request that the ImsService close the
* dialog due to the open dialog holding up an event such as applying a provisioning change or
- * handing over to another transport type.
+ * handing over to another transport type. See {@link DelegateRegistrationState}.
+ *
* @param callId The call-ID header value associated with the ongoing SIP Dialog that the
* framework is requesting be closed.
*/
diff --git a/telephony/java/android/telephony/mbms/OWNERS b/telephony/java/android/telephony/mbms/OWNERS
new file mode 100644
index 0000000..718e0a2
--- /dev/null
+++ b/telephony/java/android/telephony/mbms/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+hallliu@google.com
diff --git a/telephony/java/android/telephony/mbms/vendor/OWNERS b/telephony/java/android/telephony/mbms/vendor/OWNERS
new file mode 100644
index 0000000..718e0a2
--- /dev/null
+++ b/telephony/java/android/telephony/mbms/vendor/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 20868
+
+rgreenwalt@google.com
+tgunn@google.com
+hallliu@google.com
diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
index 09f9b42..ce2017b 100644
--- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
+++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl
@@ -216,5 +216,6 @@
* @param data authentication challenge data
* @return challenge response
*/
- String getIccSimChallengeResponse(int subId, int appType, int authType, String data);
+ String getIccSimChallengeResponse(int subId, int appType, int authType, String data,
+ String callingPackage, String callingFeatureId);
}
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 5d4fdd0..2da45ca 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -37,6 +37,8 @@
import android.telephony.CellInfo;
import android.telephony.ClientRequestStats;
import android.telephony.ThermalMitigationRequest;
+import android.telephony.gba.UaSecurityProtocolIdentifier;
+import android.telephony.IBootstrapAuthenticationCallback;
import android.telephony.IccOpenLogicalChannelResponse;
import android.telephony.ICellInfoCallback;
import android.telephony.ModemActivityInfo;
@@ -1674,10 +1676,19 @@
* @param slotIndex SIM slot id
* @param state State of SIM (power down, power up, pass through)
* @hide
- * */
+ */
void setSimPowerStateForSlot(int slotIndex, int state);
/**
+ * Set SIM card power state.
+ * @param slotIndex SIM slot id
+ * @param state State of SIM (power down, power up, pass through)
+ * @param callback callback to receive result info
+ * @hide
+ */
+ void setSimPowerStateForSlotWithCallback(int slotIndex, int state, IIntegerConsumer callback);
+
+ /**
* Returns a list of Forbidden PLMNs from the specified SIM App
* Returns null if the query fails.
*
@@ -2273,4 +2284,31 @@
*/
int sendThermalMitigationRequest(int subId,
in ThermalMitigationRequest thermalMitigationRequest);
+
+ /**
+ * get the Generic Bootstrapping Architecture authentication keys
+ */
+ void bootstrapAuthenticationRequest(int subId, int appType, in Uri nafUrl,
+ in UaSecurityProtocolIdentifier securityProtocol,
+ boolean forceBootStrapping, IBootstrapAuthenticationCallback callback);
+
+ /**
+ * Set the GbaService Package Name that Telephony will bind to.
+ */
+ boolean setBoundGbaServiceOverride(int subId, String packageName);
+
+ /**
+ * Return the package name of the currently bound GbaService.
+ */
+ String getBoundGbaService(int subId);
+
+ /**
+ * Set the release time for telephony to unbind GbaService.
+ */
+ boolean setGbaReleaseTimeOverride(int subId, int interval);
+
+ /**
+ * Return the release time for telephony to unbind GbaService.
+ */
+ int getGbaReleaseTime(int subId);
}
diff --git a/test-mock/src/android/test/mock/OWNERS b/test-mock/src/android/test/mock/OWNERS
new file mode 100644
index 0000000..36d9cb2
--- /dev/null
+++ b/test-mock/src/android/test/mock/OWNERS
@@ -0,0 +1 @@
+set noparent
diff --git a/tests/ActivityManagerPerfTests/OWNERS b/tests/ActivityManagerPerfTests/OWNERS
new file mode 100644
index 0000000..72c0a9e
--- /dev/null
+++ b/tests/ActivityManagerPerfTests/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/am/OWNERS
diff --git a/tests/AmSlam/OWNERS b/tests/AmSlam/OWNERS
new file mode 100644
index 0000000..72c0a9e
--- /dev/null
+++ b/tests/AmSlam/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/am/OWNERS
diff --git a/tests/BlobStoreTestUtils/OWNERS b/tests/BlobStoreTestUtils/OWNERS
new file mode 100644
index 0000000..65bb6b8
--- /dev/null
+++ b/tests/BlobStoreTestUtils/OWNERS
@@ -0,0 +1 @@
+include /apex/blobstore/OWNERS
diff --git a/tests/Camera2Tests/OWNERS b/tests/Camera2Tests/OWNERS
new file mode 100644
index 0000000..f48a95c
--- /dev/null
+++ b/tests/Camera2Tests/OWNERS
@@ -0,0 +1 @@
+include platform/frameworks/av:/camera/OWNERS
diff --git a/tests/CanvasCompare/OWNERS b/tests/CanvasCompare/OWNERS
new file mode 100644
index 0000000..c88a9f8
--- /dev/null
+++ b/tests/CanvasCompare/OWNERS
@@ -0,0 +1 @@
+include /libs/hwui/OWNERS
diff --git a/tests/Compatibility/OWNERS b/tests/Compatibility/OWNERS
new file mode 100644
index 0000000..f8c3520
--- /dev/null
+++ b/tests/Compatibility/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/compat/OWNERS
diff --git a/tests/DozeTest/OWNERS b/tests/DozeTest/OWNERS
new file mode 100644
index 0000000..2e96c97
--- /dev/null
+++ b/tests/DozeTest/OWNERS
@@ -0,0 +1 @@
+include /packages/SystemUI/OWNERS
diff --git a/tests/FixVibrateSetting/OWNERS b/tests/FixVibrateSetting/OWNERS
new file mode 100644
index 0000000..cc63ceb
--- /dev/null
+++ b/tests/FixVibrateSetting/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/vibrator/OWNERS
diff --git a/tests/FlickerTests/OWNERS b/tests/FlickerTests/OWNERS
new file mode 100644
index 0000000..f35a318
--- /dev/null
+++ b/tests/FlickerTests/OWNERS
@@ -0,0 +1,2 @@
+include /services/core/java/com/android/server/wm/OWNERS
+natanieljr@google.com
\ No newline at end of file
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
index bb03237..bd7e8d7 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
@@ -48,11 +48,12 @@
}
fun WmAssertion.visibleWindowsShownMoreThanOneConsecutiveEntry(
+ ignoreWindows: List<String> = emptyList(),
bugId: Int = 0,
enabled: Boolean = bugId == 0
) {
- all("visibleWindowShownMoreThanOneConsecutiveEntry", bugId, enabled) {
- this.visibleWindowsShownMoreThanOneConsecutiveEntry()
+ all("visibleWindowsShownMoreThanOneConsecutiveEntry", bugId, enabled) {
+ this.visibleWindowsShownMoreThanOneConsecutiveEntry(ignoreWindows)
}
}
@@ -204,11 +205,12 @@
}
fun LayersAssertion.visibleLayersShownMoreThanOneConsecutiveEntry(
+ ignoreLayers: List<String> = emptyList(),
bugId: Int = 0,
enabled: Boolean = bugId == 0
) {
all("visibleLayersShownMoreThanOneConsecutiveEntry", bugId, enabled) {
- this.visibleLayersShownMoreThanOneConsecutiveEntry()
+ this.visibleLayersShownMoreThanOneConsecutiveEntry(ignoreLayers)
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt
index f4de36e..3565ca4 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt
@@ -22,6 +22,7 @@
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
+import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import org.junit.Assert
open class ImeAppHelper(
@@ -38,7 +39,7 @@
Assert.assertNotNull("Text field not found, this usually happens when the device " +
"was left in an unknown state (e.g. in split screen)", editText)
editText.click()
- if (!device.waitForIME()) {
+ if (!WindowManagerStateHelper().waitImeWindowShown()) {
Assert.fail("IME did not appear")
}
}
@@ -46,6 +47,8 @@
open fun closeIME(device: UiDevice) {
device.pressBack()
// Using only the AccessibilityInfo it is not possible to identify if the IME is active
- device.waitForIdle(1000)
+ if (!WindowManagerStateHelper().waitImeWindowGone()) {
+ Assert.fail("IME did not close")
+ }
}
}
\ No newline at end of file
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt
index a73264d..b341e62 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt
@@ -27,6 +27,8 @@
import com.android.server.wm.flicker.helpers.buildTestTag
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
@@ -66,8 +68,10 @@
withTag { buildTestTag("imeToAppAutoOpen", testApp, configuration) }
repeat { configuration.repetitions }
setup {
- eachRun {
+ test {
device.wakeUpAndGoToHomeScreen()
+ }
+ eachRun {
this.setRotation(configuration.startRotation)
testApp.open()
testApp.openIME(device)
@@ -80,14 +84,15 @@
}
}
transitions {
- device.pressBack()
- device.waitForIdle()
+ testApp.closeIME(device)
}
assertions {
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
- imeAppWindowIsAlwaysVisible(testApp, bugId = 141458352)
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod"))
+
+ imeAppWindowIsAlwaysVisible(testApp)
}
layersTrace {
@@ -96,8 +101,10 @@
noUncoveredRegions(configuration.startRotation)
navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry()
+
imeLayerBecomesInvisible(bugId = 141458352)
- imeAppLayerIsAlwaysVisible(testApp, bugId = 141458352)
+ imeAppLayerIsAlwaysVisible(testApp)
}
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
index 6cc2e22..51a4ca8 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
@@ -27,6 +27,8 @@
import com.android.server.wm.flicker.helpers.buildTestTag
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
@@ -68,8 +70,10 @@
}
repeat { configuration.repetitions }
setup {
- eachRun {
+ test {
device.wakeUpAndGoToHomeScreen()
+ }
+ eachRun {
this.setRotation(configuration.startRotation)
testApp.open()
testApp.openIME(device)
@@ -89,6 +93,8 @@
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeWindowBecomesInvisible(bugId = 141458352)
imeAppWindowBecomesInvisible(testApp, bugId = 157449248)
}
@@ -100,10 +106,14 @@
Surface.ROTATION_0, bugId = 140855415)
statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0)
- navBarLayerIsAlwaysVisible(enabled = false)
- statusBarLayerIsAlwaysVisible(enabled = false)
+ navBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ statusBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeLayerBecomesInvisible(bugId = 141458352)
- imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
+ imeAppLayerBecomesInvisible(testApp)
}
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
index 136cf86..663d456 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
@@ -31,6 +31,8 @@
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
@@ -65,8 +67,10 @@
withTestName { buildTestTag("imeToApp", testApp, configuration) }
repeat { configuration.repetitions }
setup {
- eachRun {
+ test {
device.wakeUpAndGoToHomeScreen()
+ }
+ eachRun {
this.setRotation(configuration.startRotation)
testApp.open()
testApp.openIME(device)
@@ -79,13 +83,14 @@
}
}
transitions {
- device.pressBack()
- device.waitForIdle()
+ testApp.closeIME(device)
}
assertions {
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod"))
+
imeAppWindowIsAlwaysVisible(testApp)
}
@@ -95,6 +100,8 @@
noUncoveredRegions(configuration.startRotation)
navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry()
+
imeLayerBecomesInvisible(enabled = false)
imeAppLayerIsAlwaysVisible(testApp)
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
index 8d9881e..bfe5264 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
@@ -33,6 +33,8 @@
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
@@ -95,6 +97,8 @@
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeWindowBecomesInvisible()
imeAppWindowBecomesInvisible(testApp)
}
@@ -106,10 +110,14 @@
Surface.ROTATION_0, bugId = 140855415)
statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0)
- navBarLayerIsAlwaysVisible(enabled = false)
- statusBarLayerIsAlwaysVisible(enabled = false)
+ navBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ statusBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeLayerBecomesInvisible(bugId = 153739621)
- imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
+ imeAppLayerBecomesInvisible(testApp)
}
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt
index 5767a94..64a8f30 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt
@@ -30,6 +30,8 @@
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.noUncoveredRegions
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
@@ -89,6 +91,7 @@
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry()
all("imeWindowBecomesVisible") {
this.skipUntilFirstAssertion()
@@ -104,6 +107,7 @@
noUncoveredRegions(configuration.startRotation)
navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry()
imeLayerBecomesVisible()
}
diff --git a/tests/HugeBackup/OWNERS b/tests/HugeBackup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/tests/HugeBackup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/tests/HwAccelerationTest/OWNERS b/tests/HwAccelerationTest/OWNERS
new file mode 100644
index 0000000..c88a9f8
--- /dev/null
+++ b/tests/HwAccelerationTest/OWNERS
@@ -0,0 +1 @@
+include /libs/hwui/OWNERS
diff --git a/tests/Input/OWNERS b/tests/Input/OWNERS
new file mode 100644
index 0000000..d701f23
--- /dev/null
+++ b/tests/Input/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/hardware/input/OWNERS
diff --git a/tests/JobSchedulerPerfTests/OWNERS b/tests/JobSchedulerPerfTests/OWNERS
new file mode 100644
index 0000000..6f207fb1
--- /dev/null
+++ b/tests/JobSchedulerPerfTests/OWNERS
@@ -0,0 +1 @@
+include /apex/jobscheduler/OWNERS
diff --git a/tests/JobSchedulerTestApp/OWNERS b/tests/JobSchedulerTestApp/OWNERS
new file mode 100644
index 0000000..6f207fb1
--- /dev/null
+++ b/tests/JobSchedulerTestApp/OWNERS
@@ -0,0 +1 @@
+include /apex/jobscheduler/OWNERS
diff --git a/tests/LocationTracker/OWNERS b/tests/LocationTracker/OWNERS
new file mode 100644
index 0000000..5ac6028
--- /dev/null
+++ b/tests/LocationTracker/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/location/OWNERS
diff --git a/tests/LowStorageTest/OWNERS b/tests/LowStorageTest/OWNERS
new file mode 100644
index 0000000..6f9dbea
--- /dev/null
+++ b/tests/LowStorageTest/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/os/storage/OWNERS
diff --git a/tests/NetworkSecurityConfigTest/OWNERS b/tests/NetworkSecurityConfigTest/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/tests/NetworkSecurityConfigTest/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/tests/PackageWatchdog/OWNERS b/tests/PackageWatchdog/OWNERS
new file mode 100644
index 0000000..d04a706
--- /dev/null
+++ b/tests/PackageWatchdog/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/rollback/OWNERS
diff --git a/tests/PackageWatchdog/src/com/android/server/OWNERS b/tests/PackageWatchdog/src/com/android/server/OWNERS
new file mode 100644
index 0000000..5cf4dcf
--- /dev/null
+++ b/tests/PackageWatchdog/src/com/android/server/OWNERS
@@ -0,0 +1 @@
+per-file PackageWatchdogTest.java = file:/services/core/java/com/android/server/rollback/OWNERS
diff --git a/tests/PlatformCompatGating/OWNERS b/tests/PlatformCompatGating/OWNERS
new file mode 100644
index 0000000..f8c3520
--- /dev/null
+++ b/tests/PlatformCompatGating/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/compat/OWNERS
diff --git a/tests/RollbackTest/OWNERS b/tests/RollbackTest/OWNERS
new file mode 100644
index 0000000..d04a706
--- /dev/null
+++ b/tests/RollbackTest/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/rollback/OWNERS
diff --git a/tests/SoundTriggerTestApp/OWNERS b/tests/SoundTriggerTestApp/OWNERS
new file mode 100644
index 0000000..816bc6b
--- /dev/null
+++ b/tests/SoundTriggerTestApp/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/media/soundtrigger/OWNERS
diff --git a/tests/SoundTriggerTests/OWNERS b/tests/SoundTriggerTests/OWNERS
new file mode 100644
index 0000000..816bc6b
--- /dev/null
+++ b/tests/SoundTriggerTests/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/media/soundtrigger/OWNERS
diff --git a/tests/StagedInstallTest/OWNERS b/tests/StagedInstallTest/OWNERS
new file mode 100644
index 0000000..d825dfd
--- /dev/null
+++ b/tests/StagedInstallTest/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/pm/OWNERS
diff --git a/tests/StatusBar/OWNERS b/tests/StatusBar/OWNERS
new file mode 100644
index 0000000..2e96c97
--- /dev/null
+++ b/tests/StatusBar/OWNERS
@@ -0,0 +1 @@
+include /packages/SystemUI/OWNERS
diff --git a/tests/TaskOrganizerTest/OWNERS b/tests/TaskOrganizerTest/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/tests/TaskOrganizerTest/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/tests/TelephonyCommonTests/OWNERS b/tests/TelephonyCommonTests/OWNERS
new file mode 100644
index 0000000..640baf2
--- /dev/null
+++ b/tests/TelephonyCommonTests/OWNERS
@@ -0,0 +1 @@
+include /telephony/OWNERS
diff --git a/tests/UsageReportingTest/OWNERS b/tests/UsageReportingTest/OWNERS
new file mode 100644
index 0000000..d3227de
--- /dev/null
+++ b/tests/UsageReportingTest/OWNERS
@@ -0,0 +1 @@
+include /services/usage/OWNERS
diff --git a/tests/UsageStatsPerfTests/OWNERS b/tests/UsageStatsPerfTests/OWNERS
new file mode 100644
index 0000000..d3227de
--- /dev/null
+++ b/tests/UsageStatsPerfTests/OWNERS
@@ -0,0 +1 @@
+include /services/usage/OWNERS
diff --git a/tests/UsageStatsTest/OWNERS b/tests/UsageStatsTest/OWNERS
new file mode 100644
index 0000000..d3227de
--- /dev/null
+++ b/tests/UsageStatsTest/OWNERS
@@ -0,0 +1 @@
+include /services/usage/OWNERS
diff --git a/tests/UsbHostExternalManagmentTest/OWNERS b/tests/UsbHostExternalManagmentTest/OWNERS
new file mode 100644
index 0000000..f7b2a37
--- /dev/null
+++ b/tests/UsbHostExternalManagmentTest/OWNERS
@@ -0,0 +1 @@
+include /services/usb/OWNERS
diff --git a/tests/UsbManagerTests/OWNERS b/tests/UsbManagerTests/OWNERS
new file mode 100644
index 0000000..f7b2a37
--- /dev/null
+++ b/tests/UsbManagerTests/OWNERS
@@ -0,0 +1 @@
+include /services/usb/OWNERS
diff --git a/tests/UsbTests/OWNERS b/tests/UsbTests/OWNERS
new file mode 100644
index 0000000..f7b2a37
--- /dev/null
+++ b/tests/UsbTests/OWNERS
@@ -0,0 +1 @@
+include /services/usb/OWNERS
diff --git a/tests/VoiceInteraction/OWNERS b/tests/VoiceInteraction/OWNERS
new file mode 100644
index 0000000..ef1061b
--- /dev/null
+++ b/tests/VoiceInteraction/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/voice/OWNERS
diff --git a/tests/WindowAnimationJank/OWNERS b/tests/WindowAnimationJank/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/tests/WindowAnimationJank/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/tests/WindowInsetsTests/OWNERS b/tests/WindowInsetsTests/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/tests/WindowInsetsTests/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/tests/backup/OWNERS b/tests/backup/OWNERS
new file mode 100644
index 0000000..d99779e
--- /dev/null
+++ b/tests/backup/OWNERS
@@ -0,0 +1 @@
+include /services/backup/OWNERS
diff --git a/tests/benchmarks/src/com/android/server/net/OWNERS b/tests/benchmarks/src/com/android/server/net/OWNERS
new file mode 100644
index 0000000..aa87958
--- /dev/null
+++ b/tests/benchmarks/src/com/android/server/net/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/net/OWNERS
diff --git a/tests/net/common/java/android/net/LinkAddressTest.java b/tests/net/common/java/android/net/LinkAddressTest.java
index 60308e3..1eaf30c 100644
--- a/tests/net/common/java/android/net/LinkAddressTest.java
+++ b/tests/net/common/java/android/net/LinkAddressTest.java
@@ -68,8 +68,8 @@
private static final String V4 = "192.0.2.1";
private static final String V6 = "2001:db8::1";
- private static final InetAddress V4_ADDRESS = NetworkUtils.numericToInetAddress(V4);
- private static final InetAddress V6_ADDRESS = NetworkUtils.numericToInetAddress(V6);
+ private static final InetAddress V4_ADDRESS = InetAddresses.parseNumericAddress(V4);
+ private static final InetAddress V6_ADDRESS = InetAddresses.parseNumericAddress(V6);
@Test
public void testConstants() {
@@ -131,10 +131,10 @@
ipv6Loopback = new LinkAddress(addrs.get(0));
}
- assertEquals(NetworkUtils.numericToInetAddress("127.0.0.1"), ipv4Loopback.getAddress());
+ assertEquals(InetAddresses.parseNumericAddress("127.0.0.1"), ipv4Loopback.getAddress());
assertEquals(8, ipv4Loopback.getPrefixLength());
- assertEquals(NetworkUtils.numericToInetAddress("::1"), ipv6Loopback.getAddress());
+ assertEquals(InetAddresses.parseNumericAddress("::1"), ipv6Loopback.getAddress());
assertEquals(128, ipv6Loopback.getPrefixLength());
// Null addresses are rejected.
diff --git a/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java b/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java
index 2a24d1a..3d4dc4d 100644
--- a/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java
+++ b/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java
@@ -29,7 +29,7 @@
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.fail;
import android.content.Context;
import android.net.ConnectivityManager;
@@ -38,7 +38,6 @@
import android.net.NetworkAgent;
import android.net.NetworkAgentConfig;
import android.net.NetworkCapabilities;
-import android.net.NetworkInfo;
import android.net.NetworkProvider;
import android.net.NetworkSpecifier;
import android.net.SocketKeepalive;
@@ -53,9 +52,9 @@
import com.android.testutils.TestableNetworkCallback;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
public class NetworkAgentWrapper implements TestableNetworkCallback.HasNetwork {
- private final NetworkInfo mNetworkInfo;
private final NetworkCapabilities mNetworkCapabilities;
private final HandlerThread mHandlerThread;
private final Context mContext;
@@ -63,6 +62,7 @@
private final ConditionVariable mDisconnected = new ConditionVariable();
private final ConditionVariable mPreventReconnectReceived = new ConditionVariable();
+ private final AtomicBoolean mConnected = new AtomicBoolean(false);
private int mScore;
private NetworkAgent mNetworkAgent;
private int mStartKeepaliveError = SocketKeepalive.ERROR_UNSUPPORTED;
@@ -76,7 +76,6 @@
NetworkCapabilities ncTemplate, Context context) throws Exception {
final int type = transportToLegacyType(transport);
final String typeName = ConnectivityManager.getNetworkTypeName(type);
- mNetworkInfo = new NetworkInfo(type, 0, typeName, "Mock");
mNetworkCapabilities = (ncTemplate != null) ? ncTemplate : new NetworkCapabilities();
mNetworkCapabilities.addCapability(NET_CAPABILITY_NOT_SUSPENDED);
mNetworkCapabilities.addTransportType(transport);
@@ -108,22 +107,29 @@
mHandlerThread = new HandlerThread(mLogTag);
mHandlerThread.start();
- mNetworkAgent = makeNetworkAgent(linkProperties);
+ mNetworkAgent = makeNetworkAgent(linkProperties, type, typeName);
}
- protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties)
+ protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties,
+ final int type, final String typeName)
throws Exception {
- return new InstrumentedNetworkAgent(this, linkProperties);
+ return new InstrumentedNetworkAgent(this, linkProperties, type, typeName);
}
public static class InstrumentedNetworkAgent extends NetworkAgent {
private final NetworkAgentWrapper mWrapper;
+ private static final String PROVIDER_NAME = "InstrumentedNetworkAgentProvider";
- public InstrumentedNetworkAgent(NetworkAgentWrapper wrapper, LinkProperties lp) {
- super(wrapper.mHandlerThread.getLooper(), wrapper.mContext, wrapper.mLogTag,
- wrapper.mNetworkInfo, wrapper.mNetworkCapabilities, lp, wrapper.mScore,
- new NetworkAgentConfig(), NetworkProvider.ID_NONE);
+ public InstrumentedNetworkAgent(NetworkAgentWrapper wrapper, LinkProperties lp,
+ final int type, final String typeName) {
+ super(wrapper.mContext, wrapper.mHandlerThread.getLooper(), wrapper.mLogTag,
+ wrapper.mNetworkCapabilities, lp, wrapper.mScore,
+ new NetworkAgentConfig.Builder()
+ .setLegacyType(type).setLegacyTypeName(typeName).build(),
+ new NetworkProvider(wrapper.mContext, wrapper.mHandlerThread.getLooper(),
+ PROVIDER_NAME));
mWrapper = wrapper;
+ register();
}
@Override
@@ -212,10 +218,12 @@
}
public void connect() {
- assertNotEquals("MockNetworkAgents can only be connected once",
- mNetworkInfo.getDetailedState(), NetworkInfo.DetailedState.CONNECTED);
- mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, null, null);
- mNetworkAgent.sendNetworkInfo(mNetworkInfo);
+ if (!mConnected.compareAndSet(false /* expect */, true /* update */)) {
+ // compareAndSet returns false when the value couldn't be updated because it did not
+ // match the expected value.
+ fail("Test NetworkAgents can only be connected once");
+ }
+ mNetworkAgent.markConnected();
}
public void suspend() {
@@ -227,8 +235,7 @@
}
public void disconnect() {
- mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null, null);
- mNetworkAgent.sendNetworkInfo(mNetworkInfo);
+ mNetworkAgent.unregister();
}
@Override
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index 059e054..b3bdd60 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -18,6 +18,7 @@
import static android.Manifest.permission.CHANGE_NETWORK_STATE;
import static android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS;
+import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.content.Intent.ACTION_USER_ADDED;
import static android.content.Intent.ACTION_USER_REMOVED;
import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_GRANTED;
@@ -181,13 +182,13 @@
import android.net.NetworkStackClient;
import android.net.NetworkState;
import android.net.NetworkTestResultParcelable;
-import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.ResolverParamsParcel;
import android.net.RouteInfo;
import android.net.RouteInfoParcel;
import android.net.SocketKeepalive;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.Uri;
import android.net.VpnManager;
import android.net.metrics.IpConnectivityLog;
@@ -646,8 +647,8 @@
}
@Override
- protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties)
- throws Exception {
+ protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties,
+ final int type, final String typeName) throws Exception {
mNetworkMonitor = mock(INetworkMonitor.class);
final Answer validateAnswer = inv -> {
@@ -666,7 +667,8 @@
any() /* name */,
nmCbCaptor.capture());
- final InstrumentedNetworkAgent na = new InstrumentedNetworkAgent(this, linkProperties) {
+ final InstrumentedNetworkAgent na = new InstrumentedNetworkAgent(this, linkProperties,
+ type, typeName) {
@Override
public void networkStatus(int status, String redirectUrl) {
mRedirectUrl = redirectUrl;
@@ -1054,7 +1056,7 @@
public MockVpn(int userId) {
super(startHandlerThreadAndReturnLooper(), mServiceContext, mNetworkManagementService,
- userId, mock(KeyStore.class));
+ mMockNetd, userId, mock(KeyStore.class));
mConfig = new VpnConfig();
}
@@ -1093,10 +1095,11 @@
mMockNetworkAgent = new TestNetworkAgentWrapper(TRANSPORT_VPN, lp,
mNetworkCapabilities);
mMockNetworkAgent.waitForIdle(TIMEOUT_MS);
- verify(mNetworkManagementService, times(1))
- .addVpnUidRanges(eq(mMockVpn.getNetId()), eq(uids.toArray(new UidRange[0])));
- verify(mNetworkManagementService, never())
- .removeVpnUidRanges(eq(mMockVpn.getNetId()), any());
+
+ verify(mMockNetd, times(1)).networkAddUidRanges(eq(mMockVpn.getNetId()),
+ eq(toUidRangeStableParcels(uids)));
+ verify(mMockNetd, never())
+ .networkRemoveUidRanges(eq(mMockVpn.getNetId()), any());
mAgentRegistered = true;
mNetworkCapabilities.set(mMockNetworkAgent.getNetworkCapabilities());
mNetworkAgent = mMockNetworkAgent.getNetworkAgent();
@@ -1168,6 +1171,11 @@
}
}
+ private UidRangeParcel[] toUidRangeStableParcels(final @NonNull Set<UidRange> ranges) {
+ return ranges.stream().map(
+ r -> new UidRangeParcel(r.start, r.stop)).toArray(UidRangeParcel[]::new);
+ }
+
private void mockVpn(int uid) {
synchronized (mService.mVpns) {
int userId = UserHandle.getUserId(uid);
@@ -1958,7 +1966,7 @@
}
@Test
- public void testOwnerUidChangeBug() throws Exception {
+ public void testOwnerUidCannotChange() throws Exception {
// Owner UIDs are not visible without location permission.
setupLocationPermissions(Build.VERSION_CODES.Q, true, AppOpsManager.OPSTR_FINE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION);
@@ -1973,39 +1981,19 @@
waitForIdle();
// Send ConnectivityService an update to the mWiFiNetworkAgent's capabilities that changes
- // its owner UID.
+ // the owner UID and an unrelated capability.
NetworkCapabilities agentCapabilities = mWiFiNetworkAgent.getNetworkCapabilities();
assertEquals(originalOwnerUid, agentCapabilities.getOwnerUid());
agentCapabilities.setOwnerUid(42);
- mWiFiNetworkAgent.setNetworkCapabilities(agentCapabilities, true);
- waitForIdle();
-
- // Check that the owner UID is not updated.
- NetworkCapabilities nc = mCm.getNetworkCapabilities(mWiFiNetworkAgent.getNetwork());
- assertEquals(originalOwnerUid, nc.getOwnerUid());
-
- // Make an unrelated change to the capabilities.
assertFalse(agentCapabilities.hasCapability(NET_CAPABILITY_NOT_CONGESTED));
agentCapabilities.addCapability(NET_CAPABILITY_NOT_CONGESTED);
mWiFiNetworkAgent.setNetworkCapabilities(agentCapabilities, true);
waitForIdle();
- // Check that both the capability change and the owner UID have been modified.
- // The owner UID is -1 because it is visible only to the UID that owns the network.
- nc = mCm.getNetworkCapabilities(mWiFiNetworkAgent.getNetwork());
- assertEquals(-1, nc.getOwnerUid());
- assertTrue(nc.hasCapability(NET_CAPABILITY_NOT_CONGESTED));
-
- // Set the owner back to originalOwnerUid, update the capabilities, and check that it is
- // visible again.
- // TODO: should this even be possible?
- agentCapabilities.setOwnerUid(originalOwnerUid);
- agentCapabilities.removeCapability(NET_CAPABILITY_NOT_CONGESTED);
- mWiFiNetworkAgent.setNetworkCapabilities(agentCapabilities, true);
- waitForIdle();
-
- nc = mCm.getNetworkCapabilities(mWiFiNetworkAgent.getNetwork());
+ // Check that the capability change has been applied but the owner UID is not modified.
+ NetworkCapabilities nc = mCm.getNetworkCapabilities(mWiFiNetworkAgent.getNetwork());
assertEquals(originalOwnerUid, nc.getOwnerUid());
+ assertTrue(nc.hasCapability(NET_CAPABILITY_NOT_CONGESTED));
}
@Test
@@ -2568,10 +2556,8 @@
@Test
public void testNoMutableNetworkRequests() throws Exception {
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent("a"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ final PendingIntent pendingIntent = PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, new Intent("a"), FLAG_IMMUTABLE);
NetworkRequest request1 = new NetworkRequest.Builder()
.addCapability(NET_CAPABILITY_VALIDATED)
.build();
@@ -3231,21 +3217,17 @@
assertThrows(SecurityException.class, () ->
mCm.registerNetworkCallback(r, new NetworkCallback()));
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
assertThrows(SecurityException.class, () ->
mCm.registerNetworkCallback(r, PendingIntent.getService(
- mServiceContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED)));
+ mServiceContext, 0 /* requestCode */, new Intent(), FLAG_IMMUTABLE)));
// Requesting a Network with signal strength should get IllegalArgumentException.
assertThrows(IllegalArgumentException.class, () ->
mCm.requestNetwork(r, new NetworkCallback()));
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
assertThrows(IllegalArgumentException.class, () ->
mCm.requestNetwork(r, PendingIntent.getService(
- mServiceContext, 0, new Intent(), PendingIntent.FLAG_MUTABLE_UNAUDITED)));
+ mServiceContext, 0 /* requestCode */, new Intent(), FLAG_IMMUTABLE)));
}
@Test
@@ -4709,16 +4691,14 @@
}
j = 0;
while (j++ < INTENTS / 2) {
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, new Intent("a" + j), PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ final PendingIntent pi = PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("a" + j), FLAG_IMMUTABLE);
mCm.requestNetwork(networkRequest, pi);
registered.add(pi);
}
while (j++ < INTENTS) {
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, new Intent("b" + j), PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ final PendingIntent pi = PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("b" + j), FLAG_IMMUTABLE);
mCm.registerNetworkCallback(networkRequest, pi);
registered.add(pi);
}
@@ -4732,15 +4712,13 @@
);
assertThrows(TooManyRequestsException.class, () ->
mCm.requestNetwork(networkRequest,
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent.getBroadcast(mContext, 0, new Intent("c"), PendingIntent.FLAG_MUTABLE_UNAUDITED))
+ PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("c"), FLAG_IMMUTABLE))
);
assertThrows(TooManyRequestsException.class, () ->
mCm.registerNetworkCallback(networkRequest,
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent.getBroadcast(mContext, 0, new Intent("d"), PendingIntent.FLAG_MUTABLE_UNAUDITED))
+ PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("d"), FLAG_IMMUTABLE))
);
for (Object o : registered) {
@@ -4769,20 +4747,16 @@
waitForIdle();
for (int i = 0; i < MAX_REQUESTS; i++) {
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent pendingIntent =
- PendingIntent.getBroadcast(mContext, 0, new Intent("e" + i), PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ final PendingIntent pendingIntent = PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, new Intent("e" + i), FLAG_IMMUTABLE);
mCm.requestNetwork(networkRequest, pendingIntent);
mCm.unregisterNetworkCallback(pendingIntent);
}
waitForIdle();
for (int i = 0; i < MAX_REQUESTS; i++) {
- // TODO(b/173157160) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent pendingIntent =
- PendingIntent.getBroadcast(mContext, 0, new Intent("f" + i), PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ final PendingIntent pendingIntent = PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, new Intent("f" + i), FLAG_IMMUTABLE);
mCm.registerNetworkCallback(networkRequest, pendingIntent);
mCm.unregisterNetworkCallback(pendingIntent);
}
@@ -4860,7 +4834,7 @@
lp.setInterfaceName(WIFI_IFNAME);
LinkAddress myIpv4Address = new LinkAddress("192.168.12.3/24");
RouteInfo myIpv4DefaultRoute = new RouteInfo((IpPrefix) null,
- NetworkUtils.numericToInetAddress("192.168.12.1"), lp.getInterfaceName());
+ InetAddresses.parseNumericAddress("192.168.12.1"), lp.getInterfaceName());
lp.addLinkAddress(myIpv4Address);
lp.addRoute(myIpv4DefaultRoute);
@@ -4980,8 +4954,8 @@
expectForceUpdateIfaces(onlyCell, MOBILE_IFNAME);
reset(mStatsService);
- // Captive portal change shouldn't update ifaces
- mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL);
+ // Temp metered change shouldn't update ifaces
+ mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_TEMPORARILY_NOT_METERED);
waitForIdle();
verify(mStatsService, never())
.forceUpdateIfaces(eq(onlyCell), any(NetworkState[].class), eq(MOBILE_IFNAME),
@@ -5497,6 +5471,7 @@
final Network wifi = mWiFiNetworkAgent.getNetwork();
final NetworkCapabilities initialCaps = new NetworkCapabilities();
+ initialCaps.addTransportType(TRANSPORT_VPN);
initialCaps.addCapability(NET_CAPABILITY_INTERNET);
initialCaps.removeCapability(NET_CAPABILITY_NOT_VPN);
@@ -5528,44 +5503,45 @@
withWifiAndMobileUnderlying.setLinkDownstreamBandwidthKbps(10);
withWifiAndMobileUnderlying.setLinkUpstreamBandwidthKbps(20);
+ final NetworkCapabilities initialCapsNotMetered = new NetworkCapabilities(initialCaps);
+ initialCapsNotMetered.addCapability(NET_CAPABILITY_NOT_METERED);
+
NetworkCapabilities caps = new NetworkCapabilities(initialCaps);
- final boolean notDeclaredMetered = false;
- mService.applyUnderlyingCapabilities(new Network[]{}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{}, initialCapsNotMetered, caps);
assertEquals(withNoUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{null}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{null}, initialCapsNotMetered, caps);
assertEquals(withNoUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{mobile}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{mobile}, initialCapsNotMetered, caps);
assertEquals(withMobileUnderlying, caps);
- mService.applyUnderlyingCapabilities(new Network[]{wifi}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{wifi}, initialCapsNotMetered, caps);
assertEquals(withWifiUnderlying, caps);
- final boolean isDeclaredMetered = true;
withWifiUnderlying.removeCapability(NET_CAPABILITY_NOT_METERED);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{wifi}, caps, isDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{wifi}, initialCaps, caps);
assertEquals(withWifiUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{mobile, wifi}, caps, isDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{mobile, wifi}, initialCaps, caps);
assertEquals(withWifiAndMobileUnderlying, caps);
withWifiUnderlying.addCapability(NET_CAPABILITY_NOT_METERED);
caps = new NetworkCapabilities(initialCaps);
mService.applyUnderlyingCapabilities(new Network[]{null, mobile, null, wifi},
- caps, notDeclaredMetered);
+ initialCapsNotMetered, caps);
assertEquals(withWifiAndMobileUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
mService.applyUnderlyingCapabilities(new Network[]{null, mobile, null, wifi},
- caps, notDeclaredMetered);
+ initialCapsNotMetered, caps);
assertEquals(withWifiAndMobileUnderlying, caps);
- mService.applyUnderlyingCapabilities(null, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(null, initialCapsNotMetered, caps);
assertEquals(withWifiUnderlying, caps);
}
diff --git a/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java b/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java
index 529d03c..799bcc8 100644
--- a/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java
+++ b/tests/net/java/com/android/server/IpSecServiceParameterizedTest.java
@@ -34,6 +34,7 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.INetd;
+import android.net.InetAddresses;
import android.net.IpSecAlgorithm;
import android.net.IpSecConfig;
import android.net.IpSecManager;
@@ -44,7 +45,6 @@
import android.net.IpSecUdpEncapResponse;
import android.net.LinkAddress;
import android.net.Network;
-import android.net.NetworkUtils;
import android.os.Binder;
import android.os.INetworkManagementService;
import android.os.ParcelFileDescriptor;
@@ -272,7 +272,7 @@
IpSecSpiResponse spi =
mIpSecService.allocateSecurityParameterIndex(
- NetworkUtils.numericToInetAddress(remoteAddress).getHostAddress(),
+ InetAddresses.parseNumericAddress(remoteAddress).getHostAddress(),
IpSecManager.INVALID_SECURITY_PARAMETER_INDEX,
new Binder());
return spi.resourceId;
diff --git a/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java b/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
index c53462c..950d7163 100644
--- a/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
+++ b/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
@@ -130,6 +130,7 @@
when(mContext.getResources()).thenReturn(mResources);
when(mContext.getApplicationInfo()).thenReturn(new ApplicationInfo());
+ // Mock user id to all users that Context#registerReceiver will register with all users too.
doReturn(UserHandle.ALL.getIdentifier()).when(mUserAllContext).getUserId();
when(mContext.createContextAsUser(eq(UserHandle.ALL), anyInt()))
.thenReturn(mUserAllContext);
diff --git a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
index de35f91..3556c72 100644
--- a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
+++ b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
@@ -58,7 +58,6 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
-import android.content.pm.UserInfo;
import android.net.INetd;
import android.net.UidRange;
import android.os.Build;
@@ -123,10 +122,10 @@
MockitoAnnotations.initMocks(this);
when(mContext.getPackageManager()).thenReturn(mPackageManager);
when(mContext.getSystemService(eq(Context.USER_SERVICE))).thenReturn(mUserManager);
- when(mUserManager.getAliveUsers()).thenReturn(
- Arrays.asList(new UserInfo[] {
- new UserInfo(MOCK_USER1, "", 0),
- new UserInfo(MOCK_USER2, "", 0),
+ when(mUserManager.getUserHandles(eq(true))).thenReturn(
+ Arrays.asList(new UserHandle[] {
+ new UserHandle(MOCK_USER1),
+ new UserHandle(MOCK_USER2),
}));
mPermissionMonitor = spy(new PermissionMonitor(mContext, mNetdService, mDeps));
diff --git a/tests/net/java/com/android/server/connectivity/VpnTest.java b/tests/net/java/com/android/server/connectivity/VpnTest.java
index 337507a..6e380be 100644
--- a/tests/net/java/com/android/server/connectivity/VpnTest.java
+++ b/tests/net/java/com/android/server/connectivity/VpnTest.java
@@ -58,6 +58,7 @@
import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.net.ConnectivityManager;
+import android.net.INetd;
import android.net.Ikev2VpnProfile;
import android.net.InetAddresses;
import android.net.IpPrefix;
@@ -70,6 +71,7 @@
import android.net.NetworkInfo.DetailedState;
import android.net.RouteInfo;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.VpnManager;
import android.net.VpnService;
import android.net.ipsec.ike.IkeSessionCallback;
@@ -172,11 +174,13 @@
mPackages.put(PKGS[i], PKG_UIDS[i]);
}
}
+ private static final UidRange PRI_USER_RANGE = UidRange.createForUser(primaryUser.id);
@Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mContext;
@Mock private UserManager mUserManager;
@Mock private PackageManager mPackageManager;
@Mock private INetworkManagementService mNetService;
+ @Mock private INetd mNetd;
@Mock private AppOpsManager mAppOps;
@Mock private NotificationManager mNotificationManager;
@Mock private Vpn.SystemServices mSystemServices;
@@ -256,8 +260,7 @@
null, null);
assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] {
- UidRange.createForUser(primaryUser.id),
- UidRange.createForUser(restrictedProfileA.id)
+ PRI_USER_RANGE, UidRange.createForUser(restrictedProfileA.id)
})), ranges);
}
@@ -269,9 +272,7 @@
final Set<UidRange> ranges = vpn.createUserAndRestrictedProfilesRanges(primaryUser.id,
null, null);
- assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] {
- UidRange.createForUser(primaryUser.id)
- })), ranges);
+ assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] { PRI_USER_RANGE })), ranges);
}
@Test
@@ -282,15 +283,13 @@
final Set<UidRange> ranges = new ArraySet<>();
vpn.addUserToRanges(ranges, primaryUser.id, null, null);
- assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] {
- UidRange.createForUser(primaryUser.id)
- })), ranges);
+ assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] { PRI_USER_RANGE })), ranges);
}
@Test
public void testUidAllowAndDenylist() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
final String[] packages = {PKGS[0], PKGS[1], PKGS[2]};
// Allowed list
@@ -339,62 +338,67 @@
@Test
public void testLockdownChangingPackage() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
// Default state.
- assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1], user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
+ assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1],
+ user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
// Set always-on without lockdown.
assertTrue(vpn.setAlwaysOnPackage(PKGS[1], false, null, mKeyStore));
- assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1], user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
+ assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1],
+ user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
// Set always-on with lockdown.
assertTrue(vpn.setAlwaysOnPackage(PKGS[1], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
- assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
+
+ assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[2],
+ user.start + PKG_UIDS[3]);
assertUnblocked(vpn, user.start + PKG_UIDS[1]);
// Switch to another app.
assertTrue(vpn.setAlwaysOnPackage(PKGS[3], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
- assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1], user.start + PKG_UIDS[2]);
+ assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1],
+ user.start + PKG_UIDS[2]);
assertUnblocked(vpn, user.start + PKG_UIDS[3]);
}
@Test
public void testLockdownAllowlist() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
// Set always-on with lockdown and allow app PKGS[2] from lockdown.
assertTrue(vpn.setAlwaysOnPackage(
PKGS[1], true, Collections.singletonList(PKGS[2]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[2] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[2] + 1, user.stop)
}));
assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[3]);
assertUnblocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[2]);
-
// Change allowed app list to PKGS[3].
assertTrue(vpn.setAlwaysOnPackage(
PKGS[1], true, Collections.singletonList(PKGS[3]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[2] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[2] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[2]);
assertUnblocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[3]);
@@ -402,25 +406,25 @@
// Change the VPN app.
assertTrue(vpn.setAlwaysOnPackage(
PKGS[0], true, Collections.singletonList(PKGS[3]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[0] - 1),
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[0] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1)
}));
assertBlocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[2]);
assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[3]);
// Remove the list of allowed packages.
assertTrue(vpn.setAlwaysOnPackage(PKGS[0], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.stop),
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.stop),
}));
assertBlocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[2],
user.start + PKG_UIDS[3]);
@@ -429,12 +433,12 @@
// Add the list of allowed packages.
assertTrue(vpn.setAlwaysOnPackage(
PKGS[0], true, Collections.singletonList(PKGS[1]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
assertBlocked(vpn, user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1]);
@@ -447,13 +451,13 @@
// allowed package should change from PGKS[1] to PKGS[2].
assertTrue(vpn.setAlwaysOnPackage(
PKGS[0], true, Arrays.asList("com.foo.app", PKGS[2], "com.bar.app"), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[]{
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[]{
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[]{
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[2] - 1),
- new UidRange(user.start + PKG_UIDS[2] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[]{
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[2] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[2] + 1, user.stop)
}));
}
@@ -467,86 +471,86 @@
restrictedProfileA.flags);
tempProfile.restrictedProfileParentId = primaryUser.id;
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
final UidRange profile = UidRange.createForUser(tempProfile.id);
// Set lockdown.
assertTrue(vpn.setAlwaysOnPackage(PKGS[3], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
-
// Verify restricted user isn't affected at first.
assertUnblocked(vpn, profile.start + PKG_UIDS[0]);
// Add the restricted user.
setMockedUsers(primaryUser, tempProfile);
vpn.onUserAdded(tempProfile.id);
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(profile.start, profile.start + PKG_UIDS[3] - 1),
- new UidRange(profile.start + PKG_UIDS[3] + 1, profile.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(profile.start, profile.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(profile.start + PKG_UIDS[3] + 1, profile.stop)
}));
// Remove the restricted user.
tempProfile.partial = true;
vpn.onUserRemoved(tempProfile.id);
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(profile.start, profile.start + PKG_UIDS[3] - 1),
- new UidRange(profile.start + PKG_UIDS[3] + 1, profile.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(profile.start, profile.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(profile.start + PKG_UIDS[3] + 1, profile.stop)
}));
}
@Test
public void testLockdownRuleRepeatability() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
-
+ final UidRangeParcel[] primaryUserRangeParcel = new UidRangeParcel[] {
+ new UidRangeParcel(PRI_USER_RANGE.start, PRI_USER_RANGE.stop)};
// Given legacy lockdown is already enabled,
vpn.setLockdown(true);
- verify(mNetService, times(1)).setAllowOnlyVpnForUids(
- eq(true), aryEq(new UidRange[] {UidRange.createForUser(primaryUser.id)}));
+
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(primaryUserRangeParcel));
// Enabling legacy lockdown twice should do nothing.
vpn.setLockdown(true);
- verify(mNetService, times(1)).setAllowOnlyVpnForUids(anyBoolean(), any(UidRange[].class));
+ verify(mNetd, times(1))
+ .networkRejectNonSecureVpn(anyBoolean(), any(UidRangeParcel[].class));
// And disabling should remove the rules exactly once.
vpn.setLockdown(false);
- verify(mNetService, times(1)).setAllowOnlyVpnForUids(
- eq(false), aryEq(new UidRange[] {UidRange.createForUser(primaryUser.id)}));
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(primaryUserRangeParcel));
// Removing the lockdown again should have no effect.
vpn.setLockdown(false);
- verify(mNetService, times(2)).setAllowOnlyVpnForUids(anyBoolean(), any(UidRange[].class));
+ verify(mNetd, times(2)).networkRejectNonSecureVpn(
+ anyBoolean(), any(UidRangeParcel[].class));
}
@Test
public void testLockdownRuleReversibility() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
-
- final UidRange[] entireUser = {
- UidRange.createForUser(primaryUser.id)
+ final UidRangeParcel[] entireUser = {
+ new UidRangeParcel(PRI_USER_RANGE.start, PRI_USER_RANGE.stop)
};
- final UidRange[] exceptPkg0 = {
- new UidRange(entireUser[0].start, entireUser[0].start + PKG_UIDS[0] - 1),
- new UidRange(entireUser[0].start + PKG_UIDS[0] + 1, entireUser[0].stop)
+ final UidRangeParcel[] exceptPkg0 = {
+ new UidRangeParcel(entireUser[0].start, entireUser[0].start + PKG_UIDS[0] - 1),
+ new UidRangeParcel(entireUser[0].start + PKG_UIDS[0] + 1, entireUser[0].stop)
};
- final InOrder order = inOrder(mNetService);
+ final InOrder order = inOrder(mNetd);
// Given lockdown is enabled with no package (legacy VPN),
vpn.setLockdown(true);
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(entireUser));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(entireUser));
// When a new VPN package is set the rules should change to cover that package.
vpn.prepare(null, PKGS[0], VpnManager.TYPE_VPN_SERVICE);
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(entireUser));
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(exceptPkg0));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(entireUser));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(exceptPkg0));
// When that VPN package is unset, everything should be undone again in reverse.
vpn.prepare(null, VpnConfig.LEGACY_VPN, VpnManager.TYPE_VPN_SERVICE);
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(exceptPkg0));
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(entireUser));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(exceptPkg0));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(entireUser));
}
@Test
@@ -1186,7 +1190,7 @@
.thenReturn(asUserContext);
final TestLooper testLooper = new TestLooper();
final Vpn vpn = new Vpn(testLooper.getLooper(), mContext, new TestDeps(), mNetService,
- userId, mKeyStore, mSystemServices, mIkev2SessionCreator);
+ mNetd, userId, mKeyStore, mSystemServices, mIkev2SessionCreator);
verify(mConnectivityManager, times(1)).registerNetworkProvider(argThat(
provider -> provider.getName().contains("VpnNetworkProvider")
));
diff --git a/tests/notification/OWNERS b/tests/notification/OWNERS
new file mode 100644
index 0000000..396fd12
--- /dev/null
+++ b/tests/notification/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/notification/OWNERS
diff --git a/tests/permission/OWNERS b/tests/permission/OWNERS
new file mode 100644
index 0000000..999ea0e
--- /dev/null
+++ b/tests/permission/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/permission/OWNERS
diff --git a/tests/utils/DummyIME/OWNERS b/tests/utils/DummyIME/OWNERS
new file mode 100644
index 0000000..5deb2ce
--- /dev/null
+++ b/tests/utils/DummyIME/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/inputmethod/OWNERS
diff --git a/tests/utils/StubIME/OWNERS b/tests/utils/StubIME/OWNERS
new file mode 100644
index 0000000..5deb2ce
--- /dev/null
+++ b/tests/utils/StubIME/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/inputmethod/OWNERS
diff --git a/tests/utils/hostutils/src/com/android/tests/rollback/OWNERS b/tests/utils/hostutils/src/com/android/tests/rollback/OWNERS
new file mode 100644
index 0000000..d04a706
--- /dev/null
+++ b/tests/utils/hostutils/src/com/android/tests/rollback/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/rollback/OWNERS
diff --git a/tests/utils/testutils/java/com/android/server/accessibility/OWNERS b/tests/utils/testutils/java/com/android/server/accessibility/OWNERS
new file mode 100644
index 0000000..b74281e
--- /dev/null
+++ b/tests/utils/testutils/java/com/android/server/accessibility/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/view/accessibility/OWNERS
diff --git a/tests/utils/testutils/java/com/android/server/wm/OWNERS b/tests/utils/testutils/java/com/android/server/wm/OWNERS
new file mode 100644
index 0000000..0862c05
--- /dev/null
+++ b/tests/utils/testutils/java/com/android/server/wm/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/wm/OWNERS
diff --git a/tools/aapt/OWNERS b/tools/aapt/OWNERS
new file mode 100644
index 0000000..c232ccd
--- /dev/null
+++ b/tools/aapt/OWNERS
@@ -0,0 +1 @@
+include /tools/aapt2/OWNERS
diff --git a/tools/fonts/OWNERS b/tools/fonts/OWNERS
new file mode 100644
index 0000000..a538331
--- /dev/null
+++ b/tools/fonts/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/graphics/fonts/OWNERS
diff --git a/tools/incident_report/OWNERS b/tools/incident_report/OWNERS
new file mode 100644
index 0000000..f766115
--- /dev/null
+++ b/tools/incident_report/OWNERS
@@ -0,0 +1 @@
+include /cmds/incidentd/OWNERS
diff --git a/tools/incident_section_gen/OWNERS b/tools/incident_section_gen/OWNERS
new file mode 100644
index 0000000..f766115
--- /dev/null
+++ b/tools/incident_section_gen/OWNERS
@@ -0,0 +1 @@
+include /cmds/incidentd/OWNERS
diff --git a/tools/powerstats/OWNERS b/tools/powerstats/OWNERS
new file mode 100644
index 0000000..d68066b
--- /dev/null
+++ b/tools/powerstats/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/power/OWNERS
diff --git a/tools/stats_log_api_gen/OWNERS b/tools/stats_log_api_gen/OWNERS
new file mode 100644
index 0000000..41a0c95
--- /dev/null
+++ b/tools/stats_log_api_gen/OWNERS
@@ -0,0 +1 @@
+yro@google.com
diff --git a/wifi/Android.bp b/wifi/Android.bp
index 7a9ca60..c05f52c 100644
--- a/wifi/Android.bp
+++ b/wifi/Android.bp
@@ -43,6 +43,7 @@
srcs: [
":framework-wifi-updatable-java-sources",
":framework-wifi-updatable-exported-aidl-sources",
+ ":module-utils-os-aidls",
],
}
@@ -85,13 +86,14 @@
"framework-wifi-util-lib",
"android.hardware.wifi-V1.0-java-constants",
"modules-utils-build",
+ "modules-utils-os",
],
libs: [
"unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage
],
srcs: [
":framework-wifi-updatable-sources",
- ":framework-wifi-util-lib-aidls",
+ ":module-utils-os-aidls",
],
}
diff --git a/wifi/api/current.txt b/wifi/api/current.txt
index e11b33e..4b0d38d 100644
--- a/wifi/api/current.txt
+++ b/wifi/api/current.txt
@@ -35,6 +35,7 @@
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.ScanResult> CREATOR;
field public String SSID;
field public static final int WIFI_STANDARD_11AC = 5; // 0x5
+ field public static final int WIFI_STANDARD_11AD = 7; // 0x7
field public static final int WIFI_STANDARD_11AX = 6; // 0x6
field public static final int WIFI_STANDARD_11N = 4; // 0x4
field public static final int WIFI_STANDARD_LEGACY = 1; // 0x1
@@ -1156,7 +1157,11 @@
public final class RangingRequest implements android.os.Parcelable {
method public int describeContents();
+ method public static int getDefaultRttBurstSize();
method public static int getMaxPeers();
+ method public static int getMaxRttBurstSize();
+ method public static int getMinRttBurstSize();
+ method public int getRttBurstSize();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.RangingRequest> CREATOR;
}
@@ -1168,6 +1173,7 @@
method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(@NonNull android.net.MacAddress);
method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(@NonNull android.net.wifi.aware.PeerHandle);
method public android.net.wifi.rtt.RangingRequest build();
+ method @NonNull public android.net.wifi.rtt.RangingRequest.Builder setRttBurstSize(int);
}
public final class RangingResult implements android.os.Parcelable {
diff --git a/wifi/api/system-current.txt b/wifi/api/system-current.txt
index eba7443..e15d0f1 100644
--- a/wifi/api/system-current.txt
+++ b/wifi/api/system-current.txt
@@ -277,6 +277,7 @@
method @Nullable public android.net.wifi.WifiConfiguration toWifiConfiguration();
field public static final int BAND_2GHZ = 1; // 0x1
field public static final int BAND_5GHZ = 2; // 0x2
+ field public static final int BAND_60GHZ = 8; // 0x8
field public static final int BAND_6GHZ = 4; // 0x4
field @Deprecated public static final int BAND_ANY = 7; // 0x7
field public static final int RANDOMIZATION_NONE = 0; // 0x0
@@ -314,9 +315,13 @@
field public static final int CHANNEL_WIDTH_160MHZ = 6; // 0x6
field public static final int CHANNEL_WIDTH_20MHZ = 2; // 0x2
field public static final int CHANNEL_WIDTH_20MHZ_NOHT = 1; // 0x1
+ field public static final int CHANNEL_WIDTH_2160MHZ = 7; // 0x7
field public static final int CHANNEL_WIDTH_40MHZ = 3; // 0x3
+ field public static final int CHANNEL_WIDTH_4320MHZ = 8; // 0x8
+ field public static final int CHANNEL_WIDTH_6480MHZ = 9; // 0x9
field public static final int CHANNEL_WIDTH_80MHZ = 4; // 0x4
field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 5; // 0x5
+ field public static final int CHANNEL_WIDTH_8640MHZ = 10; // 0xa
field public static final int CHANNEL_WIDTH_INVALID = 0; // 0x0
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApInfo> CREATOR;
}
@@ -495,6 +500,7 @@
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerSoftApCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.SoftApCallback);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerTrafficStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.TrafficStateCallback);
method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void removeOnWifiUsabilityStatsListener(@NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_AIRPLANE_MODE) public void restartWifiSubsystem(@Nullable String);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreBackupData(@NonNull byte[]);
method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public android.net.wifi.SoftApConfiguration restoreSoftApBackupData(@NonNull byte[]);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreSupplicantBackupData(@NonNull byte[], @NonNull byte[]);
@@ -519,11 +525,11 @@
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startLocalOnlyHotspot(@NonNull android.net.wifi.SoftApConfiguration, @Nullable java.util.concurrent.Executor, @Nullable android.net.wifi.WifiManager.LocalOnlyHotspotCallback);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public boolean startScan(android.os.WorkSource);
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startSubscriptionProvisioning(@NonNull android.net.wifi.hotspot2.OsuProvider, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.hotspot2.ProvisioningCallback);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void startTemporarilyDisablingAllNonCarrierMergedWifi(int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startTemporarilyDisablingAllNonCarrierMergedWifi(int);
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean startTetheredHotspot(@Nullable android.net.wifi.SoftApConfiguration);
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void stopEasyConnectSession();
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean stopSoftAp();
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void stopTemporarilyDisablingAllNonCarrierMergedWifi();
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void stopTemporarilyDisablingAllNonCarrierMergedWifi();
method @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS) public void unregisterCoexCallback(@NonNull android.net.wifi.WifiManager.CoexCallback);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterNetworkRequestMatchCallback(@NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterSoftApCallback(@NonNull android.net.wifi.WifiManager.SoftApCallback);
@@ -632,6 +638,7 @@
method public default void onCapabilityChanged(@NonNull android.net.wifi.SoftApCapability);
method public default void onConnectedClientsChanged(@NonNull java.util.List<android.net.wifi.WifiClient>);
method public default void onInfoChanged(@NonNull android.net.wifi.SoftApInfo);
+ method public default void onInfoListChanged(@NonNull java.util.List<android.net.wifi.SoftApInfo>);
method public default void onStateChanged(int, int);
}
@@ -957,6 +964,10 @@
package android.net.wifi.rtt {
+ public final class RangingRequest implements android.os.Parcelable {
+ method @NonNull public java.util.List<android.net.wifi.rtt.ResponderConfig> getRttPeers();
+ }
+
public static final class RangingRequest.Builder {
method public android.net.wifi.rtt.RangingRequest.Builder addResponder(@NonNull android.net.wifi.rtt.ResponderConfig);
}
diff --git a/wifi/jarjar-rules.txt b/wifi/jarjar-rules.txt
index dc96df6..b15a8d7 100644
--- a/wifi/jarjar-rules.txt
+++ b/wifi/jarjar-rules.txt
@@ -110,8 +110,6 @@
rule fi.iki.elonen.** com.android.wifi.x.@0
## used by both framework-wifi and service-wifi ##
-rule android.content.pm.BaseParceledListSlice* com.android.wifi.x.@0
-rule android.content.pm.ParceledListSlice* com.android.wifi.x.@0
rule android.os.HandlerExecutor* com.android.wifi.x.@0
rule android.telephony.Annotation* com.android.wifi.x.@0
rule com.android.internal.util.AsyncChannel* com.android.wifi.x.@0
diff --git a/wifi/java/android/net/wifi/ISoftApCallback.aidl b/wifi/java/android/net/wifi/ISoftApCallback.aidl
index f81bcb9..a28a8fb 100644
--- a/wifi/java/android/net/wifi/ISoftApCallback.aidl
+++ b/wifi/java/android/net/wifi/ISoftApCallback.aidl
@@ -53,6 +53,12 @@
*/
void onInfoChanged(in SoftApInfo softApInfo);
+ /**
+ * Service to manager callback providing informations of softap.
+ *
+ * @param softApInfoList is the list of the softap informations. {@link SoftApInfo}
+ */
+ void onInfoListChanged(in List<SoftApInfo> softApInfoList);
/**
* Service to manager callback providing capability of softap.
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 866e913..0d4e9c3 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -16,8 +16,6 @@
package android.net.wifi;
-import android.content.pm.ParceledListSlice;
-
import android.net.wifi.hotspot2.OsuProvider;
import android.net.wifi.hotspot2.PasspointConfiguration;
import android.net.wifi.hotspot2.IProvisioningCallback;
@@ -47,6 +45,8 @@
import android.os.ResultReceiver;
import android.os.WorkSource;
+import com.android.modules.utils.ParceledListSlice;
+
/**
* Interface that allows controlling and querying Wi-Fi connectivity.
*
@@ -300,4 +300,6 @@
void setCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged, boolean enabled);
boolean isCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged);
+
+ void restartWifiSubsystem(String reason);
}
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index 4c23286..9f8ecf1 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -320,6 +320,11 @@
public static final int WIFI_STANDARD_11AX = 6;
/**
+ * Wi-Fi 802.11ad/ay
+ */
+ public static final int WIFI_STANDARD_11AD = 7;
+
+ /**
* AP wifi standard.
*/
private @WifiStandard int mWifiStandard;
@@ -352,6 +357,8 @@
return "11ac";
case WIFI_STANDARD_11AX:
return "11ax";
+ case WIFI_STANDARD_11AD:
+ return "11ad";
case WIFI_STANDARD_UNKNOWN:
return "unknown";
}
@@ -705,6 +712,13 @@
return UNSPECIFIED;
}
}
+ if (band == WifiScanner.WIFI_BAND_60_GHZ) {
+ if (channel >= BAND_60_GHZ_FIRST_CH_NUM && channel <= BAND_60_GHZ_LAST_CH_NUM) {
+ return ((channel - BAND_60_GHZ_FIRST_CH_NUM) * 2160) + BAND_60_GHZ_START_FREQ_MHZ;
+ } else {
+ return UNSPECIFIED;
+ }
+ }
return UNSPECIFIED;
}
diff --git a/wifi/java/android/net/wifi/SecurityParams.java b/wifi/java/android/net/wifi/SecurityParams.java
new file mode 100644
index 0000000..0ab6f57
--- /dev/null
+++ b/wifi/java/android/net/wifi/SecurityParams.java
@@ -0,0 +1,824 @@
+/*
+ * Copyright (C) 2020 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.net.wifi;
+
+import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.net.wifi.WifiConfiguration.AuthAlgorithm;
+import android.net.wifi.WifiConfiguration.GroupCipher;
+import android.net.wifi.WifiConfiguration.GroupMgmtCipher;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
+import android.net.wifi.WifiConfiguration.PairwiseCipher;
+import android.net.wifi.WifiConfiguration.Protocol;
+import android.net.wifi.WifiConfiguration.SecurityType;
+import android.net.wifi.WifiConfiguration.SuiteBCipher;
+import android.os.Parcel;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.BitSet;
+import java.util.Objects;
+
+/**
+ * A class representing a security configuration.
+ * @hide
+ */
+public class SecurityParams {
+ private static final String TAG = "SecurityParams";
+
+ /** Passpoint Release 1 */
+ public static final int PASSPOINT_R1 = 1;
+
+ /** Passpoint Release 2 */
+ public static final int PASSPOINT_R2 = 2;
+
+ /** Passpoint Release 3 */
+ public static final int PASSPOINT_R3 = 3;
+
+ @IntDef(prefix = { "PASSPOINT_" }, value = {
+ PASSPOINT_R1,
+ PASSPOINT_R2,
+ PASSPOINT_R3,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PasspointRelease {}
+
+ private @SecurityType int mSecurityType = WifiConfiguration.SECURITY_TYPE_PSK;
+
+ /**
+ * This indicates that this security type is enabled or disabled.
+ * Ex. While receiving Transition Disable Indication, older
+ * security should be disabled.
+ */
+ private boolean mEnabled = true;
+
+ /**
+ * The set of key management protocols supported by this configuration.
+ * See {@link KeyMgmt} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedKeyManagement = new BitSet();
+
+ /**
+ * The set of security protocols supported by this configuration.
+ * See {@link Protocol} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedProtocols = new BitSet();
+
+ /**
+ * The set of authentication protocols supported by this configuration.
+ * See {@link AuthAlgorithm} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedAuthAlgorithms = new BitSet();
+
+ /**
+ * The set of pairwise ciphers for WPA supported by this configuration.
+ * See {@link PairwiseCipher} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedPairwiseCiphers = new BitSet();
+
+ /**
+ * The set of group ciphers supported by this configuration.
+ * See {@link GroupCipher} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedGroupCiphers = new BitSet();
+
+ /**
+ * The set of group management ciphers supported by this configuration.
+ * See {@link GroupMgmtCipher} for descriptions of the values.
+ */
+ private BitSet mAllowedGroupManagementCiphers = new BitSet();
+
+ /**
+ * The set of SuiteB ciphers supported by this configuration.
+ * To be used for WPA3-Enterprise mode. Set automatically by the framework based on the
+ * certificate type that is used in this configuration.
+ */
+ private BitSet mAllowedSuiteBCiphers = new BitSet();
+
+ /**
+ * True if the network requires Protected Management Frames (PMF), false otherwise.
+ */
+ private boolean mRequirePmf = false;
+
+ private @PasspointRelease int mPasspointRelease = PASSPOINT_R2;
+
+ /** Indicate that this SAE security type only accepts H2E (Hash-to-Element) mode. */
+ private boolean mIsSaeH2eOnlyMode = false;
+
+ /** Indicate that this SAE security type only accepts PK (Public Key) mode. */
+ private boolean mIsSaePkOnlyMode = false;
+
+ /** Indicate whether this is added by auto-upgrade or not. */
+ private boolean mIsAddedByAutoUpgrade = false;
+
+ /** Constructor */
+ private SecurityParams() {
+ }
+
+ /** Copy constructor */
+ public SecurityParams(@NonNull SecurityParams source) {
+ this.mSecurityType = source.mSecurityType;
+ this.mEnabled = source.mEnabled;
+ this.mAllowedKeyManagement = (BitSet) source.mAllowedKeyManagement.clone();
+ this.mAllowedProtocols = (BitSet) source.mAllowedProtocols.clone();
+ this.mAllowedAuthAlgorithms = (BitSet) source.mAllowedAuthAlgorithms.clone();
+ this.mAllowedPairwiseCiphers = (BitSet) source.mAllowedPairwiseCiphers.clone();
+ this.mAllowedGroupCiphers = (BitSet) source.mAllowedGroupCiphers.clone();
+ this.mAllowedGroupManagementCiphers =
+ (BitSet) source.mAllowedGroupManagementCiphers.clone();
+ this.mAllowedSuiteBCiphers =
+ (BitSet) source.mAllowedSuiteBCiphers.clone();
+ this.mRequirePmf = source.mRequirePmf;
+ this.mIsSaeH2eOnlyMode = source.mIsSaeH2eOnlyMode;
+ this.mIsSaePkOnlyMode = source.mIsSaePkOnlyMode;
+ this.mIsAddedByAutoUpgrade = source.mIsAddedByAutoUpgrade;
+ }
+
+ @Override
+ public boolean equals(Object thatObject) {
+ if (this == thatObject) {
+ return true;
+ }
+ if (!(thatObject instanceof SecurityParams)) {
+ return false;
+ }
+ SecurityParams that = (SecurityParams) thatObject;
+
+ if (this.mSecurityType != that.mSecurityType) return false;
+ if (this.mEnabled != that.mEnabled) return false;
+ if (!this.mAllowedKeyManagement.equals(that.mAllowedKeyManagement)) return false;
+ if (!this.mAllowedProtocols.equals(that.mAllowedProtocols)) return false;
+ if (!this.mAllowedAuthAlgorithms.equals(that.mAllowedAuthAlgorithms)) return false;
+ if (!this.mAllowedPairwiseCiphers.equals(that.mAllowedPairwiseCiphers)) return false;
+ if (!this.mAllowedGroupCiphers.equals(that.mAllowedGroupCiphers)) return false;
+ if (!this.mAllowedGroupManagementCiphers.equals(that.mAllowedGroupManagementCiphers)) {
+ return false;
+ }
+ if (!this.mAllowedSuiteBCiphers.equals(that.mAllowedSuiteBCiphers)) return false;
+ if (this.mRequirePmf != that.mRequirePmf) return false;
+ if (this.mIsSaeH2eOnlyMode != that.mIsSaeH2eOnlyMode) return false;
+ if (this.mIsSaePkOnlyMode != that.mIsSaePkOnlyMode) return false;
+ if (this.mIsAddedByAutoUpgrade != that.mIsAddedByAutoUpgrade) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mSecurityType, mEnabled,
+ mAllowedKeyManagement, mAllowedProtocols, mAllowedAuthAlgorithms,
+ mAllowedPairwiseCiphers, mAllowedGroupCiphers, mAllowedGroupManagementCiphers,
+ mAllowedSuiteBCiphers, mRequirePmf,
+ mIsSaeH2eOnlyMode, mIsSaePkOnlyMode, mIsAddedByAutoUpgrade);
+ }
+
+ /**
+ * Check the security type of this params.
+ *
+ * @param type the testing security type.
+ * @return true if this is for the corresponiding type.
+ */
+ public boolean isSecurityType(@SecurityType int type) {
+ return type == mSecurityType;
+ }
+
+ /**
+ * Check whether the security of given params is the same as this one.
+ *
+ * @param params the testing security params.
+ * @return true if their security types are the same.
+ */
+ public boolean isSameSecurityType(SecurityParams params) {
+ return params.mSecurityType == mSecurityType;
+ }
+
+ /**
+ * Update security params to legacy WifiConfiguration object.
+ *
+ * @param config the target configuration.
+ */
+ public void updateLegacyWifiConfiguration(WifiConfiguration config) {
+ config.allowedKeyManagement = (BitSet) mAllowedKeyManagement.clone();
+ config.allowedProtocols = (BitSet) mAllowedProtocols.clone();
+ config.allowedAuthAlgorithms = (BitSet) mAllowedAuthAlgorithms.clone();
+ config.allowedPairwiseCiphers = (BitSet) mAllowedPairwiseCiphers.clone();
+ config.allowedGroupCiphers = (BitSet) mAllowedGroupCiphers.clone();
+ config.allowedGroupManagementCiphers = (BitSet) mAllowedGroupManagementCiphers.clone();
+ config.allowedSuiteBCiphers = (BitSet) mAllowedSuiteBCiphers.clone();
+ config.requirePmf = mRequirePmf;
+ }
+
+ /**
+ * Set this params enabled.
+ *
+ * @param enable enable a specific security type.
+ */
+ public void setEnabled(boolean enable) {
+ mEnabled = enable;
+ }
+
+ /**
+ * Indicate this params is enabled or not.
+ */
+ public boolean isEnabled() {
+ return mEnabled;
+ }
+
+ /**
+ * Set the supporting Fast Initial Link Set-up (FILS) key management.
+ *
+ * FILS can be applied to all security types.
+ * @param enableFilsSha256 Enable FILS SHA256.
+ * @param enableFilsSha384 Enable FILS SHA256.
+ */
+ public void enableFils(boolean enableFilsSha256, boolean enableFilsSha384) {
+ if (enableFilsSha256) {
+ mAllowedKeyManagement.set(KeyMgmt.FILS_SHA256);
+ }
+
+ if (enableFilsSha384) {
+ mAllowedKeyManagement.set(KeyMgmt.FILS_SHA384);
+ }
+ }
+
+ /**
+ * Get the copy of allowed key management.
+ */
+ public BitSet getAllowedKeyManagement() {
+ return (BitSet) mAllowedKeyManagement.clone();
+ }
+
+ /**
+ * Get the copy of allowed protocols.
+ */
+ public BitSet getAllowedProtocols() {
+ return (BitSet) mAllowedProtocols.clone();
+ }
+
+ /**
+ * Get the copy of allowed auth algorithms.
+ */
+ public BitSet getAllowedAuthAlgorithms() {
+ return (BitSet) mAllowedAuthAlgorithms.clone();
+ }
+
+ /**
+ * Get the copy of allowed pairwise ciphers.
+ */
+ public BitSet getAllowedPairwiseCiphers() {
+ return (BitSet) mAllowedPairwiseCiphers.clone();
+ }
+
+ /**
+ * Get the copy of allowed group ciphers.
+ */
+ public BitSet getAllowedGroupCiphers() {
+ return (BitSet) mAllowedGroupCiphers.clone();
+ }
+
+ /**
+ * Get the copy of allowed group management ciphers.
+ */
+ public BitSet getAllowedGroupManagementCiphers() {
+ return (BitSet) mAllowedGroupManagementCiphers.clone();
+ }
+
+ /**
+ * Enable Suite-B ciphers.
+ *
+ * @param enableEcdheEcdsa enable Diffie-Hellman with Elliptic Curve ECDSA cipher support.
+ * @param enableEcdheRsa enable Diffie-Hellman with RSA cipher support.
+ */
+ public void enableSuiteBCiphers(boolean enableEcdheEcdsa, boolean enableEcdheRsa) {
+ if (enableEcdheEcdsa) {
+ mAllowedSuiteBCiphers.set(SuiteBCipher.ECDHE_ECDSA);
+ } else {
+ mAllowedSuiteBCiphers.clear(SuiteBCipher.ECDHE_ECDSA);
+ }
+
+ if (enableEcdheRsa) {
+ mAllowedSuiteBCiphers.set(SuiteBCipher.ECDHE_RSA);
+ } else {
+ mAllowedSuiteBCiphers.clear(SuiteBCipher.ECDHE_RSA);
+ }
+ }
+
+ /**
+ * Get the copy of allowed suite-b ciphers.
+ */
+ public BitSet getAllowedSuiteBCiphers() {
+ return (BitSet) mAllowedSuiteBCiphers.clone();
+ }
+
+ /**
+ * Indicate PMF is required or not.
+ */
+ public boolean isRequirePmf() {
+ return mRequirePmf;
+ }
+
+ /**
+ * Indicate that this is open security type.
+ */
+ public boolean isOpenSecurityType() {
+ return isSecurityType(WifiConfiguration.SECURITY_TYPE_OPEN)
+ || isSecurityType(WifiConfiguration.SECURITY_TYPE_OWE);
+ }
+
+ /**
+ * Indicate that this is enterprise security type.
+ */
+ public boolean isEnterpriseSecurityType() {
+ return mAllowedKeyManagement.get(KeyMgmt.WPA_EAP)
+ || mAllowedKeyManagement.get(KeyMgmt.IEEE8021X)
+ || mAllowedKeyManagement.get(KeyMgmt.SUITE_B_192)
+ || mAllowedKeyManagement.get(KeyMgmt.WAPI_CERT);
+ }
+
+ /**
+ * Enable Hash-to-Element only mode.
+ *
+ * @param enable set H2E only mode enabled or not.
+ */
+ public void enableSaeH2eOnlyMode(boolean enable) {
+ mIsSaeH2eOnlyMode = enable;
+ }
+
+ /**
+ * Indicate whether this params is H2E only mode.
+ *
+ * @return true if this is H2E only mode params.
+ */
+ public boolean isSaeH2eOnlyMode() {
+ return mIsSaeH2eOnlyMode;
+ }
+ /**
+ * Enable Pubilc-Key only mode.
+ *
+ * @param enable set PK only mode enabled or not.
+ */
+ public void enableSaePkOnlyMode(boolean enable) {
+ mIsSaePkOnlyMode = enable;
+ }
+
+ /**
+ * Indicate whether this params is PK only mode.
+ *
+ * @return true if this is PK only mode params.
+ */
+ public boolean isSaePkOnlyMode() {
+ return mIsSaePkOnlyMode;
+ }
+
+ /**
+ * Set whether this is added by auto-upgrade.
+ *
+ * @param addedByAutoUpgrade true if added by auto-upgrade.
+ */
+ public void setIsAddedByAutoUpgrade(boolean addedByAutoUpgrade) {
+ mIsAddedByAutoUpgrade = addedByAutoUpgrade;
+ }
+
+ /**
+ * Indicate whether this is added by auto-upgrade or not.
+ *
+ * @return true if added by auto-upgrade; otherwise, false.
+ */
+ public boolean isAddedByAutoUpgrade() {
+ return mIsAddedByAutoUpgrade;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sbuf = new StringBuilder();
+ sbuf.append("Security Parameters:\n");
+ sbuf.append(" Type: ").append(mSecurityType).append("\n");
+ sbuf.append(" Enabled: ").append(mEnabled).append("\n");
+ sbuf.append(" KeyMgmt:");
+ for (int k = 0; k < mAllowedKeyManagement.size(); k++) {
+ if (mAllowedKeyManagement.get(k)) {
+ sbuf.append(" ");
+ if (k < KeyMgmt.strings.length) {
+ sbuf.append(KeyMgmt.strings[k]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" Protocols:");
+ for (int p = 0; p < mAllowedProtocols.size(); p++) {
+ if (mAllowedProtocols.get(p)) {
+ sbuf.append(" ");
+ if (p < Protocol.strings.length) {
+ sbuf.append(Protocol.strings[p]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" AuthAlgorithms:");
+ for (int a = 0; a < mAllowedAuthAlgorithms.size(); a++) {
+ if (mAllowedAuthAlgorithms.get(a)) {
+ sbuf.append(" ");
+ if (a < AuthAlgorithm.strings.length) {
+ sbuf.append(AuthAlgorithm.strings[a]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" PairwiseCiphers:");
+ for (int pc = 0; pc < mAllowedPairwiseCiphers.size(); pc++) {
+ if (mAllowedPairwiseCiphers.get(pc)) {
+ sbuf.append(" ");
+ if (pc < PairwiseCipher.strings.length) {
+ sbuf.append(PairwiseCipher.strings[pc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" GroupCiphers:");
+ for (int gc = 0; gc < mAllowedGroupCiphers.size(); gc++) {
+ if (mAllowedGroupCiphers.get(gc)) {
+ sbuf.append(" ");
+ if (gc < GroupCipher.strings.length) {
+ sbuf.append(GroupCipher.strings[gc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" GroupMgmtCiphers:");
+ for (int gmc = 0; gmc < mAllowedGroupManagementCiphers.size(); gmc++) {
+ if (mAllowedGroupManagementCiphers.get(gmc)) {
+ sbuf.append(" ");
+ if (gmc < GroupMgmtCipher.strings.length) {
+ sbuf.append(GroupMgmtCipher.strings[gmc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" SuiteBCiphers:");
+ for (int sbc = 0; sbc < mAllowedSuiteBCiphers.size(); sbc++) {
+ if (mAllowedSuiteBCiphers.get(sbc)) {
+ sbuf.append(" ");
+ if (sbc < SuiteBCipher.strings.length) {
+ sbuf.append(SuiteBCipher.strings[sbc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" RequirePmf: ").append(mRequirePmf).append('\n');
+ sbuf.append(" IsAddedByAutoUpgrade: ").append(mIsAddedByAutoUpgrade).append("\n");
+ sbuf.append(" IsSaeH2eOnlyMode: ").append(mIsSaeH2eOnlyMode).append("\n");
+ sbuf.append(" IsSaePkOnlyMode: ").append(mIsSaePkOnlyMode).append("\n");
+ return sbuf.toString();
+ }
+
+ private static BitSet readBitSet(Parcel src) {
+ int cardinality = src.readInt();
+
+ BitSet set = new BitSet();
+ for (int i = 0; i < cardinality; i++) {
+ set.set(src.readInt());
+ }
+
+ return set;
+ }
+
+ private static void writeBitSet(Parcel dest, BitSet set) {
+ int nextSetBit = -1;
+
+ dest.writeInt(set.cardinality());
+
+ while ((nextSetBit = set.nextSetBit(nextSetBit + 1)) != -1) {
+ dest.writeInt(nextSetBit);
+ }
+ }
+
+ /** Write this object to the parcel. */
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mSecurityType);
+ dest.writeBoolean(mEnabled);
+ writeBitSet(dest, mAllowedKeyManagement);
+ writeBitSet(dest, mAllowedProtocols);
+ writeBitSet(dest, mAllowedAuthAlgorithms);
+ writeBitSet(dest, mAllowedPairwiseCiphers);
+ writeBitSet(dest, mAllowedGroupCiphers);
+ writeBitSet(dest, mAllowedGroupManagementCiphers);
+ writeBitSet(dest, mAllowedSuiteBCiphers);
+ dest.writeBoolean(mRequirePmf);
+ dest.writeBoolean(mIsAddedByAutoUpgrade);
+ dest.writeBoolean(mIsSaeH2eOnlyMode);
+ dest.writeBoolean(mIsSaePkOnlyMode);
+
+ }
+
+ /** Create a SecurityParams object from the parcel. */
+ public static final @NonNull SecurityParams createFromParcel(Parcel in) {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = in.readInt();
+ params.mEnabled = in.readBoolean();
+ params.mAllowedKeyManagement = readBitSet(in);
+ params.mAllowedProtocols = readBitSet(in);
+ params.mAllowedAuthAlgorithms = readBitSet(in);
+ params.mAllowedPairwiseCiphers = readBitSet(in);
+ params.mAllowedGroupCiphers = readBitSet(in);
+ params.mAllowedGroupManagementCiphers = readBitSet(in);
+ params.mAllowedSuiteBCiphers = readBitSet(in);
+ params.mRequirePmf = in.readBoolean();
+ params.mIsAddedByAutoUpgrade = in.readBoolean();
+ params.mIsSaeH2eOnlyMode = in.readBoolean();
+ params.mIsSaePkOnlyMode = in.readBoolean();
+ return params;
+ }
+
+ /**
+ * Create EAP security params.
+ */
+ public static @NonNull SecurityParams createWpaWpa2EnterpriseParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_EAP;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+ params.mAllowedProtocols.set(Protocol.WPA);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ return params;
+ }
+
+ /**
+ * Create Passpoint security params.
+ */
+ public static @NonNull SecurityParams createPasspointParams(@PasspointRelease int release) {
+ SecurityParams params = new SecurityParams();
+ switch (release) {
+ case PASSPOINT_R1:
+ case PASSPOINT_R2:
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
+ break;
+ case PASSPOINT_R3:
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R3;
+ params.mRequirePmf = true;
+ break;
+ default:
+ throw new IllegalArgumentException("invalid passpoint release " + release);
+ }
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+
+ return params;
+ }
+
+ /**
+ * Create Enhanced Open params.
+ */
+ public static @NonNull SecurityParams createEnhancedOpenParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_OWE;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.OWE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_128);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_128);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create Open params.
+ */
+ public static @NonNull SecurityParams createOpenParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_OPEN;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.NONE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+ params.mAllowedProtocols.set(Protocol.WPA);
+ return params;
+ }
+
+ /**
+ * Create OSEN params.
+ */
+ public static @NonNull SecurityParams createOsenParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_OSEN;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.OSEN);
+
+ params.mAllowedProtocols.set(Protocol.OSEN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ return params;
+ }
+
+ /**
+ * Create WAPI-CERT params.
+ */
+ public static @NonNull SecurityParams createWapiCertParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_CERT;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WAPI_CERT);
+
+ params.mAllowedProtocols.set(Protocol.WAPI);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.SMS4);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.SMS4);
+ return params;
+ }
+
+ /**
+ * Create WAPI-PSK params.
+ */
+ public static @NonNull SecurityParams createWapiPskParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_PSK;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WAPI_PSK);
+
+ params.mAllowedProtocols.set(Protocol.WAPI);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.SMS4);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.SMS4);
+ return params;
+ }
+
+ /**
+ * Create WEP params.
+ */
+ public static @NonNull SecurityParams createWepParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_WEP;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.NONE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedAuthAlgorithms.set(AuthAlgorithm.OPEN);
+ params.mAllowedAuthAlgorithms.set(AuthAlgorithm.SHARED);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP40);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP104);
+ return params;
+ }
+
+ /**
+ * Create WPA3 Enterprise 192-bit params.
+ */
+ public static @NonNull SecurityParams createWpa3Enterprise192BitParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+ params.mAllowedKeyManagement.set(KeyMgmt.SUITE_B_192);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_128);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_128);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mAllowedGroupManagementCiphers.set(GroupMgmtCipher.BIP_GMAC_256);
+
+ // Note: allowedSuiteBCiphers bitset will be set by the service once the
+ // certificates are attached to this profile
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create WPA3 Enterprise params.
+ */
+ public static @NonNull SecurityParams createWpa3EnterpriseParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create WPA3 Personal params.
+ */
+ public static @NonNull SecurityParams createWpa3PersonalParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_SAE;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.SAE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_128);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_128);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create WPA/WPA2 Personal params.
+ */
+ public static @NonNull SecurityParams createWpaWpa2PersonalParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_PSK;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_PSK);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+ params.mAllowedProtocols.set(Protocol.WPA);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP40);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP104);
+ return params;
+ }
+}
diff --git a/wifi/java/android/net/wifi/SoftApCapability.java b/wifi/java/android/net/wifi/SoftApCapability.java
index d570b7e..6f72f0b 100644
--- a/wifi/java/android/net/wifi/SoftApCapability.java
+++ b/wifi/java/android/net/wifi/SoftApCapability.java
@@ -116,6 +116,11 @@
private int[] mSupportedChannelListIn6g = EMPTY_INT_ARRAY;
/**
+ * A list storing supported 60G channels.
+ */
+ private int[] mSupportedChannelListIn60g = EMPTY_INT_ARRAY;
+
+ /**
* Get the maximum supported client numbers which AP resides on.
*/
public int getMaxSupportedClients() {
@@ -147,8 +152,8 @@
* Set supported channel list in target band type.
*
* @param band One of the following band types:
- * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ} or
- * {@link SoftApConfiguation#BAND_6GHZ}.
+ * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ},
+ * {@link SoftApConfiguation#BAND_6GHZ}, or {@link SoftApConfiguation#BAND_60GHZ}.
* @param supportedChannelList supported channel list in target band
* @return true if band and supportedChannelList are valid, otherwise false.
*
@@ -168,6 +173,9 @@
case SoftApConfiguration.BAND_6GHZ:
mSupportedChannelListIn6g = supportedChannelList;
break;
+ case SoftApConfiguration.BAND_60GHZ:
+ mSupportedChannelListIn60g = supportedChannelList;
+ break;
default:
throw new IllegalArgumentException("Invalid band: " + band);
}
@@ -181,8 +189,8 @@
* {@link SoftapConfiguration.Builder#setChannel(int, int)} API.
*
* @param band One of the following band types:
- * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ} or
- * {@link SoftApConfiguation#BAND_6GHZ}.
+ * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ},
+ * {@link SoftApConfiguation#BAND_6GHZ}, {@link SoftApConfiguation#BAND_60GHZ}.
* @return List of supported channels for the band.
*
* @throws IllegalArgumentException when band type is invalid.
@@ -199,6 +207,8 @@
return mSupportedChannelListIn5g;
case SoftApConfiguration.BAND_6GHZ:
return mSupportedChannelListIn6g;
+ case SoftApConfiguration.BAND_60GHZ:
+ return mSupportedChannelListIn60g;
default:
throw new IllegalArgumentException("Invalid band: " + band);
}
@@ -214,6 +224,7 @@
mSupportedChannelListIn24g = source.mSupportedChannelListIn24g;
mSupportedChannelListIn5g = source.mSupportedChannelListIn5g;
mSupportedChannelListIn6g = source.mSupportedChannelListIn6g;
+ mSupportedChannelListIn60g = source.mSupportedChannelListIn60g;
}
}
@@ -244,6 +255,7 @@
dest.writeIntArray(mSupportedChannelListIn24g);
dest.writeIntArray(mSupportedChannelListIn5g);
dest.writeIntArray(mSupportedChannelListIn6g);
+ dest.writeIntArray(mSupportedChannelListIn60g);
}
@NonNull
@@ -255,6 +267,7 @@
capability.setSupportedChannelList(SoftApConfiguration.BAND_2GHZ, in.createIntArray());
capability.setSupportedChannelList(SoftApConfiguration.BAND_5GHZ, in.createIntArray());
capability.setSupportedChannelList(SoftApConfiguration.BAND_6GHZ, in.createIntArray());
+ capability.setSupportedChannelList(SoftApConfiguration.BAND_60GHZ, in.createIntArray());
return capability;
}
@@ -273,6 +286,8 @@
.append(Arrays.toString(mSupportedChannelListIn24g));
sbuf.append("SupportedChannelListIn5g").append(Arrays.toString(mSupportedChannelListIn5g));
sbuf.append("SupportedChannelListIn6g").append(Arrays.toString(mSupportedChannelListIn6g));
+ sbuf.append("SupportedChannelListIn60g")
+ .append(Arrays.toString(mSupportedChannelListIn60g));
return sbuf.toString();
}
@@ -285,7 +300,8 @@
&& mMaximumSupportedClientNumber == capability.mMaximumSupportedClientNumber
&& Arrays.equals(mSupportedChannelListIn24g, capability.mSupportedChannelListIn24g)
&& Arrays.equals(mSupportedChannelListIn5g, capability.mSupportedChannelListIn5g)
- && Arrays.equals(mSupportedChannelListIn6g, capability.mSupportedChannelListIn6g);
+ && Arrays.equals(mSupportedChannelListIn6g, capability.mSupportedChannelListIn6g)
+ && Arrays.equals(mSupportedChannelListIn60g, capability.mSupportedChannelListIn60g);
}
@Override
@@ -293,6 +309,7 @@
return Objects.hash(mSupportedFeatures, mMaximumSupportedClientNumber,
Arrays.hashCode(mSupportedChannelListIn24g),
Arrays.hashCode(mSupportedChannelListIn5g),
- Arrays.hashCode(mSupportedChannelListIn6g));
+ Arrays.hashCode(mSupportedChannelListIn6g),
+ Arrays.hashCode(mSupportedChannelListIn60g));
}
}
diff --git a/wifi/java/android/net/wifi/SoftApConfiguration.java b/wifi/java/android/net/wifi/SoftApConfiguration.java
index 226d1a3..d36acb7 100644
--- a/wifi/java/android/net/wifi/SoftApConfiguration.java
+++ b/wifi/java/android/net/wifi/SoftApConfiguration.java
@@ -88,6 +88,13 @@
public static final int BAND_6GHZ = 1 << 2;
/**
+ * 60GHz band.
+ * @hide
+ */
+ @SystemApi
+ public static final int BAND_60GHZ = 1 << 3;
+
+ /**
* Device is allowed to choose the optimal band (2Ghz, 5Ghz, 6Ghz) based on device capability,
* operating country code and current radio conditions.
* @hide
@@ -104,11 +111,13 @@
BAND_2GHZ,
BAND_5GHZ,
BAND_6GHZ,
+ BAND_60GHZ,
})
public @interface BandType {}
private static boolean isBandValid(@BandType int band) {
- return ((band != 0) && ((band & ~BAND_ANY) == 0));
+ int bandAny = BAND_2GHZ | BAND_5GHZ | BAND_6GHZ | BAND_60GHZ;
+ return ((band != 0) && ((band & ~bandAny) == 0));
}
private static final int MIN_CH_2G_BAND = 1;
@@ -117,6 +126,8 @@
private static final int MAX_CH_5G_BAND = 196;
private static final int MIN_CH_6G_BAND = 1;
private static final int MAX_CH_6G_BAND = 253;
+ private static final int MIN_CH_60G_BAND = 1;
+ private static final int MAX_CH_60G_BAND = 6;
@@ -139,6 +150,13 @@
return false;
}
break;
+
+ case BAND_60GHZ:
+ if (channel < MIN_CH_60G_BAND || channel > MAX_CH_60G_BAND) {
+ return false;
+ }
+ break;
+
default:
return false;
}
@@ -538,15 +556,6 @@
if (!SdkLevel.isAtLeastS()) {
throw new UnsupportedOperationException();
}
- return getChannelsInternal();
- }
-
- /**
- * Internal version bypassing SdkLevel checks
- * TODO(b/173791707): find a better way to allow Wifi to call its own new S APIs.
- * @hide
- */
- public @NonNull SparseIntArray getChannelsInternal() {
return mChannels.clone();
}
@@ -945,6 +954,9 @@
*/
@NonNull
public Builder setBands(@NonNull int[] bands) {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
if (bands.length == 0 || bands.length > 2) {
throw new IllegalArgumentException("Unsupported number of bands("
+ bands.length + ") configured");
@@ -1036,6 +1048,9 @@
*/
@NonNull
public Builder setChannels(@NonNull SparseIntArray channels) {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
if (channels.size() == 0 || channels.size() > 2) {
throw new IllegalArgumentException("Unsupported number of channels("
+ channels.size() + ") configured");
diff --git a/wifi/java/android/net/wifi/SoftApInfo.java b/wifi/java/android/net/wifi/SoftApInfo.java
index 55c2f17..e42e786 100644
--- a/wifi/java/android/net/wifi/SoftApInfo.java
+++ b/wifi/java/android/net/wifi/SoftApInfo.java
@@ -86,6 +86,34 @@
*/
public static final int CHANNEL_WIDTH_160MHZ = 6;
+ /**
+ * AP Channel bandwidth is 2160 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_2160MHZ = 7;
+
+ /**
+ * AP Channel bandwidth is 4320 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_4320MHZ = 8;
+
+ /**
+ * AP Channel bandwidth is 6480 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_6480MHZ = 9;
+
+ /**
+ * AP Channel bandwidth is 8640 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_8640MHZ = 10;
+
/** The frequency which AP resides on. */
private int mFrequency = 0;
@@ -96,6 +124,10 @@
@Nullable
private MacAddress mBssid;
+ /** The identifier of the AP instance which AP resides on with current info. */
+ @Nullable
+ private String mApInstanceIdentifier;
+
/**
* The operational mode of the AP.
*/
@@ -121,7 +153,9 @@
*
* @return One of {@link #CHANNEL_WIDTH_20MHZ}, {@link #CHANNEL_WIDTH_40MHZ},
* {@link #CHANNEL_WIDTH_80MHZ}, {@link #CHANNEL_WIDTH_160MHZ},
- * {@link #CHANNEL_WIDTH_80MHZ_PLUS_MHZ} or {@link #CHANNEL_WIDTH_INVALID}.
+ * {@link #CHANNEL_WIDTH_80MHZ_PLUS_MHZ}, {@link #CHANNEL_WIDTH_2160MHZ},
+ * {@link #CHANNEL_WIDTH_4320MHZ}, {@link #CHANNEL_WIDTH_6480MHZ},
+ * {@link #CHANNEL_WIDTH_8640MHZ}, or {@link #CHANNEL_WIDTH_INVALID}.
*/
@WifiAnnotations.Bandwidth
public int getBandwidth() {
@@ -183,16 +217,29 @@
if (!SdkLevel.isAtLeastS()) {
throw new UnsupportedOperationException();
}
- return getWifiStandardInternal();
+ return mWifiStandard;
}
/**
- * Internal version bypassing SdkLevel checks
- * TODO(b/173791707): find a better way to allow Wifi to call its own new S APIs.
+ * Set the AP instance identifier.
* @hide
*/
- public @WifiAnnotations.WifiStandard int getWifiStandardInternal() {
- return mWifiStandard;
+ public void setApInstanceIdentifier(@NonNull String apInstanceIdentifier) {
+ mApInstanceIdentifier = apInstanceIdentifier;
+ }
+
+ /**
+ * Get the AP instance identifier.
+ *
+ * The AP instance identifier is a unique identity which can be used to
+ * associate the {@link SoftApInfo} to a specific {@link WifiClient}
+ * - see {@link WifiClient#getApInstanceIdentifier()}
+ *
+ * @hide
+ */
+ @Nullable
+ public String getApInstanceIdentifier() {
+ return mApInstanceIdentifier;
}
/**
@@ -204,6 +251,7 @@
mBandwidth = source.mBandwidth;
mBssid = source.mBssid;
mWifiStandard = source.mWifiStandard;
+ mApInstanceIdentifier = source.mApInstanceIdentifier;
}
}
@@ -226,6 +274,7 @@
dest.writeInt(mBandwidth);
dest.writeParcelable(mBssid, flags);
dest.writeInt(mWifiStandard);
+ dest.writeString(mApInstanceIdentifier);
}
@NonNull
@@ -237,6 +286,7 @@
info.mBandwidth = in.readInt();
info.mBssid = in.readParcelable(MacAddress.class.getClassLoader());
info.mWifiStandard = in.readInt();
+ info.mApInstanceIdentifier = in.readString();
return info;
}
@@ -254,6 +304,7 @@
sbuf.append(", frequency= ").append(mFrequency);
if (mBssid != null) sbuf.append(",bssid=").append(mBssid.toString());
sbuf.append(", wifiStandard= ").append(mWifiStandard);
+ sbuf.append(", mApInstanceIdentifier= ").append(mApInstanceIdentifier);
sbuf.append("}");
return sbuf.toString();
}
@@ -266,11 +317,12 @@
return mFrequency == softApInfo.mFrequency
&& mBandwidth == softApInfo.mBandwidth
&& Objects.equals(mBssid, softApInfo.mBssid)
- && mWifiStandard == softApInfo.mWifiStandard;
+ && mWifiStandard == softApInfo.mWifiStandard
+ && Objects.equals(mApInstanceIdentifier, softApInfo.mApInstanceIdentifier);
}
@Override
public int hashCode() {
- return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard);
+ return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard, mApInstanceIdentifier);
}
}
diff --git a/wifi/java/android/net/wifi/WifiAnnotations.java b/wifi/java/android/net/wifi/WifiAnnotations.java
index acda7e0..807b40b 100644
--- a/wifi/java/android/net/wifi/WifiAnnotations.java
+++ b/wifi/java/android/net/wifi/WifiAnnotations.java
@@ -57,6 +57,10 @@
SoftApInfo.CHANNEL_WIDTH_80MHZ,
SoftApInfo.CHANNEL_WIDTH_80MHZ_PLUS_MHZ,
SoftApInfo.CHANNEL_WIDTH_160MHZ,
+ SoftApInfo.CHANNEL_WIDTH_2160MHZ,
+ SoftApInfo.CHANNEL_WIDTH_4320MHZ,
+ SoftApInfo.CHANNEL_WIDTH_6480MHZ,
+ SoftApInfo.CHANNEL_WIDTH_8640MHZ,
})
@Retention(RetentionPolicy.SOURCE)
public @interface Bandwidth {}
@@ -77,6 +81,7 @@
ScanResult.WIFI_STANDARD_11N,
ScanResult.WIFI_STANDARD_11AC,
ScanResult.WIFI_STANDARD_11AX,
+ ScanResult.WIFI_STANDARD_11AD,
})
@Retention(RetentionPolicy.SOURCE)
public @interface WifiStandard{}
diff --git a/wifi/java/android/net/wifi/WifiClient.java b/wifi/java/android/net/wifi/WifiClient.java
index 3794566..85e2b33 100644
--- a/wifi/java/android/net/wifi/WifiClient.java
+++ b/wifi/java/android/net/wifi/WifiClient.java
@@ -30,6 +30,9 @@
private final MacAddress mMacAddress;
+ /** The identifier of the AP instance which the client connected. */
+ private final String mApInstanceIdentifier;
+
/**
* The mac address of this client.
*/
@@ -38,15 +41,30 @@
return mMacAddress;
}
+ /**
+ * Get AP instance identifier.
+ *
+ * The AP instance identifier is a unique identity which can be used to
+ * associate the {@link SoftApInfo} to a specific {@link WifiClient}
+ * - see {@link SoftApInfo#getApInstanceIdentifier()}
+ * @hide
+ */
+ @NonNull
+ public String getApInstanceIdentifier() {
+ return mApInstanceIdentifier;
+ }
+
private WifiClient(Parcel in) {
mMacAddress = in.readParcelable(null);
+ mApInstanceIdentifier = in.readString();
}
/** @hide */
- public WifiClient(@NonNull MacAddress macAddress) {
+ public WifiClient(@NonNull MacAddress macAddress, @NonNull String apInstanceIdentifier) {
Objects.requireNonNull(macAddress, "mMacAddress must not be null.");
this.mMacAddress = macAddress;
+ this.mApInstanceIdentifier = apInstanceIdentifier;
}
@Override
@@ -57,6 +75,7 @@
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeParcelable(mMacAddress, flags);
+ dest.writeString(mApInstanceIdentifier);
}
@NonNull
@@ -75,6 +94,7 @@
public String toString() {
return "WifiClient{"
+ "mMacAddress=" + mMacAddress
+ + "mApInstanceIdentifier=" + mApInstanceIdentifier
+ '}';
}
@@ -83,13 +103,12 @@
if (this == o) return true;
if (!(o instanceof WifiClient)) return false;
WifiClient client = (WifiClient) o;
- return mMacAddress.equals(client.mMacAddress);
+ return Objects.equals(mMacAddress, client.mMacAddress)
+ && mApInstanceIdentifier.equals(client.mApInstanceIdentifier);
}
@Override
public int hashCode() {
- return Objects.hash(mMacAddress);
+ return Objects.hash(mMacAddress, mApInstanceIdentifier);
}
}
-
-
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 85b3170..2a98977 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -19,6 +19,7 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.PackageManager;
@@ -46,10 +47,13 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
/**
* A class representing a configured Wi-Fi network, including the
@@ -250,6 +254,11 @@
*/
public static final int WAPI = 3;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {WPA, RSN, OSEN, WAPI})
+ public @interface ProtocolScheme {};
+
public static final String varName = "proto";
public static final String[] strings = { "WPA", "RSN", "OSEN", "WAPI" };
@@ -274,6 +283,11 @@
/** SAE (Used only for WPA3-Personal) */
public static final int SAE = 3;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {OPEN, SHARED, LEAP, SAE})
+ public @interface AuthAlgorithmScheme {};
+
public static final String varName = "auth_alg";
public static final String[] strings = { "OPEN", "SHARED", "LEAP", "SAE" };
@@ -308,6 +322,10 @@
*/
public static final int GCMP_128 = 5;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {NONE, TKIP, CCMP, GCMP_256, SMS4, GCMP_128})
+ public @interface PairwiseCipherScheme {};
public static final String varName = "pairwise";
@@ -359,6 +377,11 @@
*/
public static final int GCMP_128 = 7;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {WEP40, WEP104, TKIP, CCMP, GTK_NOT_USED, GCMP_256, SMS4, GCMP_128})
+ public @interface GroupCipherScheme {};
+
public static final String varName = "group";
public static final String[] strings =
@@ -387,9 +410,16 @@
/** GMAC-256 = Galois Message Authentication Code */
public static final int BIP_GMAC_256 = 2;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {BIP_CMAC_256, BIP_GMAC_128, BIP_GMAC_256})
+ public @interface GroupMgmtCipherScheme {};
+
private static final String varName = "groupMgmt";
- private static final String[] strings = { "BIP_CMAC_256",
+ /** @hide */
+ @SuppressLint("AllUpper")
+ public static final @NonNull String[] strings = { "BIP_CMAC_256",
"BIP_GMAC_128", "BIP_GMAC_256"};
}
@@ -410,9 +440,16 @@
/** Diffie-Hellman with_RSA signature */
public static final int ECDHE_RSA = 1;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {ECDHE_ECDSA, ECDHE_RSA})
+ public @interface SuiteBCipherScheme {};
+
private static final String varName = "SuiteB";
- private static final String[] strings = { "ECDHE_ECDSA", "ECDHE_RSA" };
+ /** @hide */
+ @SuppressLint("AllUpper")
+ public static final String[] strings = { "ECDHE_ECDSA", "ECDHE_RSA" };
}
/** Possible status of a network configuration. */
@@ -460,6 +497,25 @@
public static final int SECURITY_TYPE_WAPI_CERT = 8;
/** Security type for a WPA3-Enterprise network. */
public static final int SECURITY_TYPE_EAP_WPA3_ENTERPRISE = 9;
+ /**
+ * Security type for an OSEN network.
+ * @hide
+ */
+ public static final int SECURITY_TYPE_OSEN = 10;
+ /**
+ * Security type for a Passpoint R1/R2 network.
+ * Passpoint R1/R2 uses Enterprise security, where TKIP and WEP are not allowed.
+ * @hide
+ */
+ public static final int SECURITY_TYPE_PASSPOINT_R1_R2 = 11;
+
+ /**
+ * Security type for a Passpoint R3 network.
+ * Passpoint R3 uses Enterprise security, where TKIP and WEP are not allowed,
+ * and PMF must be set to Required.
+ * @hide
+ */
+ public static final int SECURITY_TYPE_PASSPOINT_R3 = 12;
/**
* Security types we support.
@@ -478,12 +534,57 @@
SECURITY_TYPE_WAPI_CERT,
SECURITY_TYPE_EAP_WPA3_ENTERPRISE,
SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT,
+ SECURITY_TYPE_PASSPOINT_R1_R2,
+ SECURITY_TYPE_PASSPOINT_R3,
})
public @interface SecurityType {}
+ private List<SecurityParams> mSecurityParamsList = new ArrayList<>();
+
+ private void updateLegacySecurityParams() {
+ if (mSecurityParamsList.isEmpty()) return;
+ mSecurityParamsList.get(0).updateLegacyWifiConfiguration(this);
+ }
+
/**
* Set the various security params to correspond to the provided security type.
* This is accomplished by setting the various BitSets exposed in WifiConfiguration.
+ * <br>
+ * This API would clear existing security types and add a default one.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ */
+ public void setSecurityParams(@SecurityType int securityType) {
+ // Clear existing data.
+ mSecurityParamsList = new ArrayList<>();
+ addSecurityParams(securityType);
+ }
+
+ /**
+ * Add the various security params.
+ * <br>
+ * This API would clear existing security types and add a default one.
+ * @hide
+ */
+ public void setSecurityParams(SecurityParams params) {
+ // Clear existing data.
+ mSecurityParamsList = new ArrayList<>();
+ addSecurityParams(params);
+ }
+
+ /**
+ * Add the various security params to correspond to the provided security type.
+ * This is accomplished by setting the various BitSets exposed in WifiConfiguration.
*
* @param securityType One of the following security types:
* {@link #SECURITY_TYPE_OPEN},
@@ -491,103 +592,324 @@
* {@link #SECURITY_TYPE_PSK},
* {@link #SECURITY_TYPE_EAP},
* {@link #SECURITY_TYPE_SAE},
- * {@link #SECURITY_TYPE_EAP_SUITE_B},
* {@link #SECURITY_TYPE_OWE},
* {@link #SECURITY_TYPE_WAPI_PSK},
* {@link #SECURITY_TYPE_WAPI_CERT},
* {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
- * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT}
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @hide
*/
- public void setSecurityParams(@SecurityType int securityType) {
- // Clear all the bitsets.
- allowedKeyManagement.clear();
- allowedProtocols.clear();
- allowedAuthAlgorithms.clear();
- allowedPairwiseCiphers.clear();
- allowedGroupCiphers.clear();
- allowedGroupManagementCiphers.clear();
- allowedSuiteBCiphers.clear();
-
+ public void addSecurityParams(@SecurityType int securityType) {
+ // This ensures that there won't be duplicate security types.
+ if (mSecurityParamsList.stream().anyMatch(params -> params.isSecurityType(securityType))) {
+ throw new IllegalArgumentException("duplicate security type " + securityType);
+ }
+ SecurityParams params = null;
switch (securityType) {
case SECURITY_TYPE_OPEN:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
+ params = SecurityParams.createOpenParams();
break;
case SECURITY_TYPE_WEP:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
- allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
+ params = SecurityParams.createWepParams();
break;
case SECURITY_TYPE_PSK:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
+ params = SecurityParams.createWpaWpa2PersonalParams();
break;
case SECURITY_TYPE_EAP:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
+ params = SecurityParams.createWpaWpa2EnterpriseParams();
break;
case SECURITY_TYPE_SAE:
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.SAE);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_128);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_128);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- requirePmf = true;
+ params = SecurityParams.createWpa3PersonalParams();
break;
// The value of {@link SECURITY_TYPE_EAP_SUITE_B} is the same as
- // {@link SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT}, remove it to avoid
+ // {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT}, remove it to avoid
// duplicate case label errors.
case SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT:
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.SUITE_B_192);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_128);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_128);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- allowedGroupManagementCiphers.set(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256);
- // Note: allowedSuiteBCiphers bitset will be set by the service once the
- // certificates are attached to this profile
- requirePmf = true;
+ params = SecurityParams.createWpa3Enterprise192BitParams();
break;
case SECURITY_TYPE_OWE:
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.OWE);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_128);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_128);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- requirePmf = true;
+ params = SecurityParams.createEnhancedOpenParams();
break;
case SECURITY_TYPE_WAPI_PSK:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WAPI_PSK);
- allowedProtocols.set(WifiConfiguration.Protocol.WAPI);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.SMS4);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.SMS4);
+ params = SecurityParams.createWapiPskParams();
break;
case SECURITY_TYPE_WAPI_CERT:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WAPI_CERT);
- allowedProtocols.set(WifiConfiguration.Protocol.WAPI);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.SMS4);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.SMS4);
+ params = SecurityParams.createWapiCertParams();
break;
case SECURITY_TYPE_EAP_WPA3_ENTERPRISE:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- requirePmf = true;
+ params = SecurityParams.createWpa3EnterpriseParams();
+ break;
+ case SECURITY_TYPE_OSEN:
+ params = SecurityParams.createOsenParams();
+ break;
+ case SECURITY_TYPE_PASSPOINT_R1_R2:
+ params = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2);
+ break;
+ case SECURITY_TYPE_PASSPOINT_R3:
+ params = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3);
break;
default:
throw new IllegalArgumentException("unknown security type " + securityType);
}
+
+ addSecurityParams(params);
+ }
+
+ /** @hide */
+ public void addSecurityParams(@NonNull SecurityParams newParams) {
+ if (mSecurityParamsList.stream().anyMatch(params -> params.isSameSecurityType(newParams))) {
+ throw new IllegalArgumentException("duplicate security params " + newParams);
+ }
+ if (!mSecurityParamsList.isEmpty()) {
+ if (newParams.isEnterpriseSecurityType() && !isEnterprise()) {
+ throw new IllegalArgumentException(
+ "An enterprise security type cannot be added to a personal configuation.");
+ }
+ if (!newParams.isEnterpriseSecurityType() && isEnterprise()) {
+ throw new IllegalArgumentException(
+ "A personal security type cannot be added to an enterprise configuation.");
+ }
+ if (newParams.isOpenSecurityType() && !isOpenNetwork()) {
+ throw new IllegalArgumentException(
+ "An open security type cannot be added to a non-open configuation.");
+ }
+ if (!newParams.isOpenSecurityType() && isOpenNetwork()) {
+ throw new IllegalArgumentException(
+ "A non-open security type cannot be added to an open configuation.");
+ }
+ if (newParams.isSecurityType(SECURITY_TYPE_OSEN)) {
+ throw new IllegalArgumentException(
+ "An OSEN security type must be the only one type.");
+ }
+ }
+ mSecurityParamsList.add(new SecurityParams(newParams));
+ updateLegacySecurityParams();
+ }
+
+ /**
+ * If there is no security params, generate one according to legacy fields.
+ * @hide
+ */
+ public void convertLegacyFieldsToSecurityParamsIfNeeded() {
+ if (!mSecurityParamsList.isEmpty()) return;
+
+ if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) {
+ setSecurityParams(SECURITY_TYPE_WAPI_CERT);
+ } else if (allowedKeyManagement.get(KeyMgmt.WAPI_PSK)) {
+ setSecurityParams(SECURITY_TYPE_WAPI_PSK);
+ } else if (allowedKeyManagement.get(KeyMgmt.SUITE_B_192)) {
+ setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
+ } else if (allowedKeyManagement.get(KeyMgmt.OWE)) {
+ setSecurityParams(SECURITY_TYPE_OWE);
+ } else if (allowedKeyManagement.get(KeyMgmt.SAE)) {
+ setSecurityParams(SECURITY_TYPE_SAE);
+ } else if (allowedKeyManagement.get(KeyMgmt.OSEN)) {
+ setSecurityParams(SECURITY_TYPE_OSEN);
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
+ setSecurityParams(SECURITY_TYPE_PSK);
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
+ if (requirePmf) {
+ setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
+ } else {
+ setSecurityParams(SECURITY_TYPE_EAP);
+ }
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
+ setSecurityParams(SECURITY_TYPE_PSK);
+ } else if (allowedKeyManagement.get(KeyMgmt.NONE)) {
+ if (hasWepKeys()) {
+ setSecurityParams(SECURITY_TYPE_WEP);
+ } else {
+ setSecurityParams(SECURITY_TYPE_OPEN);
+ }
+ } else {
+ setSecurityParams(SECURITY_TYPE_OPEN);
+ }
+ }
+
+ /**
+ * Disable the various security params to correspond to the provided security type.
+ * This is accomplished by setting the various BitSets exposed in WifiConfiguration.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @hide
+ */
+ public void setSecurityParamsEnabled(@SecurityType int securityType, boolean enable) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(securityType))
+ .findAny()
+ .ifPresent(params -> params.setEnabled(enable));
+ }
+
+ /**
+ * Get the specific security param.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @return the copy of specific security params if found; otherwise null.
+ * @hide
+ */
+ public @Nullable SecurityParams getSecurityParams(@SecurityType int securityType) {
+ SecurityParams p = mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(securityType))
+ .findAny()
+ .orElse(null);
+ return (p != null) ? new SecurityParams(p) : null;
+ }
+
+ /**
+ * Indicate whether this configuration is the specific security type.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @return true if there is a security params matches the type.
+ * @hide
+ */
+ public boolean isSecurityType(@SecurityType int securityType) {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.isSecurityType(securityType));
+ }
+
+ /**
+ * Get the security params list of this configuration.
+ *
+ * The returning list is a priority list, the first is the lowest priority and default one.
+ *
+ * @return this list of security params.
+ * @hide
+ */
+ public List<SecurityParams> getSecurityParamsList() {
+ return Collections.unmodifiableList(mSecurityParamsList);
+ }
+
+ /**
+ * Enable the support of Fast Initial Link Set-up (FILS).
+ *
+ * FILS can be applied to all security types.
+ * @param enableFilsSha256 Enable FILS SHA256.
+ * @param enableFilsSha384 Enable FILS SHA256.
+ * @hide
+ */
+ public void enableFils(boolean enableFilsSha256, boolean enableFilsSha384) {
+ mSecurityParamsList.stream()
+ .forEach(params -> params.enableFils(enableFilsSha256, enableFilsSha384));
+ updateLegacySecurityParams();
+ }
+
+ /**
+ * Indicate FILS SHA256 is enabled.
+ *
+ * @return true if FILS SHA256 is enabled.
+ * @hide
+ */
+ public boolean isFilsSha256Enabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedKeyManagement().get(KeyMgmt.FILS_SHA256));
+ }
+
+ /**
+ * Indicate FILS SHA384 is enabled.
+ *
+ * @return true if FILS SHA384 is enabled.
+ * @hide
+ */
+ public boolean isFilsSha384Enabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedKeyManagement().get(KeyMgmt.FILS_SHA384));
+ }
+
+ /**
+ * Enable Suite-B ciphers.
+ *
+ * @param enableEcdheEcdsa enable Diffie-Hellman with Elliptic Curve ECDSA cipher support.
+ * @param enableEcdheRsa enable Diffie-Hellman with RSA cipher support.
+ * @hide
+ */
+ public void enableSuiteBCiphers(boolean enableEcdheEcdsa, boolean enableEcdheRsa) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT))
+ .findAny()
+ .ifPresent(params -> params.enableSuiteBCiphers(enableEcdheEcdsa, enableEcdheRsa));
+ updateLegacySecurityParams();
+ }
+
+ /**
+ * Indicate ECDHE_ECDSA is enabled.
+ *
+ * @return true if enabled.
+ * @hide
+ */
+ public boolean isSuiteBCipherEcdheEcdsaEnabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedSuiteBCiphers().get(SuiteBCipher.ECDHE_ECDSA));
+ }
+
+ /**
+ * Indicate ECDHE_RSA is enabled.
+ *
+ * @return true if enabled.
+ * @hide
+ */
+ public boolean isSuiteBCipherEcdheRsaEnabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedSuiteBCiphers().get(SuiteBCipher.ECDHE_RSA));
+ }
+
+ /**
+ * Set SAE Hash-toElement only mode enabled.
+ *
+ * @param enable true if enabled; false otherwise.
+ * @hide
+ */
+ public void enableSaeH2eOnlyMode(boolean enable) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(SECURITY_TYPE_SAE))
+ .findAny()
+ .ifPresent(params -> params.enableSaeH2eOnlyMode(enable));
+ }
+
+ /**
+ * Set SAE Public-Key only mode enabled.
+ *
+ * @param enable true if enabled; false otherwise.
+ * @hide
+ */
+ public void enableSaePkOnlyMode(boolean enable) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(SECURITY_TYPE_SAE))
+ .findAny()
+ .ifPresent(params -> params.enableSaePkOnlyMode(enable));
}
/** @hide */
@@ -1161,27 +1483,25 @@
return metered;
}
- /**
- * @hide
- * Returns true if this WiFi config is for an open network.
- */
- public boolean isOpenNetwork() {
- final int cardinality = allowedKeyManagement.cardinality();
- final boolean hasNoKeyMgmt = cardinality == 0
- || (cardinality == 1 && (allowedKeyManagement.get(KeyMgmt.NONE)
- || allowedKeyManagement.get(KeyMgmt.OWE)));
-
- boolean hasNoWepKeys = true;
- if (wepKeys != null) {
- for (int i = 0; i < wepKeys.length; i++) {
- if (wepKeys[i] != null) {
- hasNoWepKeys = false;
- break;
- }
+ /** Check whether wep keys exist. */
+ private boolean hasWepKeys() {
+ if (wepKeys == null) return false;
+ for (int i = 0; i < wepKeys.length; i++) {
+ if (wepKeys[i] != null) {
+ return true;
}
}
+ return false;
+ }
- return hasNoKeyMgmt && hasNoWepKeys;
+ /**
+ * @hide
+ * Returns true if this WiFi config is for an Open or Enhanced Open network.
+ */
+ public boolean isOpenNetwork() {
+ boolean hasNonOpenSecurityType = mSecurityParamsList.stream()
+ .anyMatch(params -> !params.isOpenSecurityType());
+ return !hasNonOpenSecurityType && !hasWepKeys();
}
/**
@@ -1638,6 +1958,11 @@
private String mConnectChoice;
/**
+ * The RSSI when the user made the connectChoice.
+ */
+ private int mConnectChoiceRssi;
+
+ /**
* Used to cache the temporary candidate during the network selection procedure. It will be
* kept updating once a new scan result has a higher score than current one
*/
@@ -1748,6 +2073,23 @@
mConnectChoice = newConnectChoice;
}
+ /**
+ * Associate a RSSI with the user connect choice network.
+ * @param rssi signal strength
+ * @hide
+ */
+ public void setConnectChoiceRssi(int rssi) {
+ mConnectChoiceRssi = rssi;
+ }
+
+ /**
+ * @return returns the RSSI of the last time the user made the connect choice.
+ * @hide
+ */
+ public int getConnectChoiceRssi() {
+ return mConnectChoiceRssi;
+ }
+
/** Get the current Quality network selection status as a String (for debugging). */
@NonNull
public String getNetworkStatusString() {
@@ -2051,6 +2393,7 @@
setCandidate(source.getCandidate());
setCandidateScore(source.getCandidateScore());
setConnectChoice(source.getConnectChoice());
+ setConnectChoiceRssi(source.getConnectChoiceRssi());
setHasEverConnected(source.hasEverConnected());
setHasNeverDetectedCaptivePortal(source.hasNeverDetectedCaptivePortal());
}
@@ -2068,6 +2411,7 @@
if (getConnectChoice() != null) {
dest.writeInt(CONNECT_CHOICE_EXISTS);
dest.writeString(getConnectChoice());
+ dest.writeInt(getConnectChoiceRssi());
} else {
dest.writeInt(CONNECT_CHOICE_NOT_EXISTS);
}
@@ -2087,6 +2431,7 @@
setNetworkSelectionBSSID(in.readString());
if (in.readInt() == CONNECT_CHOICE_EXISTS) {
setConnectChoice(in.readString());
+ setConnectChoiceRssi(in.readInt());
} else {
setConnectChoice(null);
}
@@ -2340,12 +2685,11 @@
*/
@UnsupportedAppUsage
public boolean isEnterprise() {
- return (allowedKeyManagement.get(KeyMgmt.WPA_EAP)
- || allowedKeyManagement.get(KeyMgmt.IEEE8021X)
- || allowedKeyManagement.get(KeyMgmt.SUITE_B_192)
- || allowedKeyManagement.get(KeyMgmt.WAPI_CERT))
+ boolean hasEnterpriseSecurityType = mSecurityParamsList.stream()
+ .anyMatch(params -> params.isEnterpriseSecurityType());
+ return (hasEnterpriseSecurityType
&& enterpriseConfig != null
- && enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.NONE;
+ && enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.NONE);
}
private static String logTimeOfDay(long millis) {
@@ -2398,6 +2742,8 @@
}
if (mNetworkSelectionStatus.getConnectChoice() != null) {
sbuf.append(" connect choice: ").append(mNetworkSelectionStatus.getConnectChoice());
+ sbuf.append(" connect choice rssi: ")
+ .append(mNetworkSelectionStatus.getConnectChoiceRssi());
}
sbuf.append(" hasEverConnected: ")
.append(mNetworkSelectionStatus.hasEverConnected()).append("\n");
@@ -2525,6 +2871,10 @@
sbuf.append('*');
}
+ sbuf.append("\nSecurityParams List:\n");
+ mSecurityParamsList.stream()
+ .forEach(params -> sbuf.append(params.toString()));
+
sbuf.append("\nEnterprise config:\n");
sbuf.append(enterpriseConfig);
@@ -2973,6 +3323,7 @@
allowedGroupCiphers = (BitSet) source.allowedGroupCiphers.clone();
allowedGroupManagementCiphers = (BitSet) source.allowedGroupManagementCiphers.clone();
allowedSuiteBCiphers = (BitSet) source.allowedSuiteBCiphers.clone();
+ mSecurityParamsList = new ArrayList(source.mSecurityParamsList);
enterpriseConfig = new WifiEnterpriseConfig(source.enterpriseConfig);
defaultGwMacAddress = source.defaultGwMacAddress;
@@ -3063,6 +3414,10 @@
writeBitSet(dest, allowedGroupManagementCiphers);
writeBitSet(dest, allowedSuiteBCiphers);
+ dest.writeInt(mSecurityParamsList.size());
+ mSecurityParamsList.stream()
+ .forEach(params -> params.writeToParcel(dest, flags));
+
dest.writeParcelable(enterpriseConfig, flags);
dest.writeParcelable(mIpConfiguration, flags);
@@ -3144,6 +3499,11 @@
config.allowedGroupManagementCiphers = readBitSet(in);
config.allowedSuiteBCiphers = readBitSet(in);
+ int numSecurityParams = in.readInt();
+ for (int i = 0; i < numSecurityParams; i++) {
+ config.mSecurityParamsList.add(SecurityParams.createFromParcel(in));
+ }
+
config.enterpriseConfig = in.readParcelable(null);
config.setIpConfiguration(in.readParcelable(null));
config.dhcpServer = in.readString();
@@ -3226,9 +3586,10 @@
* @hide
*/
public boolean needsPreSharedKey() {
- return allowedKeyManagement.get(KeyMgmt.WPA_PSK)
- || allowedKeyManagement.get(KeyMgmt.SAE)
- || allowedKeyManagement.get(KeyMgmt.WAPI_PSK);
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.isSecurityType(SECURITY_TYPE_PSK)
+ || params.isSecurityType(SECURITY_TYPE_SAE)
+ || params.isSecurityType(SECURITY_TYPE_WAPI_PSK));
}
/**
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 2b931a3..bccb241 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -34,7 +34,6 @@
import android.app.ActivityManager;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
-import android.content.pm.ParceledListSlice;
import android.net.ConnectivityManager;
import android.net.DhcpInfo;
import android.net.MacAddress;
@@ -63,6 +62,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.modules.utils.ParceledListSlice;
import com.android.modules.utils.build.SdkLevel;
import java.lang.annotation.Retention;
@@ -3041,6 +3041,37 @@
}
/**
+ * Restart the Wi-Fi subsystem.
+ *
+ * Restarts the Wi-Fi subsystem - effectively disabling it and re-enabling it. All existing
+ * Access Point (AP) associations are torn down, all Soft APs are disabled, Wi-Fi Direct and
+ * Wi-Fi Aware are disabled.
+ *
+ * The state of the system after restart is not guaranteed to match its state before the API is
+ * called - for instance the device may associate to a different Access Point (AP), and tethered
+ * hotspots may or may not be restored.
+ *
+ * @param reason If non-null, requests a bug report and attaches the reason string to it. A bug
+ * report may still not be generated based on framework criteria - for instance,
+ * build type or throttling. The WiFi subsystem is restarted whether or not a bug
+ * report is requested or generated.
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.NETWORK_AIRPLANE_MODE)
+ public void restartWifiSubsystem(@Nullable String reason) {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ try {
+ mService.restartWifiSubsystem(reason);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Gets the Wi-Fi enabled state.
* @return One of {@link #WIFI_STATE_DISABLED},
* {@link #WIFI_STATE_DISABLING}, {@link #WIFI_STATE_ENABLED},
@@ -3985,6 +4016,11 @@
/**
* Called when information of softap changes.
*
+ * Note: this API is only valid when the Soft AP is configured as a single AP
+ * - not as a bridged AP (2 Soft APs). When the Soft AP is configured as bridged AP
+ * this callback will not be triggered - use the
+ * {@link #onInfoListChanged(List<SoftApInfo>)} callback in bridged AP mode.
+ *
* @param softApInfo is the softap information. {@link SoftApInfo}
*/
default void onInfoChanged(@NonNull SoftApInfo softApInfo) {
@@ -3992,6 +4028,24 @@
}
/**
+ * Called when information of softap changes.
+ *
+ * The number of the information elements in the list depends on Soft AP configuration
+ * and state.
+ * For instance, an empty list will be returned when the Soft AP is disabled.
+ * One information element will be returned in the list when the Soft AP is configured
+ * as a single AP, and two information elements will be returned in the list
+ * when the Soft AP is configured in bridged mode.
+ *
+ * See {@link #isBridgedApConcurrencySupported()} for the detail of the bridged AP.
+ *
+ * @param softApInfoList is the list of the softap information elements. {@link SoftApInfo}
+ */
+ default void onInfoListChanged(@NonNull List<SoftApInfo> softApInfoList) {
+ // Do nothing: can be updated to add SoftApInfo details (e.g. channel) to the UI.
+ }
+
+ /**
* Called when capability of softap changes.
*
* @param softApCapability is the softap capability. {@link SoftApCapability}
@@ -4071,6 +4125,19 @@
}
@Override
+ public void onInfoListChanged(List<SoftApInfo> softApInfoList) {
+ if (mVerboseLoggingEnabled) {
+ Log.v(TAG, "SoftApCallbackProxy: onInfoListChange: softApInfoList="
+ + softApInfoList);
+ }
+
+ Binder.clearCallingIdentity();
+ mExecutor.execute(() -> {
+ mCallback.onInfoListChanged(softApInfoList);
+ });
+ }
+
+ @Override
public void onCapabilityChanged(SoftApCapability capability) {
if (mVerboseLoggingEnabled) {
Log.v(TAG, "SoftApCallbackProxy: onCapabilityChanged: SoftApCapability="
@@ -4580,7 +4647,9 @@
* @hide
*/
@SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.NETWORK_SETTINGS,
+ android.Manifest.permission.NETWORK_SETUP_WIZARD})
public void startTemporarilyDisablingAllNonCarrierMergedWifi(int subscriptionId) {
try {
mService.startTemporarilyDisablingAllNonCarrierMergedWifi(subscriptionId);
@@ -4595,7 +4664,9 @@
* @hide
*/
@SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.NETWORK_SETTINGS,
+ android.Manifest.permission.NETWORK_SETUP_WIZARD})
public void stopTemporarilyDisablingAllNonCarrierMergedWifi() {
try {
mService.stopTemporarilyDisablingAllNonCarrierMergedWifi();
diff --git a/wifi/java/android/net/wifi/rtt/RangingRequest.java b/wifi/java/android/net/wifi/rtt/RangingRequest.java
index 318efa6..04dfcf2 100644
--- a/wifi/java/android/net/wifi/rtt/RangingRequest.java
+++ b/wifi/java/android/net/wifi/rtt/RangingRequest.java
@@ -30,8 +30,11 @@
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.modules.utils.build.SdkLevel;
+
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import java.util.StringJoiner;
/**
@@ -46,6 +49,9 @@
*/
public final class RangingRequest implements Parcelable {
private static final int MAX_PEERS = 10;
+ private static final int DEFAULT_RTT_BURST_SIZE = 8;
+ private static final int MIN_RTT_BURST_SIZE = 2;
+ private static final int MAX_RTT_BURST_SIZE = 17;
/**
* Returns the maximum number of peers to range which can be specified in a single {@code
@@ -59,12 +65,80 @@
return MAX_PEERS;
}
+ /**
+ * Returns the default RTT burst size used to determine the average range.
+ *
+ * @return the RTT burst size used by default
+ */
+ public static int getDefaultRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return DEFAULT_RTT_BURST_SIZE;
+ }
+
+ /**
+ * Returns the minimum RTT burst size that can be used to determine a average range.
+ *
+ * @return the minimum RTT burst size that can be used
+ */
+ public static int getMinRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return MIN_RTT_BURST_SIZE;
+ }
+
+ /**
+ * Returns the minimum RTT burst size that can be used to determine a average range.
+ *
+ * @return the maximum RTT burst size that can be used
+ */
+ public static int getMaxRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return MAX_RTT_BURST_SIZE;
+ }
+
/** @hide */
public final List<ResponderConfig> mRttPeers;
/** @hide */
- private RangingRequest(List<ResponderConfig> rttPeers) {
+ public final int mRttBurstSize;
+
+ /** @hide */
+ private RangingRequest(List<ResponderConfig> rttPeers, int rttBurstSize) {
mRttPeers = rttPeers;
+ mRttBurstSize = rttBurstSize;
+ }
+
+ /**
+ * Returns the list of RTT capable peers.
+ *
+ * @return the list of RTT capable peers in a common system representation
+ *
+ * @hide
+ */
+ @SystemApi
+ @NonNull
+ public List<ResponderConfig> getRttPeers() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return mRttPeers;
+ }
+
+ /**
+ * Returns the RTT burst size used to determine the average range.
+ *
+ * @return the RTT burst size used
+ */
+ public int getRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return mRttBurstSize;
}
@Override
@@ -75,6 +149,7 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeList(mRttPeers);
+ dest.writeInt(mRttBurstSize);
}
public static final @android.annotation.NonNull Creator<RangingRequest> CREATOR = new Creator<RangingRequest>() {
@@ -85,7 +160,7 @@
@Override
public RangingRequest createFromParcel(Parcel in) {
- return new RangingRequest(in.readArrayList(null));
+ return new RangingRequest(in.readArrayList(null), in.readInt());
}
};
@@ -105,12 +180,20 @@
throw new IllegalArgumentException(
"Ranging to too many peers requested. Use getMaxPeers() API to get limit.");
}
-
for (ResponderConfig peer: mRttPeers) {
if (!peer.isValid(awareSupported)) {
throw new IllegalArgumentException("Invalid Responder specification");
}
}
+ if (SdkLevel.isAtLeastS()) {
+ if (mRttBurstSize < getMinRttBurstSize() || mRttBurstSize > getMaxRttBurstSize()) {
+ throw new IllegalArgumentException("RTT burst size is out of range");
+ }
+ } else {
+ if (mRttBurstSize != DEFAULT_RTT_BURST_SIZE) {
+ throw new IllegalArgumentException("RTT burst size is not the default value");
+ }
+ }
}
/**
@@ -118,6 +201,32 @@
*/
public static final class Builder {
private List<ResponderConfig> mRttPeers = new ArrayList<>();
+ private int mRttBurstSize = DEFAULT_RTT_BURST_SIZE;
+
+ /**
+ * Set the RTT Burst size for the ranging request.
+ * <p>
+ * If not set, the default RTT burst size given by
+ * {@link #getDefaultRttBurstSize()} is used to determine the default value.
+ * If set, the value must be in the range {@link #getMinRttBurstSize()} and
+ * {@link #getMaxRttBurstSize()} inclusively, or a
+ * {@link java.lang.IllegalArgumentException} will be thrown.
+ *
+ * @param rttBurstSize The number of FTM packets used to estimate a range.
+ * @return The builder to facilitate chaining
+ * {@code builder.setXXX(..).setXXX(..)}.
+ */
+ @NonNull
+ public Builder setRttBurstSize(int rttBurstSize) {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ if (rttBurstSize < MIN_RTT_BURST_SIZE || rttBurstSize > MAX_RTT_BURST_SIZE) {
+ throw new IllegalArgumentException("RTT burst size out of range.");
+ }
+ mRttBurstSize = rttBurstSize;
+ return this;
+ }
/**
* Add the device specified by the {@link ScanResult} to the list of devices with
@@ -241,7 +350,7 @@
* builder.
*/
public RangingRequest build() {
- return new RangingRequest(mRttPeers);
+ return new RangingRequest(mRttPeers, mRttBurstSize);
}
}
@@ -257,11 +366,13 @@
RangingRequest lhs = (RangingRequest) o;
- return mRttPeers.size() == lhs.mRttPeers.size() && mRttPeers.containsAll(lhs.mRttPeers);
+ return mRttPeers.size() == lhs.mRttPeers.size()
+ && mRttPeers.containsAll(lhs.mRttPeers)
+ && mRttBurstSize == lhs.mRttBurstSize;
}
@Override
public int hashCode() {
- return mRttPeers.hashCode();
+ return Objects.hash(mRttPeers, mRttBurstSize);
}
}
diff --git a/wifi/tests/src/android/net/wifi/SecurityParamsTest.java b/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
new file mode 100644
index 0000000..2f6b724
--- /dev/null
+++ b/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
@@ -0,0 +1,502 @@
+/*
+ * Copyright (C) 2020 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.net.wifi;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.net.wifi.WifiConfiguration.AuthAlgorithm;
+import android.net.wifi.WifiConfiguration.GroupCipher;
+import android.net.wifi.WifiConfiguration.GroupMgmtCipher;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
+import android.net.wifi.WifiConfiguration.PairwiseCipher;
+import android.net.wifi.WifiConfiguration.Protocol;
+import android.os.Parcel;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+
+import java.util.BitSet;
+
+/**
+ * Unit tests for {@link android.net.wifi.WifiInfo}.
+ */
+@SmallTest
+public class SecurityParamsTest {
+
+ private void verifySecurityParams(SecurityParams params,
+ int expectedSecurityType,
+ int[] expectedAllowedKeyManagement,
+ int[] expectedAllowedProtocols,
+ int[] expectedAllowedAuthAlgorithms,
+ int[] expectedAllowedPairwiseCiphers,
+ int[] expectedAllowedGroupCiphers,
+ boolean expectedRequirePmf) {
+ assertTrue(params.isSecurityType(expectedSecurityType));
+ for (int b: expectedAllowedKeyManagement) {
+ assertTrue(params.getAllowedKeyManagement().get(b));
+ }
+ for (int b: expectedAllowedProtocols) {
+ assertTrue(params.getAllowedProtocols().get(b));
+ }
+ for (int b: expectedAllowedAuthAlgorithms) {
+ assertTrue(params.getAllowedAuthAlgorithms().get(b));
+ }
+ for (int b: expectedAllowedPairwiseCiphers) {
+ assertTrue(params.getAllowedPairwiseCiphers().get(b));
+ }
+ for (int b: expectedAllowedGroupCiphers) {
+ assertTrue(params.getAllowedGroupCiphers().get(b));
+ }
+ assertEquals(expectedRequirePmf, params.isRequirePmf());
+ }
+
+ /** Verify EAP params creator. */
+ @Test
+ public void testEapCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpaWpa2EnterpriseParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_EAP;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Passpoint R1 params creator. */
+ @Test
+ public void testEapPasspointR1Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Passpoint R2 params creator. */
+ @Test
+ public void testEapPasspointR2Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Passpoint R3 params creator. */
+ @Test
+ public void testEapPasspointR3Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R3;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Enhanced Open params creator. */
+ @Test
+ public void testEnhancedOpenCreator() throws Exception {
+ SecurityParams p = SecurityParams.createEnhancedOpenParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_OWE;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.OWE};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {
+ GroupCipher.CCMP, GroupCipher.GCMP_128, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Open params creator. */
+ @Test
+ public void testOpenCreator() throws Exception {
+ SecurityParams p = SecurityParams.createOpenParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_OPEN;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.NONE};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify OSEN params creator. */
+ @Test
+ public void testOsenCreator() throws Exception {
+ SecurityParams p = SecurityParams.createOsenParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_OSEN;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.OSEN};
+ int[] expectedAllowedProtocols = new int[] {Protocol.OSEN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WAPI CERT params creator. */
+ @Test
+ public void testWapiCertCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWapiCertParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_CERT;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WAPI_CERT};
+ int[] expectedAllowedProtocols = new int[] {Protocol.WAPI};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {PairwiseCipher.SMS4};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.SMS4};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WAPI PSK params creator. */
+ @Test
+ public void testWapiPskCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWapiPskParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_PSK;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WAPI_PSK};
+ int[] expectedAllowedProtocols = new int[] {Protocol.WAPI};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {PairwiseCipher.SMS4};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.SMS4};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WEP params creator. */
+ @Test
+ public void testWepCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWepParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_WEP;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.NONE};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {AuthAlgorithm.OPEN, AuthAlgorithm.SHARED};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WPA3 Enterprise 192-bit params creator. */
+ @Test
+ public void testWpa3Enterprise192BitCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3Enterprise192BitParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT;
+ int[] expectedAllowedKeyManagement = new int[] {
+ KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X, KeyMgmt.SUITE_B_192};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.GCMP_128, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+
+ assertTrue(p.getAllowedGroupManagementCiphers().get(GroupMgmtCipher.BIP_GMAC_256));
+ }
+
+ /** Verify WPA3 Enterprise params creator. */
+ @Test
+ public void testWpa3EnterpriseCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3EnterpriseParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.CCMP, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WPA3 Personal params creator. */
+ @Test
+ public void testWpa3PersonalCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3PersonalParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_SAE;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.SAE};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {
+ GroupCipher.CCMP, GroupCipher.GCMP_128, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WPA2 Personal EAP params creator. */
+ @Test
+ public void testWpaWpa2PersonalCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpaWpa2PersonalParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PSK;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_PSK};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify setter/getter methods */
+ @Test
+ public void testCommonSetterGetter() throws Exception {
+ SecurityParams params = SecurityParams.createWpaWpa2PersonalParams();
+
+ // PSK setting
+ BitSet allowedKeyManagement = new BitSet();
+ allowedKeyManagement.set(KeyMgmt.WPA_PSK);
+
+ BitSet allowedProtocols = new BitSet();
+ allowedProtocols.set(Protocol.RSN);
+ allowedProtocols.set(Protocol.WPA);
+
+ BitSet allowedPairwiseCiphers = new BitSet();
+ allowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ allowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ BitSet allowedGroupCiphers = new BitSet();
+ allowedGroupCiphers.set(GroupCipher.CCMP);
+ allowedGroupCiphers.set(GroupCipher.TKIP);
+ allowedGroupCiphers.set(GroupCipher.WEP40);
+ allowedGroupCiphers.set(GroupCipher.WEP104);
+
+ assertEquals(allowedKeyManagement, params.getAllowedKeyManagement());
+ assertTrue(params.getAllowedKeyManagement().get(KeyMgmt.WPA_PSK));
+
+ assertEquals(allowedProtocols, params.getAllowedProtocols());
+ assertTrue(params.getAllowedProtocols().get(Protocol.RSN));
+ assertTrue(params.getAllowedProtocols().get(Protocol.WPA));
+
+ assertEquals(allowedPairwiseCiphers, params.getAllowedPairwiseCiphers());
+ assertTrue(params.getAllowedPairwiseCiphers().get(PairwiseCipher.CCMP));
+ assertTrue(params.getAllowedPairwiseCiphers().get(PairwiseCipher.TKIP));
+
+ assertEquals(allowedGroupCiphers, params.getAllowedGroupCiphers());
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.CCMP));
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.TKIP));
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.WEP40));
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.WEP104));
+
+ params.setEnabled(false);
+ assertFalse(params.isEnabled());
+ }
+
+ /** Verify SAE-specific methods */
+ @Test
+ public void testSaeMethods() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3PersonalParams();
+
+ assertFalse(p.isAddedByAutoUpgrade());
+ p.setIsAddedByAutoUpgrade(true);
+ assertTrue(p.isAddedByAutoUpgrade());
+
+ assertFalse(p.isSaeH2eOnlyMode());
+ p.enableSaeH2eOnlyMode(true);
+ assertTrue(p.isSaeH2eOnlyMode());
+
+ assertFalse(p.isSaePkOnlyMode());
+ p.enableSaePkOnlyMode(true);
+ assertTrue(p.isSaePkOnlyMode());
+ }
+
+ /** Verify copy constructor. */
+ @Test
+ public void testCopyConstructor() throws Exception {
+ SecurityParams params = SecurityParams.createWpaWpa2PersonalParams();
+ params.setEnabled(false);
+ params.setIsAddedByAutoUpgrade(true);
+
+ SecurityParams copiedParams = new SecurityParams(params);
+
+ assertTrue(params.isSameSecurityType(copiedParams));
+ assertEquals(params.getAllowedKeyManagement(), copiedParams.getAllowedKeyManagement());
+ assertEquals(params.getAllowedProtocols(), copiedParams.getAllowedProtocols());
+ assertEquals(params.getAllowedAuthAlgorithms(), copiedParams.getAllowedAuthAlgorithms());
+ assertEquals(params.getAllowedPairwiseCiphers(), copiedParams.getAllowedPairwiseCiphers());
+ assertEquals(params.getAllowedGroupCiphers(), copiedParams.getAllowedGroupCiphers());
+ assertEquals(params.getAllowedGroupManagementCiphers(),
+ copiedParams.getAllowedGroupManagementCiphers());
+ assertEquals(params.getAllowedSuiteBCiphers(), copiedParams.getAllowedSuiteBCiphers());
+ assertEquals(params.isRequirePmf(), copiedParams.isRequirePmf());
+ assertEquals(params.isEnabled(), copiedParams.isEnabled());
+ assertEquals(params.isSaeH2eOnlyMode(), copiedParams.isSaeH2eOnlyMode());
+ assertEquals(params.isSaePkOnlyMode(), copiedParams.isSaePkOnlyMode());
+ assertEquals(params.isAddedByAutoUpgrade(), copiedParams.isAddedByAutoUpgrade());
+ }
+
+ /** Check that two params are equal if and only if their types are the same. */
+ @Test
+ public void testEquals() {
+ SecurityParams saeParams1 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams saeParams2 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams pskParams = SecurityParams.createWpaWpa2PersonalParams();
+ assertEquals(saeParams1, saeParams2);
+ assertNotEquals(saeParams1, pskParams);
+ }
+
+ /** Check that hash values are the same if and only if their types are the same. */
+ @Test
+ public void testHashCode() {
+ SecurityParams saeParams1 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams saeParams2 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams pskParams = SecurityParams.createWpaWpa2PersonalParams();
+ assertEquals(saeParams1.hashCode(), saeParams2.hashCode());
+ assertNotEquals(saeParams1.hashCode(), pskParams.hashCode());
+ }
+
+ /** Verify open network check */
+ @Test
+ public void testIsOpenNetwork() {
+ SecurityParams[] openSecurityParams = new SecurityParams[] {
+ SecurityParams.createEnhancedOpenParams(),
+ SecurityParams.createOpenParams(),
+ };
+ for (SecurityParams p: openSecurityParams) {
+ assertTrue(p.isOpenSecurityType());
+ }
+
+ SecurityParams[] nonOpenSecurityParams = new SecurityParams[] {
+ SecurityParams.createWpaWpa2EnterpriseParams(),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3),
+ SecurityParams.createOsenParams(),
+ SecurityParams.createWapiCertParams(),
+ SecurityParams.createWapiPskParams(),
+ SecurityParams.createWepParams(),
+ SecurityParams.createWpa3Enterprise192BitParams(),
+ SecurityParams.createWpa3EnterpriseParams(),
+ SecurityParams.createWpa3PersonalParams(),
+ SecurityParams.createWpaWpa2PersonalParams(),
+ };
+ for (SecurityParams p: nonOpenSecurityParams) {
+ assertFalse(p.isOpenSecurityType());
+ }
+ }
+
+ /** Verify enterprise network check */
+ @Test
+ public void testIsEnterpriseNetwork() {
+ SecurityParams[] enterpriseSecurityParams = new SecurityParams[] {
+ SecurityParams.createWpaWpa2EnterpriseParams(),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3),
+ SecurityParams.createWapiCertParams(),
+ SecurityParams.createWpa3Enterprise192BitParams(),
+ SecurityParams.createWpa3EnterpriseParams(),
+ };
+ for (SecurityParams p: enterpriseSecurityParams) {
+ assertTrue(p.isEnterpriseSecurityType());
+ }
+
+ SecurityParams[] nonEnterpriseSecurityParams = new SecurityParams[] {
+ SecurityParams.createEnhancedOpenParams(),
+ SecurityParams.createOpenParams(),
+ SecurityParams.createOsenParams(),
+ SecurityParams.createWapiPskParams(),
+ SecurityParams.createWepParams(),
+ SecurityParams.createWpa3PersonalParams(),
+ SecurityParams.createWpaWpa2PersonalParams(),
+ };
+ for (SecurityParams p: nonEnterpriseSecurityParams) {
+ assertFalse(p.isEnterpriseSecurityType());
+ }
+ }
+
+ /** Check that parcel marshalling/unmarshalling works */
+ @Test
+ public void testParcelMethods() {
+ SecurityParams params = SecurityParams.createWpa3PersonalParams();
+
+ Parcel parcelW = Parcel.obtain();
+ params.writeToParcel(parcelW, 0);
+ byte[] bytes = parcelW.marshall();
+ parcelW.recycle();
+
+ Parcel parcelR = Parcel.obtain();
+ parcelR.unmarshall(bytes, 0, bytes.length);
+ parcelR.setDataPosition(0);
+
+ SecurityParams reParams = SecurityParams.createFromParcel(parcelR);
+ assertEquals(params, reParams);
+ }
+}
diff --git a/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java b/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java
index 702212b..9e3b022 100644
--- a/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java
+++ b/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java
@@ -42,10 +42,12 @@
| SoftApCapability.SOFTAP_FEATURE_ACS_OFFLOAD;
int[] testSupported2Glist = {1, 2, 3, 4};
int[] testSupported5Glist = {36, 149};
+ int[] testSupported60Glist = {1, 2};
SoftApCapability capability = new SoftApCapability(testSoftApFeature);
capability.setMaxSupportedClients(10);
capability.setSupportedChannelList(SoftApConfiguration.BAND_2GHZ, testSupported2Glist);
capability.setSupportedChannelList(SoftApConfiguration.BAND_5GHZ, testSupported5Glist);
+ capability.setSupportedChannelList(SoftApConfiguration.BAND_60GHZ, testSupported60Glist);
SoftApCapability copiedCapability = new SoftApCapability(capability);
@@ -64,9 +66,11 @@
capability.setMaxSupportedClients(10);
int[] testSupported2Glist = {1, 2, 3, 4};
int[] testSupported5Glist = {36, 149};
+ int[] testSupported60Glist = {1, 2};
capability.setSupportedChannelList(SoftApConfiguration.BAND_2GHZ, testSupported2Glist);
capability.setSupportedChannelList(SoftApConfiguration.BAND_5GHZ, testSupported5Glist);
+ capability.setSupportedChannelList(SoftApConfiguration.BAND_60GHZ, testSupported60Glist);
Parcel parcelW = Parcel.obtain();
capability.writeToParcel(parcelW, 0);
diff --git a/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java b/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
index ad0fdd3..a609a12 100644
--- a/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
+++ b/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
@@ -20,6 +20,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
import android.net.MacAddress;
import android.os.Parcel;
@@ -371,6 +372,7 @@
@Test
public void testDualBands() {
+ assumeTrue(SdkLevel.isAtLeastS());
int[] dual_bands = new int[2];
dual_bands[0] = SoftApConfiguration.BAND_2GHZ;
dual_bands[1] = SoftApConfiguration.BAND_5GHZ;
@@ -384,6 +386,7 @@
@Test
public void testDualChannels() {
+ assumeTrue(SdkLevel.isAtLeastS());
int[] expected_dual_bands = new int[2];
expected_dual_bands[0] = SoftApConfiguration.BAND_2GHZ;
expected_dual_bands[1] = SoftApConfiguration.BAND_5GHZ;
@@ -417,6 +420,7 @@
@Test
public void testInvalidBandWhenSetBands() {
+ assumeTrue(SdkLevel.isAtLeastS());
boolean isIllegalArgumentExceptionHappened = false;
int[] dual_bands = new int[2];
dual_bands[0] = SoftApConfiguration.BAND_2GHZ;
@@ -457,6 +461,7 @@
@Test
public void testInvalidConfigWhenSetChannels() {
+ assumeTrue(SdkLevel.isAtLeastS());
boolean isIllegalArgumentExceptionHappened = false;
SparseIntArray invalid_channels = new SparseIntArray();
try {
@@ -514,4 +519,14 @@
}
assertTrue(isIllegalArgumentExceptionHappened);
}
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testInvalidConfigWhenSet60GhzChannels() throws Exception {
+ SparseIntArray invalid_channels = new SparseIntArray();
+ invalid_channels.put(SoftApConfiguration.BAND_60GHZ, 99);
+ SoftApConfiguration config = new SoftApConfiguration.Builder()
+ .setSsid("ssid")
+ .setChannels(invalid_channels)
+ .build();
+ }
}
diff --git a/wifi/tests/src/android/net/wifi/SoftApInfoTest.java b/wifi/tests/src/android/net/wifi/SoftApInfoTest.java
index 2875843..2121d10 100644
--- a/wifi/tests/src/android/net/wifi/SoftApInfoTest.java
+++ b/wifi/tests/src/android/net/wifi/SoftApInfoTest.java
@@ -32,17 +32,22 @@
*/
@SmallTest
public class SoftApInfoTest {
-
+ private static final String TEST_AP_INSTANCE = "wlan1";
+ private static final int TEST_FREQUENCY = 2412;
+ private static final int TEST_BANDWIDTH = SoftApInfo.CHANNEL_WIDTH_20MHZ;
+ private static final int TEST_WIFI_STANDARD = ScanResult.WIFI_STANDARD_LEGACY;
+ private static final MacAddress TEST_AP_MAC = MacAddress.fromString("aa:bb:cc:dd:ee:ff");
/**
* Verifies copy constructor.
*/
@Test
public void testCopyOperator() throws Exception {
SoftApInfo info = new SoftApInfo();
- info.setFrequency(2412);
- info.setBandwidth(SoftApInfo.CHANNEL_WIDTH_20MHZ);
- info.setBssid(MacAddress.fromString("aa:bb:cc:dd:ee:ff"));
- info.setWifiStandard(ScanResult.WIFI_STANDARD_LEGACY);
+ info.setFrequency(TEST_FREQUENCY);
+ info.setBandwidth(TEST_BANDWIDTH);
+ info.setBssid(TEST_AP_MAC);
+ info.setWifiStandard(TEST_WIFI_STANDARD);
+ info.setApInstanceIdentifier(TEST_AP_INSTANCE);
SoftApInfo copiedInfo = new SoftApInfo(info);
@@ -57,10 +62,11 @@
@Test
public void testParcelOperation() throws Exception {
SoftApInfo info = new SoftApInfo();
- info.setFrequency(2412);
- info.setBandwidth(SoftApInfo.CHANNEL_WIDTH_20MHZ);
- info.setBssid(MacAddress.fromString("aa:bb:cc:dd:ee:ff"));
- info.setWifiStandard(ScanResult.WIFI_STANDARD_LEGACY);
+ info.setFrequency(TEST_FREQUENCY);
+ info.setBandwidth(TEST_BANDWIDTH);
+ info.setBssid(TEST_AP_MAC);
+ info.setWifiStandard(TEST_WIFI_STANDARD);
+ info.setApInstanceIdentifier(TEST_AP_INSTANCE);
Parcel parcelW = Parcel.obtain();
info.writeToParcel(parcelW, 0);
@@ -88,6 +94,27 @@
if (SdkLevel.isAtLeastS()) {
assertEquals(info.getBssid(), null);
assertEquals(info.getWifiStandard(), ScanResult.WIFI_STANDARD_UNKNOWN);
+ assertEquals(info.getApInstanceIdentifier(), null);
+ }
+ }
+
+ /**
+ * Verifies the set/get method same as expected.
+ */
+ @Test
+ public void testGetXXXAlignedWithSetXXX() throws Exception {
+ SoftApInfo info = new SoftApInfo();
+ info.setFrequency(TEST_FREQUENCY);
+ info.setBandwidth(TEST_BANDWIDTH);
+ info.setBssid(TEST_AP_MAC);
+ info.setWifiStandard(TEST_WIFI_STANDARD);
+ info.setApInstanceIdentifier(TEST_AP_INSTANCE);
+ assertEquals(info.getFrequency(), TEST_FREQUENCY);
+ assertEquals(info.getBandwidth(), TEST_BANDWIDTH);
+ if (SdkLevel.isAtLeastS()) {
+ assertEquals(info.getBssid(), TEST_AP_MAC);
+ assertEquals(info.getWifiStandard(), TEST_WIFI_STANDARD);
+ assertEquals(info.getApInstanceIdentifier(), TEST_AP_INSTANCE);
}
}
diff --git a/wifi/tests/src/android/net/wifi/WifiClientTest.java b/wifi/tests/src/android/net/wifi/WifiClientTest.java
index 7a3baf9..7046563 100644
--- a/wifi/tests/src/android/net/wifi/WifiClientTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiClientTest.java
@@ -42,9 +42,9 @@
*/
@Test
public void testWifiClientParcelWriteRead() throws Exception {
- WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS);
+ WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
- assertParcelSane(writeWifiClient, 1);
+ assertParcelSane(writeWifiClient, 2);
}
/**
@@ -52,12 +52,12 @@
*/
@Test
public void testWifiClientEquals() throws Exception {
- WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS);
- WifiClient writeWifiClientEquals = new WifiClient(MAC_ADDRESS);
+ WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
+ WifiClient writeWifiClientEquals = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
assertEquals(writeWifiClient, writeWifiClientEquals);
assertEquals(writeWifiClient.hashCode(), writeWifiClientEquals.hashCode());
- assertFieldCountEquals(1, WifiClient.class);
+ assertFieldCountEquals(2, WifiClient.class);
}
/**
@@ -66,8 +66,8 @@
@Test
public void testWifiClientNotEquals() throws Exception {
final MacAddress macAddressNotEquals = MacAddress.fromString("00:00:00:00:00:00");
- WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS);
- WifiClient writeWifiClientNotEquals = new WifiClient(macAddressNotEquals);
+ WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
+ WifiClient writeWifiClientNotEquals = new WifiClient(macAddressNotEquals, INTERFACE_NAME);
assertNotEquals(writeWifiClient, writeWifiClientNotEquals);
assertNotEquals(writeWifiClient.hashCode(), writeWifiClientNotEquals.hashCode());
diff --git a/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java b/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
index c253746..f351e61 100644
--- a/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
@@ -20,11 +20,13 @@
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_OPEN;
+import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_OSEN;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_OWE;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_PSK;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_SAE;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_WAPI_CERT;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_WAPI_PSK;
+import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_WEP;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
@@ -34,9 +36,13 @@
import static org.junit.Assert.assertTrue;
import android.net.MacAddress;
+import android.net.wifi.WifiConfiguration.GroupCipher;
import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.net.wifi.WifiConfiguration.NetworkSelectionStatus;
+import android.net.wifi.WifiConfiguration.PairwiseCipher;
+import android.net.wifi.WifiConfiguration.Protocol;
import android.os.Parcel;
+import android.util.Pair;
import androidx.test.filters.SmallTest;
@@ -45,6 +51,8 @@
import org.junit.Before;
import org.junit.Test;
+import java.util.List;
+
/**
* Unit tests for {@link android.net.wifi.WifiConfiguration}.
*/
@@ -187,18 +195,24 @@
@Test
public void testIsOpenNetwork_NotOpen_HasAuthType() {
- for (int keyMgmt = 0; keyMgmt < WifiConfiguration.KeyMgmt.strings.length; keyMgmt++) {
- if (keyMgmt == WifiConfiguration.KeyMgmt.NONE
- || keyMgmt == WifiConfiguration.KeyMgmt.OWE) {
- continue;
- }
+ int[] securityTypes = new int [] {
+ SECURITY_TYPE_WEP,
+ SECURITY_TYPE_PSK,
+ SECURITY_TYPE_EAP,
+ SECURITY_TYPE_SAE,
+ SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT,
+ SECURITY_TYPE_WAPI_PSK,
+ SECURITY_TYPE_WAPI_CERT,
+ SECURITY_TYPE_EAP_WPA3_ENTERPRISE,
+ SECURITY_TYPE_OSEN,
+ };
+ for (int type: securityTypes) {
WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(keyMgmt);
+ config.setSecurityParams(type);
config.wepKeys = null;
- assertFalse("Open network reported when key mgmt was set to "
- + WifiConfiguration.KeyMgmt.strings[keyMgmt], config.isOpenNetwork());
+ assertFalse("Open network reported when security type was set to "
+ + type, config.isOpenNetwork());
}
}
@@ -208,6 +222,7 @@
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
config.wepKeys = null;
+ config.convertLegacyFieldsToSecurityParamsIfNeeded();
assertFalse(config.isOpenNetwork());
}
@@ -865,4 +880,243 @@
}
return sb.toString();
}
+
+ private void verifyAllowedKeyManagement(WifiConfiguration config, int[] akms) {
+ for (int akm: akms) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedKeyManagement().get(akm)));
+ }
+ }
+
+ private void verifyAllowedProtocols(WifiConfiguration config, int[] aps) {
+ for (int ap: aps) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedProtocols().get(ap)));
+ }
+ }
+
+ private void verifyAllowedPairwiseCiphers(WifiConfiguration config, int[] apcs) {
+ for (int apc: apcs) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedPairwiseCiphers().get(apc)));
+ }
+ }
+
+ private void verifyAllowedGroupCiphers(WifiConfiguration config, int[] agcs) {
+ for (int agc: agcs) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedGroupCiphers().get(agc)));
+ }
+ }
+
+ /** Verify that adding security types works as expected. */
+ @Test
+ public void testAddSecurityTypes() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ config.addSecurityParams(SecurityParams.createWapiPskParams());
+ List<SecurityParams> paramsList = config.getSecurityParamsList();
+ assertEquals(3, paramsList.size());
+
+ verifyAllowedKeyManagement(config, new int[] {
+ KeyMgmt.WPA_PSK, KeyMgmt.SAE, KeyMgmt.WAPI_PSK});
+ verifyAllowedProtocols(config, new int[] {Protocol.WPA, Protocol.RSN, Protocol.WAPI});
+ verifyAllowedPairwiseCiphers(config, new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.TKIP,
+ PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256,
+ PairwiseCipher.SMS4});
+ verifyAllowedGroupCiphers(config, new int[] {
+ GroupCipher.CCMP, GroupCipher.TKIP,
+ GroupCipher.GCMP_128, GroupCipher.GCMP_256,
+ GroupCipher.SMS4});
+ }
+
+ /** Check that a personal security type can be added to a personal configuration. */
+ @Test
+ public void testAddPersonalTypeToPersonalConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ }
+
+ /** Check that an enterprise security type can be added to an enterprise configuration. */
+ @Test
+ public void testAddEnterpriseTypeToEnterpriseConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
+ config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
+ config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
+ }
+
+ /** Verify that adding an enterprise type to a personal configuration. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddEnterpriseTypeToPersonalConfig() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
+ }
+
+ /** Verify that adding a personal type to an enterprise configuration. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddPersonalTypeToEnterpriseConfig() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
+ config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
+ config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ }
+
+ /** Check that an open security cannot be added to a non-open configuration. */
+ @Test(expected = IllegalArgumentException.class)
+ public void testAddOpenTypeToNonOpenConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
+ }
+
+ /** Check that a non-open security cannot be added to an open configuration. */
+ @Test(expected = IllegalArgumentException.class)
+ public void testAddNonOpenTypeToOpenConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ }
+
+ /** Check that a OSEN security cannot be added as additional type. */
+ @Test(expected = IllegalArgumentException.class)
+ public void testAddOsenTypeToConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_OSEN);
+ }
+
+ /** Verify that adding duplicate security types raises the exception. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddDuplicateSecurityTypes() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ }
+
+ /** Verify that adding duplicate security params raises the exception. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddDuplicateSecurityParams() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(SecurityParams.createWpaWpa2PersonalParams());
+ config.addSecurityParams(SecurityParams.createWpaWpa2PersonalParams());
+ }
+
+ /** Verify that Suite-B type works as expected. */
+ @Test
+ public void testAddSuiteBSecurityType() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(SecurityParams.createWpa3EnterpriseParams());
+ config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
+ config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
+ config.addSecurityParams(SecurityParams.createWpa3Enterprise192BitParams());
+
+ assertFalse(config.isSuiteBCipherEcdheRsaEnabled());
+ config.enableSuiteBCiphers(false, true);
+ assertTrue(config.isSuiteBCipherEcdheRsaEnabled());
+ }
+
+ /** Verify that FILS bit can be set correctly. */
+ @Test
+ public void testFilsKeyMgmt() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+
+ config.enableFils(false, true);
+ assertFalse(config.isFilsSha256Enabled());
+ assertTrue(config.isFilsSha384Enabled());
+ }
+
+ /** Verify that SAE mode can be configured correctly. */
+ @Test
+ public void testSaeTypeMethods() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+
+ SecurityParams saeParams = config.getSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ assertNotNull(saeParams);
+ assertFalse(saeParams.isSaeH2eOnlyMode());
+ assertFalse(saeParams.isSaePkOnlyMode());
+
+ config.enableSaeH2eOnlyMode(true);
+ config.enableSaePkOnlyMode(true);
+
+ saeParams = config.getSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ assertNotNull(saeParams);
+ assertTrue(saeParams.isSaeH2eOnlyMode());
+ assertTrue(saeParams.isSaePkOnlyMode());
+ }
+
+ /** Verify the legacy configuration conversion */
+ @Test
+ public void testLegacyConfigurationConversion() {
+ Pair[] keyMgmtSecurityTypePairs = new Pair[] {
+ new Pair<>(KeyMgmt.WAPI_CERT, SECURITY_TYPE_WAPI_CERT),
+ new Pair<>(KeyMgmt.WAPI_PSK, SECURITY_TYPE_WAPI_PSK),
+ new Pair<>(KeyMgmt.SUITE_B_192, SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT),
+ new Pair<>(KeyMgmt.OWE, SECURITY_TYPE_OWE),
+ new Pair<>(KeyMgmt.SAE, SECURITY_TYPE_SAE),
+ new Pair<>(KeyMgmt.OSEN, SECURITY_TYPE_OSEN),
+ new Pair<>(KeyMgmt.WPA2_PSK, SECURITY_TYPE_PSK),
+ new Pair<>(KeyMgmt.WPA_EAP, SECURITY_TYPE_EAP),
+ new Pair<>(KeyMgmt.WPA_PSK, SECURITY_TYPE_PSK),
+ new Pair<>(KeyMgmt.NONE, SECURITY_TYPE_OPEN),
+ };
+
+ for (Pair pair: keyMgmtSecurityTypePairs) {
+ WifiConfiguration config = new WifiConfiguration();
+ config.allowedKeyManagement.set((int) pair.first);
+ config.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(config.getSecurityParams((int) pair.second));
+ }
+
+ // If none of key management is set, it should be open.
+ WifiConfiguration emptyConfig = new WifiConfiguration();
+ emptyConfig.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(emptyConfig.getSecurityParams(SECURITY_TYPE_OPEN));
+
+ // If EAP key management is set and requirePmf is true, it is WPA3 Enterprise.
+ WifiConfiguration wpa3EnterpriseConfig = new WifiConfiguration();
+ wpa3EnterpriseConfig.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ wpa3EnterpriseConfig.requirePmf = true;
+ wpa3EnterpriseConfig.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(wpa3EnterpriseConfig.getSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE));
+
+ // If key management is NONE and wep key is set, it is WEP type.
+ WifiConfiguration wepConfig = new WifiConfiguration();
+ wepConfig.allowedKeyManagement.set(KeyMgmt.NONE);
+ wepConfig.wepKeys = new String[] {"\"abcdef\""};
+ wepConfig.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(wepConfig.getSecurityParams(SECURITY_TYPE_WEP));
+ }
+
+ /** Verify the set security params by SecurityParams objects. */
+ @Test
+ public void testSetBySecurityParamsObject() {
+ Pair[] securityParamsSecurityTypePairs = new Pair[] {
+ new Pair<>(SecurityParams.createWapiCertParams(), SECURITY_TYPE_WAPI_CERT),
+ new Pair<>(SecurityParams.createWapiPskParams(), SECURITY_TYPE_WAPI_PSK),
+ new Pair<>(SecurityParams.createWpa3Enterprise192BitParams(),
+ SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT),
+ new Pair<>(SecurityParams.createEnhancedOpenParams(), SECURITY_TYPE_OWE),
+ new Pair<>(SecurityParams.createWpa3PersonalParams(), SECURITY_TYPE_SAE),
+ new Pair<>(SecurityParams.createOsenParams(), SECURITY_TYPE_OSEN),
+ new Pair<>(SecurityParams.createWpaWpa2EnterpriseParams(), SECURITY_TYPE_EAP),
+ new Pair<>(SecurityParams.createWpaWpa2PersonalParams(), SECURITY_TYPE_PSK),
+ new Pair<>(SecurityParams.createOpenParams(), SECURITY_TYPE_OPEN),
+ };
+ for (Pair pair: securityParamsSecurityTypePairs) {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams((SecurityParams) pair.first);
+ assertNotNull(config.getSecurityParams((int) pair.second));
+ }
+ }
}
diff --git a/wifi/tests/src/android/net/wifi/WifiManagerTest.java b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
index 52e9139..bd56e5b 100644
--- a/wifi/tests/src/android/net/wifi/WifiManagerTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
@@ -137,6 +137,7 @@
private static final int TEST_AP_FREQUENCY = 2412;
private static final int TEST_AP_BANDWIDTH = SoftApInfo.CHANNEL_WIDTH_20MHZ;
private static final int TEST_SUB_ID = 3;
+ private static final String TEST_AP_INSTANCE = "wlan1";
@Mock Context mContext;
@Mock android.net.wifi.IWifiManager mWifiService;
@@ -1111,6 +1112,27 @@
verify(mSoftApCallback).onInfoChanged(testSoftApInfo);
}
+ /*
+ * Verify client-provided callback is being called through callback proxy
+ */
+ @Test
+ public void softApCallbackProxyCallsOnSoftApInfoListChanged() throws Exception {
+ SoftApInfo testSoftApInfo = new SoftApInfo();
+ testSoftApInfo.setFrequency(TEST_AP_FREQUENCY);
+ testSoftApInfo.setBandwidth(TEST_AP_BANDWIDTH);
+ List<SoftApInfo> infoList = new ArrayList<>();
+ infoList.add(testSoftApInfo);
+ ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
+ ArgumentCaptor.forClass(ISoftApCallback.Stub.class);
+ mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
+ verify(mWifiService).registerSoftApCallback(any(IBinder.class), callbackCaptor.capture(),
+ anyInt());
+
+ callbackCaptor.getValue().onInfoListChanged(infoList);
+ mLooper.dispatchAll();
+ verify(mSoftApCallback).onInfoListChanged(infoList);
+ }
+
/*
* Verify client-provided callback is being called through callback proxy
@@ -1135,7 +1157,8 @@
*/
@Test
public void softApCallbackProxyCallsOnBlockedClientConnecting() throws Exception {
- WifiClient testWifiClient = new WifiClient(MacAddress.fromString("22:33:44:55:66:77"));
+ WifiClient testWifiClient = new WifiClient(MacAddress.fromString("22:33:44:55:66:77"),
+ TEST_AP_INSTANCE);
ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
ArgumentCaptor.forClass(ISoftApCallback.Stub.class);
mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
@@ -1157,6 +1180,8 @@
SoftApInfo testSoftApInfo = new SoftApInfo();
testSoftApInfo.setFrequency(TEST_AP_FREQUENCY);
testSoftApInfo.setBandwidth(TEST_AP_BANDWIDTH);
+ List<SoftApInfo> infoList = new ArrayList<>();
+ infoList.add(testSoftApInfo);
SoftApCapability testSoftApCapability = new SoftApCapability(0);
testSoftApCapability.setMaxSupportedClients(10);
ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
@@ -1169,6 +1194,7 @@
callbackCaptor.getValue().onStateChanged(WIFI_AP_STATE_ENABLING, 0);
callbackCaptor.getValue().onConnectedClientsChanged(testClients);
callbackCaptor.getValue().onInfoChanged(testSoftApInfo);
+ callbackCaptor.getValue().onInfoListChanged(infoList);
callbackCaptor.getValue().onStateChanged(WIFI_AP_STATE_FAILED, SAP_START_FAILURE_GENERAL);
callbackCaptor.getValue().onCapabilityChanged(testSoftApCapability);
@@ -1177,6 +1203,7 @@
verify(mSoftApCallback).onStateChanged(WIFI_AP_STATE_ENABLING, 0);
verify(mSoftApCallback).onConnectedClientsChanged(testClients);
verify(mSoftApCallback).onInfoChanged(testSoftApInfo);
+ verify(mSoftApCallback).onInfoListChanged(infoList);
verify(mSoftApCallback).onStateChanged(WIFI_AP_STATE_FAILED, SAP_START_FAILURE_GENERAL);
verify(mSoftApCallback).onCapabilityChanged(testSoftApCapability);
}
diff --git a/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java b/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
index e6eae416..c8006fe 100644
--- a/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
+++ b/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
@@ -16,6 +16,8 @@
package android.net.wifi.rtt;
+import static junit.framework.Assert.fail;
+
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -143,6 +145,7 @@
PeerHandle peerHandle1 = new PeerHandle(12);
RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(4);
builder.addAccessPoint(scanResult1);
builder.addAccessPoints(scanResults2and3);
builder.addWifiAwarePeer(mac1);
@@ -163,6 +166,60 @@
}
/**
+ * Validate the rtt burst size is set correctly when in range.
+ */
+ @Test
+ public void testRangingRequestSetBurstSize() {
+ ScanResult scanResult = new ScanResult();
+ scanResult.BSSID = "AA:BB:CC:DD:EE:FF";
+
+ // create request
+ RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(4);
+ builder.addAccessPoint(scanResult);
+ RangingRequest request = builder.build();
+
+ // confirm rtt burst size is set correctly to default value
+ assertEquals(request.getRttBurstSize(), 4);
+ }
+
+ /**
+ * Validate the rtt burst size cannot be smaller than the minimum.
+ */
+ @Test
+ public void testRangingRequestMinBurstSizeIsEnforced() {
+ ScanResult scanResult = new ScanResult();
+ scanResult.BSSID = "AA:BB:CC:DD:EE:FF";
+
+ // create request
+ try {
+ RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(RangingRequest.getMinRttBurstSize() - 1);
+ fail("RTT burst size was smaller than min value.");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ /**
+ * Validate the rtt burst size cannot exceed the maximum.
+ */
+ @Test
+ public void testRangingRequestMaxBurstSizeIsEnforced() {
+ ScanResult scanResult = new ScanResult();
+ scanResult.BSSID = "AA:BB:CC:DD:EE:FF";
+
+ // create request
+ try {
+ RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(RangingRequest.getMaxRttBurstSize() + 1);
+ fail("RTT Burst size exceeded max value.");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ /**
* Validate that can request as many range operation as the upper limit on number of requests.
*/
@Test
@@ -175,7 +232,7 @@
}
MacAddress mac1 = MacAddress.fromString("00:01:02:03:04:05");
- // create request
+ // create request using max RTT Peers
RangingRequest.Builder builder = new RangingRequest.Builder();
builder.addAccessPoint(scanResult);
builder.addAccessPoints(scanResultList);
@@ -185,6 +242,18 @@
// verify request
request.enforceValidity(true);
+ // confirm rtt burst size is set correctly to default value
+ assertEquals(request.getRttBurstSize(), RangingRequest.getDefaultRttBurstSize());
+ // confirm the number of peers in the request is the max number of peers
+ List<ResponderConfig> rttPeers = request.getRttPeers();
+ int numRttPeers = rttPeers.size();
+ assertEquals(RangingRequest.getMaxPeers(), numRttPeers);
+ // confirm each peer has the correct mac address
+ for (int i = 0; i < numRttPeers - 1; ++i) {
+ assertEquals("AA:BB:CC:DD:EE:FF", rttPeers.get(i).macAddress.toString().toUpperCase());
+ }
+ assertEquals("00:01:02:03:04:05",
+ rttPeers.get(numRttPeers - 1).macAddress.toString().toUpperCase());
}
/**